Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
belenios
belenios
Commits
b0ded55d
Commit
b0ded55d
authored
Mar 17, 2017
by
Stephane Glondu
Browse files
Add the possibility to use /dev/urandom via an environment variable
Only in debug mode.
parent
c779983f
Changes
2
Hide whitespace changes
Inline
Side-by-side
demo/demo.sh
View file @
b0ded55d
...
...
@@ -2,6 +2,8 @@
set
-e
export
BELENIOS_USE_URANDOM
=
1
BELENIOS
=
${
BELENIOS
:-
$PWD
}
belenios-tool
()
{
...
...
src/platform/native/platform.ml
View file @
b0ded55d
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment