]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Introduce node_get_curve25519_onion_key() in extend_info_from_node()
authorNeel Chauhan <neel@neelc.org>
Tue, 21 Nov 2017 14:16:18 +0000 (09:16 -0500)
committerteor <teor2345@gmail.com>
Tue, 21 Nov 2017 15:20:54 +0000 (02:20 +1100)
changes/ticket23760 [new file with mode: 0644]
src/or/circuitbuild.c

diff --git a/changes/ticket23760 b/changes/ticket23760
new file mode 100644 (file)
index 0000000..9213b14
--- /dev/null
@@ -0,0 +1,4 @@
+  o Code simplification and refactoring:
+    - We make extend_info_from_node() use node_get_curve25519_onion_key()
+      introduced in ticket 23577 to access the curve25519 public keys rather
+      than accessing it directly. Closes ticket 23760. Patch by Neel Chauhan.
index 7f0bcc415033a075208fd643225ca3307c7d4d0f..2e6b63b4d6813f5cc4b8b5c0e590f5e660fe463d 100644 (file)
@@ -2707,12 +2707,16 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
              node_describe(node));
   }
 
+  /* Retrieve the curve25519 pubkey. */
+  const curve25519_public_key_t *curve_pubkey =
+    node_get_curve25519_onion_key(node);
+
   if (valid_addr && node->ri)
     return extend_info_new(node->ri->nickname,
                            node->identity,
                            ed_pubkey,
                            node->ri->onion_pkey,
-                           node->ri->onion_curve25519_pkey,
+                           curve_pubkey,
                            &ap.addr,
                            ap.port);
   else if (valid_addr && node->rs && node->md)
@@ -2720,7 +2724,7 @@ extend_info_from_node(const node_t *node, int for_direct_connect)
                            node->identity,
                            ed_pubkey,
                            node->md->onion_pkey,
-                           node->md->onion_curve25519_pkey,
+                           curve_pubkey,
                            &ap.addr,
                            ap.port);
   else