]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Authorities reject descriptors without ntor keys
authorteor (Tim Wilson-Brown) <teor2345@gmail.com>
Wed, 6 Jul 2016 06:50:48 +0000 (16:50 +1000)
committerteor (Tim Wilson-Brown) <teor2345@gmail.com>
Thu, 14 Jul 2016 23:55:49 +0000 (09:55 +1000)
Before, they checked for version 0.2.4.18-rc or later, but this
would not catch relays without version lines, or buggy or malicious
relays missing an ntor key.

changes/reject-tap [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/reject-tap b/changes/reject-tap
new file mode 100644 (file)
index 0000000..85fffc5
--- /dev/null
@@ -0,0 +1,4 @@
+  o Major bug fixes (circuit building):
+    - Authorites should not trust the version a relay claims (if any),
+      instead, they should check specifically for an ntor key.
+      Fixes bug 19163; bugfix on 0.2.4.18-rc.
index 64ebde6fdd69dd5149069fbfc3736d34cd63d3a4..ef3a3058951ea466f7321c5f0dfad08de45a9728 100644 (file)
@@ -255,6 +255,22 @@ dirserv_router_get_status(const routerinfo_t *router, const char **msg,
     return FP_REJECT;
   }
 
+  /* dirserv_get_status_impl already rejects versions older than 0.2.4.18-rc,
+   * and onion_curve25519_pkey was introduced in 0.2.4.8-alpha.
+   * 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)) {
+    log_fn(severity, LD_DIR,
+           "Descriptor from router %s is missing an ntor curve25519 onion "
+           "key.", router_describe(router));
+    if (msg)
+      *msg = "Missing ntor curve25519 onion key. Please upgrade!";
+    return FP_REJECT;
+  }
+
   if (router->cache_info.signing_key_cert) {
     /* This has an ed25519 identity key. */
     if (KEYPIN_MISMATCH ==