From: George Kadianakis Date: Wed, 28 Jun 2017 14:22:59 +0000 (+0300) Subject: nodelist: Make HSv3 protover magic numbers a bit more readable. X-Git-Tag: tor-0.3.2.1-alpha~270^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=551ad20c43b39c384cbab9eee5442d4fa9cfefb1;p=thirdparty%2Ftor.git nodelist: Make HSv3 protover magic numbers a bit more readable. --- diff --git a/src/or/nodelist.c b/src/or/nodelist.c index a04f4154b7..4513e97188 100644 --- a/src/or/nodelist.c +++ b/src/or/nodelist.c @@ -722,7 +722,7 @@ node_supports_v3_hsdir(const node_t *node) return 0; } return protocol_list_supports_protocol(node->ri->protocol_list, - PRT_HSDIR, 2); + PRT_HSDIR, PROTOVER_HSDIR_V3); } tor_assert_nonfatal_unreached_once(); return 0; @@ -743,7 +743,7 @@ node_supports_ed25519_hs_intro(const node_t *node) return 0; } return protocol_list_supports_protocol(node->ri->protocol_list, - PRT_HSINTRO, 4); + PRT_HSINTRO, PROTOVER_HS_INTRO_V3); } tor_assert_nonfatal_unreached_once(); return 0; diff --git a/src/or/protover.h b/src/or/protover.h index 22667bed79..2066aeec72 100644 --- a/src/or/protover.h +++ b/src/or/protover.h @@ -17,6 +17,11 @@ /* This is a guess. */ #define FIRST_TOR_VERSION_TO_ADVERTISE_PROTOCOLS "0.2.9.3-alpha" +/** The protover version number that signifies HSDir support for HSv3 */ +#define PROTOVER_HSDIR_V3 2 +/** The protover version number that signifies HSv3 intro point support */ +#define PROTOVER_HS_INTRO_V3 4 + /** List of recognized subprotocols. */ typedef enum protocol_type_t { PRT_LINK,