From c527cde82f74849ec3b183159d20441019b77e2e Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 30 Aug 2017 10:13:22 -0400 Subject: prop224: Pick rendezvous point of protover HSRend=2 Version 3 hidden service needs rendezvous point that have the protocol version HSRend >= 2 else the rendezvous cells are rejected. Fixes #23361 Signed-off-by: David Goulet --- src/or/hs_client.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/or/hs_client.c') diff --git a/src/or/hs_client.c b/src/or/hs_client.c index 99be058eb7..2acc639e49 100644 --- a/src/or/hs_client.c +++ b/src/or/hs_client.c @@ -24,6 +24,7 @@ #include "circuitlist.h" #include "circuituse.h" #include "connection.h" +#include "nodelist.h" #include "circpathbias.h" #include "connection.h" #include "hs_ntor.h" @@ -461,9 +462,21 @@ client_rendezvous_circ_has_opened(origin_circuit_t *circ) tor_assert(circ); tor_assert(TO_CIRCUIT(circ)->purpose == CIRCUIT_PURPOSE_C_ESTABLISH_REND); + const extend_info_t *rp_ei = circ->build_state->chosen_exit; + + /* Check that we didn't accidentally choose a node that does not understand + * the v3 rendezvous protocol */ + if (rp_ei) { + const node_t *rp_node = node_get_by_id(rp_ei->identity_digest); + if (rp_node) { + if (BUG(!node_supports_v3_rendezvous_point(rp_node))) { + return; + } + } + } + log_info(LD_REND, "Rendezvous circuit has opened to %s.", - safe_str_client( - extend_info_describe(circ->build_state->chosen_exit))); + safe_str_client(extend_info_describe(rp_ei))); /* Ignore returned value, nothing we can really do. On failure, the circuit * will be marked for close. */ -- cgit v1.2.3-54-g00ecf