diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-12-08 10:54:42 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-12-08 10:54:42 -0500 |
commit | 2259de0de726f3f617b2451d64f72f0d4d6bc0ae (patch) | |
tree | 6aeca7dc70a1231f8fd413d9572adbdf0a5c228f /src/common/crypto_ed25519.c | |
parent | 943369f927967268cacd2067ccae0bc5f1c5835e (diff) | |
download | tor-2259de0de726f3f617b2451d64f72f0d4d6bc0ae.tar.gz tor-2259de0de726f3f617b2451d64f72f0d4d6bc0ae.zip |
Always hash crypto_strongest_rand() along with some prng
(before using it for anything besides feeding the PRNG)
Part of #17694
Diffstat (limited to 'src/common/crypto_ed25519.c')
-rw-r--r-- | src/common/crypto_ed25519.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/crypto_ed25519.c b/src/common/crypto_ed25519.c index 1749efc34c..41ec486f0a 100644 --- a/src/common/crypto_ed25519.c +++ b/src/common/crypto_ed25519.c @@ -107,7 +107,9 @@ ed25519_secret_key_generate(ed25519_secret_key_t *seckey_out, { int r; uint8_t seed[32]; - if (! extra_strong || crypto_strongest_rand(seed, sizeof(seed)) < 0) + if (extra_strong) + crypto_strongest_rand(seed, sizeof(seed)); + else crypto_rand((char*)seed, sizeof(seed)); r = get_ed_impl()->seckey_expand(seckey_out->seckey, seed); |