diff options
author | David Goulet <dgoulet@torproject.org> | 2019-06-11 08:28:13 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2019-08-06 07:58:14 -0400 |
commit | c5b00c5a514a6b40e5245bc1fd78fe5490922739 (patch) | |
tree | 52c2c6791d959c84c7c2b0d538e8aac1d5cb913a /src/test/test_hs_intropoint.c | |
parent | fec0a7b7cbae344bd813152c8a04b6e87b6fa9a7 (diff) | |
download | tor-c5b00c5a514a6b40e5245bc1fd78fe5490922739.tar.gz tor-c5b00c5a514a6b40e5245bc1fd78fe5490922739.zip |
hs-v3: Add consensus parameters for DoS defenses
Part of #15516
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_hs_intropoint.c')
-rw-r--r-- | src/test/test_hs_intropoint.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/test_hs_intropoint.c b/src/test/test_hs_intropoint.c index 87338b448f..1d472397ca 100644 --- a/src/test/test_hs_intropoint.c +++ b/src/test/test_hs_intropoint.c @@ -26,6 +26,7 @@ #include "feature/hs/hs_cell.h" #include "feature/hs/hs_circuitmap.h" #include "feature/hs/hs_common.h" +#include "feature/hs/hs_dos.h" #include "feature/hs/hs_intropoint.h" #include "feature/hs/hs_service.h" @@ -185,6 +186,8 @@ test_establish_intro_wrong_purpose(void *arg) (void)arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); memcpy(intro_circ->rend_circ_nonce, circ_nonce, DIGEST_LEN); @@ -227,6 +230,8 @@ test_establish_intro_wrong_keytype(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -254,6 +259,8 @@ test_establish_intro_wrong_keytype2(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -290,6 +297,8 @@ test_establish_intro_wrong_mac(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -362,6 +371,8 @@ test_establish_intro_wrong_auth_key_len(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -407,6 +418,8 @@ test_establish_intro_wrong_sig_len(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -450,6 +463,8 @@ test_establish_intro_wrong_sig(void *arg) (void) arg; + hs_dos_init(); + /* Get the auth key of the intro point */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -487,6 +502,8 @@ helper_establish_intro_v3(or_circuit_t *intro_circ) tt_assert(intro_circ); + hs_dos_init(); + /* Prepare the circuit for the incoming ESTABLISH_INTRO */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); @@ -522,6 +539,8 @@ helper_establish_intro_v2(or_circuit_t *intro_circ) tt_assert(intro_circ); + hs_dos_init(); + /* Prepare the circuit for the incoming ESTABLISH_INTRO */ crypto_rand(circ_nonce, sizeof(circ_nonce)); helper_prepare_circ_for_intro(intro_circ, circ_nonce); |