diff options
author | David Goulet <dgoulet@torproject.org> | 2019-04-30 11:17:45 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-04-30 11:17:45 -0400 |
commit | e543c4e20c50035df61cdfaae75ee4dbb61409bf (patch) | |
tree | 3a36462ee3965801585ba7a6d7a989a89587bef3 /src/test/test_hs_descriptor.c | |
parent | 44e6663b8a51187e80a3f94d1185950cf62b4264 (diff) | |
parent | 48e1ab17204944e6197002dfa3d3d0c8a08184dc (diff) | |
download | tor-e543c4e20c50035df61cdfaae75ee4dbb61409bf.tar.gz tor-e543c4e20c50035df61cdfaae75ee4dbb61409bf.zip |
Merge branch 'tor-github/pr/909'
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_descriptor.c')
-rw-r--r-- | src/test/test_hs_descriptor.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/test/test_hs_descriptor.c b/src/test/test_hs_descriptor.c index 86965d7d66..5a3fd46dbe 100644 --- a/src/test/test_hs_descriptor.c +++ b/src/test/test_hs_descriptor.c @@ -21,6 +21,7 @@ #include "test/hs_test_helpers.h" #include "test/test_helpers.h" #include "test/log_test_helpers.h" +#include "test/rng_test_helpers.h" #ifdef HAVE_CFLAG_WOVERLENGTH_STRINGS DISABLE_GCC_WARNING(overlength-strings) @@ -30,13 +31,6 @@ DISABLE_GCC_WARNING(overlength-strings) #include "test_hs_descriptor.inc" ENABLE_GCC_WARNING(overlength-strings) -/* Mock function to fill all bytes with 1 */ -static void -mock_crypto_strongest_rand(uint8_t *out, size_t out_len) -{ - memset(out, 1, out_len); -} - /* Test certificate encoding put in a descriptor. */ static void test_cert_encoding(void *arg) @@ -799,7 +793,7 @@ test_build_authorized_client(void *arg) client_pubkey_b16, strlen(client_pubkey_b16)); - MOCK(crypto_strongest_rand_, mock_crypto_strongest_rand); + testing_enable_prefilled_rng("\x01", 1); hs_desc_build_authorized_client(subcredential, &client_auth_pk, &auth_ephemeral_sk, @@ -815,7 +809,7 @@ test_build_authorized_client(void *arg) done: tor_free(desc_client); tor_free(mem_op_hex_tmp); - UNMOCK(crypto_strongest_rand_); + testing_disable_prefilled_rng(); } struct testcase_t hs_descriptor[] = { |