[tor-commits] [tor/master] control-port: Include HS address in ONION_CLIENT_AUTH_VIEW reply.

asn at torproject.org asn at torproject.org
Wed Dec 4 16:48:18 UTC 2019


commit 2693bf47e8f98d38386d79e48d56ecbaaf781a02
Author: George Kadianakis <desnacked at riseup.net>
Date:   Wed Dec 4 13:33:07 2019 +0200

    control-port: Include HS address in ONION_CLIENT_AUTH_VIEW reply.
---
 src/feature/control/control_hs.c |  3 ++-
 src/test/test_hs_control.c       | 11 +++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/feature/control/control_hs.c b/src/feature/control/control_hs.c
index 94940a739..128893bc6 100644
--- a/src/feature/control/control_hs.c
+++ b/src/feature/control/control_hs.c
@@ -239,7 +239,8 @@ encode_client_auth_cred_for_control_port(
     goto err;
   }
 
-  smartlist_add_asprintf(control_line, "CLIENT x25519:%s", x25519_b64);
+  smartlist_add_asprintf(control_line, "CLIENT %s x25519:%s",
+                         cred->onion_address, x25519_b64);
 
   if (cred->flags) { /* flags are also optional */
     if (cred->flags & CLIENT_AUTH_FLAG_IS_PERMANENT) {
diff --git a/src/test/test_hs_control.c b/src/test/test_hs_control.c
index d064f203a..97a6f259e 100644
--- a/src/test/test_hs_control.c
+++ b/src/test/test_hs_control.c
@@ -292,8 +292,10 @@ test_hs_control_good_onion_client_auth_add(void *arg)
   args = tor_strdup("");
 
 #define VIEW_CORRECT_REPLY_NO_ADDR "250-ONION_CLIENT_AUTH_VIEW\r\n"   \
-  "250-CLIENT x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n"\
-  "250-CLIENT x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ=\r\n"   \
+  "250-CLIENT 2fvhjskjet3n5syd6yfg5lhvwcs62bojmthr35ko5bllr3iqdb4ctdyd "  \
+    "x25519:iJ1tjKCrMAbiFT2bVrCjhbfMDnE1fpaRbIS5ZHKUvEQ=\r\n"   \
+  "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvxcuyd " \
+    "x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n"             \
   "250 OK\r\n"
 
   retval = handle_control_command(&conn, (uint32_t) strlen(args), args);
@@ -308,8 +310,9 @@ test_hs_control_good_onion_client_auth_add(void *arg)
     tor_strdup("jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvxcuyd");
 
 #define VIEW_CORRECT_REPLY_JT4 "250-ONION_CLIENT_AUTH_VIEW " \
-  "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvxcuyd\r\n"   \
-  "250-CLIENT x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n"\
+    "jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvxcuyd\r\n"   \
+  "250-CLIENT jt4grrjwzyz3pjkylwfau5xnjaj23vxmhskqaeyfhrfylelw4hvxcuyd " \
+    "x25519:eIIdIGoSZwI2Q/lSzpf92akGki5I+PZIDz37MA5BhlA=\r\n" \
   "250 OK\r\n"
 
   retval = handle_control_command(&conn, (uint32_t) strlen(args), args);



More information about the tor-commits mailing list