mirror of
https://github.com/jedisct1/libsodium.git
synced 2024-12-23 20:15:19 -07:00
Fail if JS crypto is not available.
Emscripten registers /dev/urandom and /dev/random by default, but falls back to Math.random()*256 when crypto.getRandomValues() is not available, which is not acceptable. So we need to re-register them no matter what.
This commit is contained in:
parent
4c8a35ca82
commit
b0403efc80
@ -23,7 +23,9 @@ Module['preRun'].push(function(){
|
||||
}
|
||||
randombyte_node();
|
||||
randombyte = randombyte_node;
|
||||
} catch(e) { }
|
||||
} catch(e) {
|
||||
throw 'No secure random number generator found';
|
||||
}
|
||||
}
|
||||
FS.init();
|
||||
var devFolder = FS.findObject('/dev') ||
|
||||
|
Loading…
Reference in New Issue
Block a user