]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
control: Support HS v3 for CIRC and CIRC_MINOR event
authorDavid Goulet <dgoulet@torproject.org>
Fri, 10 Nov 2017 20:18:35 +0000 (15:18 -0500)
committerNick Mathewson <nickm@torproject.org>
Wed, 6 Dec 2017 00:39:46 +0000 (19:39 -0500)
"REND_QUERY=" can now output a v3 address.

Signed-off-by: David Goulet <dgoulet@torproject.org>
src/or/control.c

index 0e41aab5e53cc633204905f7d0f3a9b23a87b9f0..24e3ebe7dd56a79f4fb94cfe26f897244555dbf3 100644 (file)
@@ -2678,9 +2678,16 @@ circuit_describe_status_for_controller(origin_circuit_t *circ)
     }
   }
 
-  if (circ->rend_data != NULL) {
-    smartlist_add_asprintf(descparts, "REND_QUERY=%s",
-                           rend_data_get_address(circ->rend_data));
+  if (circ->rend_data != NULL || circ->hs_ident != NULL) {
+    char addr[HS_SERVICE_ADDR_LEN_BASE32 + 1];
+    const char *onion_address;
+    if (circ->rend_data) {
+      onion_address = rend_data_get_address(circ->rend_data);
+    } else {
+      hs_build_address(&circ->hs_ident->identity_pk, HS_VERSION_THREE, addr);
+      onion_address = addr;
+    }
+    smartlist_add_asprintf(descparts, "REND_QUERY=%s", onion_address);
   }
 
   {