aboutsummaryrefslogtreecommitdiff
path: root/src/feature
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2024-06-24 14:15:04 -0400
committerNick Mathewson <nickm@torproject.org>2024-06-26 11:42:36 -0400
commit0428aef13a4043d2181b52e62c019d5cb4710283 (patch)
treec0225ad1ddd257558b4182664cc48c86df961a20 /src/feature
parent07f0a2b964eedd1ced201f2d1d82ec0089fac371 (diff)
downloadtor-0428aef13a4043d2181b52e62c019d5cb4710283.tar.gz
tor-0428aef13a4043d2181b52e62c019d5cb4710283.zip
Remove TAP key from extend_info_t
Diffstat (limited to 'src/feature')
-rw-r--r--src/feature/client/bridges.c6
-rw-r--r--src/feature/hs/hs_common.c2
-rw-r--r--src/feature/relay/circuitbuild_relay.c1
-rw-r--r--src/feature/relay/selftest.c6
4 files changed, 7 insertions, 8 deletions
diff --git a/src/feature/client/bridges.c b/src/feature/client/bridges.c
index a0375828a7..f4f7ac23a3 100644
--- a/src/feature/client/bridges.c
+++ b/src/feature/client/bridges.c
@@ -316,7 +316,8 @@ addr_is_a_configured_bridge(const tor_addr_t *addr,
/** If we have a bridge configured whose digest matches
* <b>ei->identity_digest</b>, or a bridge with no known digest whose address
* matches <b>ei->addr</b>:<b>ei->port</b>, return 1. Else return 0.
- * If <b>ei->onion_key</b> is NULL, check for address/port matches only.
+ * If <b>ei</b> has no onion key configured, check for address/port matches
+ * only.
*
* Note that if the extend_info_t contains multiple addresses, we return true
* only if _every_ address is a bridge.
@@ -324,7 +325,8 @@ addr_is_a_configured_bridge(const tor_addr_t *addr,
int
extend_info_is_a_configured_bridge(const extend_info_t *ei)
{
- const char *digest = ei->onion_key ? ei->identity_digest : NULL;
+ const char *digest = curve25519_public_key_is_ok(&ei->curve25519_onion_key)
+ ? ei->identity_digest : NULL;
const tor_addr_port_t *ap1 = NULL, *ap2 = NULL;
if (! tor_addr_is_null(&ei->orports[0].addr))
ap1 = &ei->orports[0];
diff --git a/src/feature/hs/hs_common.c b/src/feature/hs/hs_common.c
index cd7e4890d1..e16ec89ccb 100644
--- a/src/feature/hs/hs_common.c
+++ b/src/feature/hs/hs_common.c
@@ -1686,7 +1686,7 @@ hs_get_extend_info_from_lspecs(const smartlist_t *lspecs,
/* We do have everything for which we think we can connect successfully. */
info = extend_info_new(NULL, legacy_id,
- (have_ed25519_id) ? &ed25519_pk : NULL, NULL,
+ (have_ed25519_id) ? &ed25519_pk : NULL,
onion_key, &ap.addr, ap.port, NULL, false);
done:
return info;
diff --git a/src/feature/relay/circuitbuild_relay.c b/src/feature/relay/circuitbuild_relay.c
index 88b578c4a4..5ece5b4adc 100644
--- a/src/feature/relay/circuitbuild_relay.c
+++ b/src/feature/relay/circuitbuild_relay.c
@@ -389,7 +389,6 @@ circuit_open_connection_for_extend(const struct extend_cell_t *ec,
circ->n_hop = extend_info_new(NULL /*nickname*/,
(const char*)ec->node_id,
&ec->ed_pubkey,
- NULL, /*onion_key*/
NULL, /*curve25519_key*/
&chosen_ap->addr,
chosen_ap->port,
diff --git a/src/feature/relay/selftest.c b/src/feature/relay/selftest.c
index 399b6bca6e..0a80a5d47e 100644
--- a/src/feature/relay/selftest.c
+++ b/src/feature/relay/selftest.c
@@ -201,7 +201,6 @@ have_orport_for_family(int family)
static extend_info_t *
extend_info_from_router(const routerinfo_t *r, int family)
{
- crypto_pk_t *rsa_pubkey;
extend_info_t *info;
tor_addr_port_t ap;
@@ -224,15 +223,14 @@ extend_info_from_router(const routerinfo_t *r, int family)
/* We don't have an ORPort for the requested family. */
return NULL;
}
- rsa_pubkey = router_get_rsa_onion_pkey(r->onion_pkey, r->onion_pkey_len);
info = extend_info_new(r->nickname, r->cache_info.identity_digest,
ed_id_key,
- rsa_pubkey, r->onion_curve25519_pkey,
+ r->onion_curve25519_pkey,
&ap.addr, ap.port,
/* TODO-324: Should self-test circuits use
* congestion control? */
NULL, false);
- crypto_pk_free(rsa_pubkey);
+
return info;
}