summaryrefslogtreecommitdiff
path: root/src/or/dirserv.c
diff options
context:
space:
mode:
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-07 12:58:47 +1000
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>2016-07-15 09:55:49 +1000
commit579a80d4ae54ec03fd9b02c4a125b2943770c85d (patch)
tree816ee00f3ed7dff2fe350d1a2fcb49469baea1ac /src/or/dirserv.c
parenta76d528bec970e500d3339d9e0f253bded17c338 (diff)
downloadtor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.tar.gz
tor-579a80d4ae54ec03fd9b02c4a125b2943770c85d.zip
Clients avoid choosing nodes that can't do ntor
If we know a node's version, and it can't do ntor, consider it not running. If we have a node's descriptor, and it doesn't have a valid ntor key, consider it not running. Refactor these checks so they're consistent between authorities and clients.
Diffstat (limited to 'src/or/dirserv.c')
-rw-r--r--src/or/dirserv.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/or/dirserv.c b/src/or/dirserv.c
index ef3a305895..ff50ca4417 100644
--- a/src/or/dirserv.c
+++ b/src/or/dirserv.c
@@ -260,9 +260,7 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg,
* But just in case a relay doesn't provide or lies about its version, or
* doesn't include an ntor key in its descriptor, check that it exists,
* and is non-zero (clients check that it's non-zero before using it). */
- if (router->onion_curve25519_pkey == NULL ||
- tor_mem_is_zero((const char*)router->onion_curve25519_pkey->public_key,
- CURVE25519_PUBKEY_LEN)) {
+ if (!routerinfo_has_curve25519_onion_key(router)) {
log_fn(severity, LD_DIR,
"Descriptor from router %s is missing an ntor curve25519 onion "
"key.", router_describe(router));