News for hackers. Stuff that matters.
Re:The Signal protocol for Node and browsers by tixzdk on Wednesday December 14, 2016 @10:13PM (#13182086)
I think the article gets this wrong. `window.crypto` should be read-only
Re:The Signal protocol for Node and browsers by ifelsehow on Wednesday December 14, 2016 @10:19PM (#13182118)
I find the following in Chrome:

> window.crypto.getRandomValues

// getRandomValues() { [native code] }

> window.crypto.getRandomValues = function () { return "aloha" }

> window.crypto.getRandomValues()

// "aloha"

Not sure if this is the case in all browsers. `window.crypto` certainly should be read-only.

Re:The Signal protocol for Node and browsers by niftich on Wednesday December 14, 2016 @11:04PM (#13182299)
In Chrome, window.crypto is read-only:

> window.crypto

< Crypto {subtle: SubtleCrypto}

> window.crypto = "hi!"

< "hi!"

> window.crypto

< Crypto {subtle: SubtleCrypto}

But not anything underneath, including getRandomValues(), as you write. A recent issue about this [1] on the WebCrypto spec itself was closed with 'wontfix' because in their view, polyfilling web APIs is a common and accepted practice.

[1] https://github.com/w3c/webcrypto/issues/107

Re:The Signal protocol for Node and browsers by flukus on Wednesday December 14, 2016 @11:43PM (#13182474)
Shouldn't all pollyfills check only override the functions if they're missing?
Re:The Signal protocol for Node and browsers by jsjohnst on Thursday December 15, 2016 @12:03AM (#13182570)
What if it's present but the implementation is incomplete?
Re:The Signal protocol for Node and browsers by paulddraper on Friday December 16, 2016 @12:22AM (#13191264)
E.g. an extra optional parameter.
Re:The Signal protocol for Node and browsers by rmrfrmrf on Wednesday December 14, 2016 @10:52PM (#13182242)
https://www.w3.org/Bugs/Public/show_bug.cgi?id=25345

It looks like they intentionally don't do that in order to prevent the illusion of security.