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/nodelist.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/or/nodelist.c') diff --git a/src/or/nodelist.c b/src/or/nodelist.c index 6acc87f967..f670870f61 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -863,6 +863,28 @@ node_supports_ed25519_hs_intro(const node_t *node) return 0; } +/** Return true iff node supports to be a rendezvous point for hidden + * service version 3 (HSRend=2). */ +int +node_supports_v3_rendezvous_point(const node_t *node) +{ + tor_assert(node); + + if (node->rs) { + return node->rs->supports_v3_rendezvous_point; + } + if (node->ri) { + if (node->ri->protocol_list == NULL) { + return 0; + } + return protocol_list_supports_protocol(node->ri->protocol_list, + PRT_HSREND, + PROTOVER_HS_RENDEZVOUS_POINT_V3); + } + tor_assert_nonfatal_unreached_once(); + return 0; +} + /** Return the RSA ID key's SHA1 digest for the provided node. */ const uint8_t * node_get_rsa_id_digest(const node_t *node) -- cgit v1.2.3-54-g00ecf