]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
hs-v2: Disable version 2 service
authorDavid Goulet <dgoulet@torproject.org>
Tue, 19 Oct 2021 13:11:12 +0000 (09:11 -0400)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 19 Oct 2021 13:11:12 +0000 (09:11 -0400)
The minimum service version is raised from 2 to 3 which effectively
disable loading or creating an onion service v2.

As for ADD_ONION, for version 2, a 551 error is returned:

  "551 Failed to add Onion Service"

Part of #40476

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/feature/control/control_cmd.c
src/feature/hs/hs_common.h

index 0456d709f599852bf55f8ca13e8ffa5f8087848b..3b23018c9ce8cc69545fc312baa7e7a8e4d0bd09 100644 (file)
@@ -1662,11 +1662,13 @@ add_onion_helper_add_service(int hs_version,
   tor_assert(port_cfgs);
   tor_assert(address_out);
 
+  /* Version 2 is disabled. */
+  (void) auth_type;
+  (void) auth_clients;
+
   switch (hs_version) {
   case HS_VERSION_TWO:
-    ret = rend_service_add_ephemeral(pk->v2, port_cfgs, max_streams,
-                                     max_streams_close_circuit, auth_type,
-                                     auth_clients, address_out);
+    ret = RSAE_INTERNAL;
     break;
   case HS_VERSION_THREE:
     ret = hs_service_add_ephemeral(pk->v3, port_cfgs, max_streams,
index 4a9c7a9918197be6c2cde1b99cf48980cb52c924..274017180ac20aeee3c098335a241dfe241c3d31 100644 (file)
@@ -25,7 +25,7 @@ struct ed25519_keypair_t;
 /** Version 3 of the protocol (prop224). */
 #define HS_VERSION_THREE 3
 /** Earliest version we support. */
-#define HS_VERSION_MIN HS_VERSION_TWO
+#define HS_VERSION_MIN HS_VERSION_THREE
 /** Latest version we support. */
 #define HS_VERSION_MAX HS_VERSION_THREE