]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs: Send back 0xF6 for a v2 onion address
authorDavid Goulet <dgoulet@torproject.org>
Tue, 29 Jun 2021 13:56:44 +0000 (09:56 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 29 Jun 2021 13:56:44 +0000 (09:56 -0400)
Fixes #40421

Signed-off-by: David Goulet <dgoulet@torproject.org>
changes/ticket40421 [new file with mode: 0644]
src/core/or/connection_edge.c

diff --git a/changes/ticket40421 b/changes/ticket40421
new file mode 100644 (file)
index 0000000..d2dcc55
--- /dev/null
@@ -0,0 +1,3 @@
+  o Minor bugfixes (onion service):
+    - Send back the extended SOCKS error 0xF6 for a v2 onion address. Fixes bug
+      40421; bugfix on 0.4.6.2-alpha.
index a30724996766bb6bd1fc305340311789dfcee284..6f6f22a0d4c3de87dcb42c9fe9683ba379ff4135 100644 (file)
@@ -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;
     }