hs-v2: Disable SOCKS connection for v2 addresses

This effectively turns off the ability of tor to use HSv2 as a client by
invalidating the v2 onion hostname passed through a SOCKS request.

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
This commit is contained in:
David Goulet 2021-09-30 10:26:37 -04:00
parent fcef8e3f75
commit 13b2b1108f

View File

@ -4348,9 +4348,6 @@ parse_extended_hostname(char *address)
if (q != address) { if (q != address) {
memmove(address, q, strlen(q) + 1 /* also get \0 */); memmove(address, q, strlen(q) + 1 /* also get \0 */);
} }
if (rend_valid_v2_service_id(query)) {
return ONION_V2_HOSTNAME; /* success */
}
if (hs_address_is_valid(query)) { if (hs_address_is_valid(query)) {
return ONION_V3_HOSTNAME; return ONION_V3_HOSTNAME;
} }