diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2019-05-06 17:21:11 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2019-05-17 19:30:09 +0300 |
commit | 49acbfad23df415977fb7a196c6aae2d7406b489 (patch) | |
tree | 95dfe2fcbeb2b47e6057811532937a70ed5a6125 /src/test/rng_test_helpers.c | |
parent | aa4f2f739737edd8d1570474ee459d5b98713aba (diff) | |
download | tor-49acbfad23df415977fb7a196c6aae2d7406b489.tar.gz tor-49acbfad23df415977fb7a196c6aae2d7406b489.zip |
Don't forget to use the mutex in testing_enable_prefilled_rng()
Diffstat (limited to 'src/test/rng_test_helpers.c')
-rw-r--r-- | src/test/rng_test_helpers.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/test/rng_test_helpers.c b/src/test/rng_test_helpers.c index 262d380bda..d268cb64b7 100644 --- a/src/test/rng_test_helpers.c +++ b/src/test/rng_test_helpers.c @@ -185,10 +185,14 @@ testing_enable_prefilled_rng(const void *buffer, size_t buflen) tor_assert(buflen > 0); rng_mutex = tor_mutex_new(); + tor_mutex_acquire(rng_mutex); + prefilled_rng_buffer = tor_memdup(buffer, buflen); prefilled_rng_buflen = buflen; prefilled_rng_idx = 0; + tor_mutex_release(rng_mutex); + MOCK(crypto_rand, crypto_rand_prefilled); MOCK(crypto_strongest_rand_, mock_crypto_strongest_rand); } |