diff options
author | David Goulet <dgoulet@torproject.org> | 2021-02-16 10:55:56 -0500 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-02-19 13:20:49 -0500 |
commit | 9782cd2c9be8e6581eaee246faa9c4ac4554b2d5 (patch) | |
tree | f357a170f47ddf5e093dfb8bd3d315b1cb7188d8 /src/feature/hs/hs_circuitmap.c | |
parent | 897ec8a34cbdfc510ddddd33cc027e13985fde8f (diff) | |
download | tor-9782cd2c9be8e6581eaee246faa9c4ac4554b2d5.tar.gz tor-9782cd2c9be8e6581eaee246faa9c4ac4554b2d5.zip |
hs: Remove v2 code from HS circuitmap
Related to #40266
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/feature/hs/hs_circuitmap.c')
-rw-r--r-- | src/feature/hs/hs_circuitmap.c | 62 |
1 files changed, 3 insertions, 59 deletions
diff --git a/src/feature/hs/hs_circuitmap.c b/src/feature/hs/hs_circuitmap.c index e46b008a5c..ee416e0d24 100644 --- a/src/feature/hs/hs_circuitmap.c +++ b/src/feature/hs/hs_circuitmap.c @@ -273,7 +273,7 @@ hs_circuitmap_get_or_circuit(hs_token_type_t type, /**** Public relay-side getters: */ -/** Public function: Return v2 and v3 introduction circuit to this relay. +/** Public function: Return v3 introduction circuit to this relay. * Always return a newly allocated list for which it is the caller's * responsibility to free it. */ smartlist_t * @@ -286,12 +286,11 @@ hs_circuitmap_get_all_intro_circ_relay_side(void) circuit_t *circ = *iter; /* An origin circuit or purpose is wrong or the hs token is not set to be - * a v2 or v3 intro relay side type, we ignore the circuit. Else, we have + * a v3 intro relay side type, we ignore the circuit. Else, we have * a match so add it to our list. */ if (CIRCUIT_IS_ORIGIN(circ) || circ->purpose != CIRCUIT_PURPOSE_INTRO_POINT || - (circ->hs_token->type != HS_TOKEN_INTRO_V3_RELAY_SIDE && - circ->hs_token->type != HS_TOKEN_INTRO_V2_RELAY_SIDE)) { + circ->hs_token->type != HS_TOKEN_INTRO_V3_RELAY_SIDE) { continue; } smartlist_add(circuit_list, circ); @@ -312,16 +311,6 @@ hs_circuitmap_get_intro_circ_v3_relay_side( CIRCUIT_PURPOSE_INTRO_POINT); } -/** Public function: Return v2 introduction circuit to this relay with - * <b>digest</b>. Return NULL if no such circuit is found in the circuitmap. */ -or_circuit_t * -hs_circuitmap_get_intro_circ_v2_relay_side(const uint8_t *digest) -{ - return hs_circuitmap_get_or_circuit(HS_TOKEN_INTRO_V2_RELAY_SIDE, - REND_TOKEN_LEN, digest, - CIRCUIT_PURPOSE_INTRO_POINT); -} - /** Public function: Return rendezvous circuit to this relay with rendezvous * <b>cookie</b>. Return NULL if no such circuit is found in the circuitmap. */ or_circuit_t * @@ -344,16 +333,6 @@ hs_circuitmap_register_rend_circ_relay_side(or_circuit_t *circ, HS_TOKEN_REND_RELAY_SIDE, REND_TOKEN_LEN, cookie); } -/** Public function: Register v2 intro circuit with key <b>digest</b> to the - * circuitmap. */ -void -hs_circuitmap_register_intro_circ_v2_relay_side(or_circuit_t *circ, - const uint8_t *digest) -{ - hs_circuitmap_register_circuit(TO_CIRCUIT(circ), - HS_TOKEN_INTRO_V2_RELAY_SIDE, - REND_TOKEN_LEN, digest); -} /** Public function: Register v3 intro circuit with key <b>auth_key</b> to the * circuitmap. */ @@ -393,30 +372,6 @@ hs_circuitmap_get_intro_circ_v3_service_side(const return circ; } -/** Public function: Return v2 introduction circuit originating from this - * hidden service with <b>digest</b>. Return NULL if no such circuit is found - * in the circuitmap. */ -origin_circuit_t * -hs_circuitmap_get_intro_circ_v2_service_side(const uint8_t *digest) -{ - origin_circuit_t *circ = NULL; - - /* Check first for established intro circuits */ - circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_INTRO_V2_SERVICE_SIDE, - REND_TOKEN_LEN, digest, - CIRCUIT_PURPOSE_S_INTRO); - if (circ) { - return circ; - } - - /* ...if nothing found, check for pending intro circs */ - circ = hs_circuitmap_get_origin_circuit(HS_TOKEN_INTRO_V2_SERVICE_SIDE, - REND_TOKEN_LEN, digest, - CIRCUIT_PURPOSE_S_ESTABLISH_INTRO); - - return circ; -} - /** Public function: Return rendezvous circuit originating from this hidden * service with rendezvous <b>cookie</b>. Return NULL if no such circuit is * found in the circuitmap. */ @@ -515,17 +470,6 @@ hs_circuitmap_get_established_rend_circ_client_side(const uint8_t *cookie) /**** Public servide-side setters: */ -/** Public function: Register v2 intro circuit with key <b>digest</b> to the - * circuitmap. */ -void -hs_circuitmap_register_intro_circ_v2_service_side(origin_circuit_t *circ, - const uint8_t *digest) -{ - hs_circuitmap_register_circuit(TO_CIRCUIT(circ), - HS_TOKEN_INTRO_V2_SERVICE_SIDE, - REND_TOKEN_LEN, digest); -} - /** Public function: Register v3 intro circuit with key <b>auth_key</b> to the * circuitmap. */ void |