relay: Don't advertise HSv2 protocol version

We removed HSIntro=3 and HSDir=1 that are v2 specific. Since 0.3.5.17,
we do not support introducing or being a directory for onion service v2.

Closes #40509

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2021-11-04 14:44:58 -04:00
parent 4a24673436
commit 72041c6306
3 changed files with 12 additions and 8 deletions

4
changes/ticket40509 Normal file
View File

@ -0,0 +1,4 @@
o Minor bugfix (relay):
- Remove the HSDir and HSIntro onion service v2 protocol versions so relay
stop advertising that they support them. Fixes bug 40509; bugfix on
0.3.5.17.

View File

@ -423,8 +423,8 @@ protover_get_supported_protocols(void)
"Cons=1-2 " "Cons=1-2 "
"Desc=1-2 " "Desc=1-2 "
"DirCache=1-2 " "DirCache=1-2 "
"HSDir=1-2 " "HSDir=2 "
"HSIntro=3-4 " "HSIntro=4 "
"HSRend=1-2 " "HSRend=1-2 "
"Link=1-5 " "Link=1-5 "
#ifdef HAVE_WORKING_TOR_TLS_GET_TLSSECRETS #ifdef HAVE_WORKING_TOR_TLS_GET_TLSSECRETS
@ -475,7 +475,7 @@ protover_get_supported_protocols(void)
const char * const char *
protover_get_recommended_client_protocols(void) protover_get_recommended_client_protocols(void)
{ {
return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 " return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=2 HSIntro=4 HSRend=1 "
"Link=4 Microdesc=1-2 Relay=2"; "Link=4 Microdesc=1-2 Relay=2";
} }
@ -484,7 +484,7 @@ protover_get_recommended_client_protocols(void)
const char * const char *
protover_get_recommended_relay_protocols(void) protover_get_recommended_relay_protocols(void)
{ {
return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 " return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=2 HSIntro=4 HSRend=1 "
"Link=4 Microdesc=1-2 Relay=2"; "Link=4 Microdesc=1-2 Relay=2";
} }
@ -493,7 +493,7 @@ protover_get_recommended_relay_protocols(void)
const char * const char *
protover_get_required_client_protocols(void) protover_get_required_client_protocols(void)
{ {
return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 " return "Cons=1-2 Desc=1-2 DirCache=1 HSDir=2 HSIntro=4 HSRend=1 "
"Link=4 Microdesc=1-2 Relay=2"; "Link=4 Microdesc=1-2 Relay=2";
} }
@ -502,7 +502,7 @@ protover_get_required_client_protocols(void)
const char * const char *
protover_get_required_relay_protocols(void) protover_get_required_relay_protocols(void)
{ {
return "Cons=1 Desc=1 DirCache=1 HSDir=1 HSIntro=3 HSRend=1 " return "Cons=1 Desc=1 DirCache=1 HSDir=2 HSIntro=4 HSRend=1 "
"Link=3-4 Microdesc=1 Relay=1-2"; "Link=3-4 Microdesc=1 Relay=1-2";
} }

View File

@ -369,12 +369,12 @@ test_protover_supports_version(void *arg)
/* Highest supported HSv2 introduce protocol version. /* Highest supported HSv2 introduce protocol version.
* Hard-coded here, because it does not appear anywhere in the code. * Hard-coded here, because it does not appear anywhere in the code.
* It's not clear if we actually support version 2, see #25068. */ * It's not clear if we actually support version 2, see #25068. */
#define PROTOVER_HSINTRO_V2 3 #define PROTOVER_HSINTRO_V2 4
/* HSv2 Rend and HSDir protocol versions. /* HSv2 Rend and HSDir protocol versions.
* Hard-coded here, because they do not appear anywhere in the code. */ * Hard-coded here, because they do not appear anywhere in the code. */
#define PROTOVER_HS_RENDEZVOUS_POINT_V2 1 #define PROTOVER_HS_RENDEZVOUS_POINT_V2 1
#define PROTOVER_HSDIR_V2 1 #define PROTOVER_HSDIR_V2 2
/* DirCache, Desc, Microdesc, and Cons protocol versions. /* DirCache, Desc, Microdesc, and Cons protocol versions.
* Hard-coded here, because they do not appear anywhere in the code. */ * Hard-coded here, because they do not appear anywhere in the code. */