diff options
author | Nick Mathewson <nickm@torproject.org> | 2018-09-18 12:40:18 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2018-09-18 12:40:18 -0400 |
commit | ea5792f333b1b92306d20e60b5e12bb0633aa740 (patch) | |
tree | 48f82aafe09b28d36c8034e800ef966d006b0960 /src/lib/crypt_ops/crypto_rand.h | |
parent | 50367d06f2ae1a06e6553a8925b5aded7f610082 (diff) | |
download | tor-ea5792f333b1b92306d20e60b5e12bb0633aa740.tar.gz tor-ea5792f333b1b92306d20e60b5e12bb0633aa740.zip |
Make crypto_strongest_rand() non-mockable
Instead, have it call a mockable function. We don't want
crypto_strongest_rand() to be mockable, since doing so creates a
type error when we call it from ed25519-donna, which we do not build
in a test mode.
Fixes bug 27728; bugfix on 0.3.5.1-alpha
Diffstat (limited to 'src/lib/crypt_ops/crypto_rand.h')
-rw-r--r-- | src/lib/crypt_ops/crypto_rand.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/crypt_ops/crypto_rand.h b/src/lib/crypt_ops/crypto_rand.h index 25bcfa1f1c..0c538d81ac 100644 --- a/src/lib/crypt_ops/crypto_rand.h +++ b/src/lib/crypt_ops/crypto_rand.h @@ -21,7 +21,8 @@ int crypto_seed_rng(void) ATTR_WUR; MOCK_DECL(void,crypto_rand,(char *to, size_t n)); void crypto_rand_unmocked(char *to, size_t n); -MOCK_DECL(void,crypto_strongest_rand,(uint8_t *out, size_t out_len)); +void crypto_strongest_rand(uint8_t *out, size_t out_len); +MOCK_DECL(void,crypto_strongest_rand_,(uint8_t *out, size_t out_len)); int crypto_rand_int(unsigned int max); int crypto_rand_int_range(unsigned int min, unsigned int max); uint64_t crypto_rand_uint64_range(uint64_t min, uint64_t max); |