diff options
author | David Goulet <dgoulet@torproject.org> | 2021-06-29 09:56:44 -0400 |
---|---|---|
committer | David Goulet <dgoulet@torproject.org> | 2021-06-29 09:56:44 -0400 |
commit | 301ffb71a695e89f2e4905e2260fce15439259f1 (patch) | |
tree | 3f0b31db872dff862ba83fc37e6d49d98f31d23b /src/core | |
parent | 45c8d69cbbde06cc8046e7f1fce25a5aee049d4e (diff) | |
download | tor-301ffb71a695e89f2e4905e2260fce15439259f1.tar.gz tor-301ffb71a695e89f2e4905e2260fce15439259f1.zip |
hs: Send back 0xF6 for a v2 onion address
Fixes #40421
Signed-off-by: David Goulet <dgoulet@torproject.org>
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/or/connection_edge.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/or/connection_edge.c b/src/core/or/connection_edge.c index a307249967..6f6f22a0d4 100644 --- a/src/core/or/connection_edge.c +++ b/src/core/or/connection_edge.c @@ -2536,6 +2536,10 @@ connection_ap_handshake_rewrite_and_attach(entry_connection_t *conn, "https://blog.torproject.org/v2-deprecation-timeline."); control_event_client_status(LOG_WARN, "SOCKS_BAD_HOSTNAME HOSTNAME=%s", escaped(socks->address)); + /* Send back the 0xF6 extended code indicating a bad hostname. This is + * mostly so Tor Browser can make a proper UX with regards to v2 + * addresses. */ + conn->socks_request->socks_extended_error_code = SOCKS5_HS_BAD_ADDRESS; connection_mark_unattached_ap(conn, END_STREAM_REASON_TORPROTOCOL); return -1; } |