aboutsummaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-11-10 12:24:07 -0500
committerNick Mathewson <nickm@torproject.org>2016-12-08 16:47:58 -0500
commit7daf15217240acefaf2ef802b6d89e04f4e51cae (patch)
tree8be8786446066323340cf4ae4d7d194f164c14aa /src/or/dirserv.c
parent2cdd24ddd69a3cde2deae3eb69c24ae179d83834 (diff)
downloadtor-7daf15217240acefaf2ef802b6d89e04f4e51cae.tar.gz
tor-7daf15217240acefaf2ef802b6d89e04f4e51cae.zip
Enforce Ed25519 identities (client-side)
This patch makes two absolutely critical changes: - If an ed25519 identity is not as expected when creating a channel, we call that channel unsuccessful and close it. - When a client creating a channel or an extend cell for a circuit, we only include the ed25519 identity if we believe that the node on the other side supports ed25519 link authentication (from #15055). Otherwise we will insist on nodes without the right link protocol authenticating themselves. - When deciding to extend to another relay, we only upgrade the extend to extend by ed25519 ID when we know the ed25519 ID _and_ we know that the other side can authenticate. This patch also tells directory servers, when probing nodes, to try to check their ed25519 identities too (if they can authenticate by ed25519 identity). Also, handle the case where we connect by RSA Id, and learn the ED25519 ID for the node in doing so.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index b141a5dda0..d060b297a7 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -3259,20 +3259,26 @@ dirserv_single_reachability_test(time_t now, routerinfo_t *router)
channel_t *chan = NULL;
node_t *node = NULL;
tor_addr_t router_addr;
+ const ed25519_public_key_t *ed_id_key;
(void) now;
tor_assert(router);
node = node_get_mutable_by_id(router->cache_info.identity_digest);
tor_assert(node);
+ if (node_supports_ed25519_link_authentication(node)) {
+ ed_id_key = &router->cache_info.signing_key_cert->signing_key;
+ } else {
+ ed_id_key = NULL;
+ }
+
/* IPv4. */
log_debug(LD_OR,"Testing reachability of %s at %s:%u.",
router->nickname, fmt_addr32(router->addr), router->or_port);
tor_addr_from_ipv4h(&router_addr, router->addr);
chan = channel_tls_connect(&router_addr, router->or_port,
router->cache_info.identity_digest,
- NULL // XXXX Ed25519 ID.
- );
+ ed_id_key);
if (chan) command_setup_channel(chan);
/* Possible IPv6. */
@@ -3285,8 +3291,7 @@ dirserv_single_reachability_test(time_t now, routerinfo_t *router)
router->ipv6_orport);
chan = channel_tls_connect(&router->ipv6_addr, router->ipv6_orport,
router->cache_info.identity_digest,
- NULL // XXXX Ed25519 ID.
- );
+ ed_id_key);
if (chan) command_setup_channel(chan);
}
}