summaryrefslogtreecommitdiff
path: root/src/or/hs_client.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2017-08-30 10:13:22 -0400
committerNick Mathewson <nickm@torproject.org>2017-09-07 08:35:28 -0400
commitc527cde82f74849ec3b183159d20441019b77e2e (patch)
tree4a11946ed0460378926fbbf991079c3d66cc0562 /src/or/hs_client.c
parent209bfe715cc8c1c59b2578c406749a0d4a5bd8cb (diff)
downloadtor-c527cde82f74849ec3b183159d20441019b77e2e.tar.gz
tor-c527cde82f74849ec3b183159d20441019b77e2e.zip
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 <dgoulet@torproject.org>
Diffstat (limited to 'src/or/hs_client.c')
-rw-r--r--src/or/hs_client.c17
1 files changed, 15 insertions, 2 deletions
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. */