diff options
author | George Kadianakis <desnacked@riseup.net> | 2017-07-25 12:05:02 +0300 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2017-08-24 13:03:28 -0400 |
commit | 3152c583af052571cbcd058bb1569f2ad821ec42 (patch) | |
tree | 284fed4306acb11786458ecbdc6a6e08256e7b35 /src/test/test_circuitlist.c | |
parent | e67f8623f95082341c06c9c70ef664ed7b186483 (diff) | |
download | tor-3152c583af052571cbcd058bb1569f2ad821ec42.tar.gz tor-3152c583af052571cbcd058bb1569f2ad821ec42.zip |
prop224: Add client-side rend circuit support to HS circuitmap
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/test/test_circuitlist.c')
-rw-r--r-- | src/test/test_circuitlist.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/test_circuitlist.c b/src/test/test_circuitlist.c index 344ab27921..6b8dae31f4 100644 --- a/src/test/test_circuitlist.c +++ b/src/test/test_circuitlist.c @@ -180,6 +180,7 @@ static void test_rend_token_maps(void *arg) { or_circuit_t *c1, *c2, *c3, *c4; + origin_circuit_t *c5; const uint8_t tok1[REND_TOKEN_LEN] = "The cat can't tell y"; const uint8_t tok2[REND_TOKEN_LEN] = "ou its name, and it "; const uint8_t tok3[REND_TOKEN_LEN] = "doesn't really care."; @@ -194,6 +195,7 @@ test_rend_token_maps(void *arg) c2 = or_circuit_new(0, NULL); c3 = or_circuit_new(0, NULL); c4 = or_circuit_new(0, NULL); + c5 = origin_circuit_new(); /* Make sure we really filled up the tok* variables */ tt_int_op(tok1[REND_TOKEN_LEN-1], OP_EQ, 'y'); @@ -264,6 +266,13 @@ test_rend_token_maps(void *arg) tt_ptr_op(TO_CIRCUIT(c4)->hs_token, OP_EQ, NULL); tt_ptr_op(NULL, OP_EQ, hs_circuitmap_get_intro_circ_v2_relay_side(tok3)); + /* Now let's do a check for the client-side rend circuitmap */ + c5->base_.purpose = CIRCUIT_PURPOSE_C_REND_READY; + hs_circuitmap_register_rend_circ_client_side(c5, tok1); + + tt_ptr_op(c5, OP_EQ, hs_circuitmap_get_rend_circ_client_side(tok1)); + tt_ptr_op(NULL, OP_EQ, hs_circuitmap_get_rend_circ_client_side(tok2)); + done: if (c1) circuit_free(TO_CIRCUIT(c1)); @@ -273,6 +282,8 @@ test_rend_token_maps(void *arg) circuit_free(TO_CIRCUIT(c3)); if (c4) circuit_free(TO_CIRCUIT(c4)); + if (c5) + circuit_free(TO_CIRCUIT(c5)); } static void |