Commit b0ded55d authored by Stephane Glondu's avatar Stephane Glondu

Add the possibility to use /dev/urandom via an environment variable

Only in debug mode.
parent c779983f
......@@ -2,6 +2,8 @@
set -e
export BELENIOS_USE_URANDOM=1
BELENIOS=${BELENIOS:-$PWD}
belenios-tool () {
......
......@@ -70,7 +70,13 @@ let pbkdf2_hex ~iterations ~salt x =
transform_string (Hexa.encode ())
type rng = Cryptokit.Random.rng
let secure_rng = Cryptokit.Random.secure_rng
let secure_rng =
if Belenios_version.debug &&
(try Sys.getenv "BELENIOS_USE_URANDOM" with Not_found -> "") <> ""
then Cryptokit.Random.device_rng "/dev/urandom"
else Cryptokit.Random.secure_rng
let pseudo_rng = Cryptokit.Random.pseudo_rng
let random_string = Cryptokit.Random.string
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment