Re:Proton.B: What this Mac malware does
by fulafel on Sunday May 14, 2017 @10:49AM
(#14335840)
This is a HTML feature now, it's called sub-resource integrity. So you just put the hash inside a new element called "integrity" when you refer to external resources. Like so: <a href="..." integrity="...">
[ Parent
| on HN ]
Correcting myself: looks like the SRI spec hasn't included the <a> element in the list of supported elements, though it has a mention that it might be supported in a future version :(
How does the browser know what hash algo to use?
https://hacks.mozilla.org/2015/09/subresource-integrity-in-f...
"As you may have noticed, the integrity attribute does not just include the hash value. It also contains the digest name. The syntax for the integrity attribute allows multiple tokens of this name-value format. This allows site owners to specify hashes of different strengths as well as the values of multiple scripts that may be behind a URL. This is useful for browser sniffing or content negotiation."