[tor-commits] [tor/release-0.2.2] Check onion keys in microdescriptors, too

arma at torproject.org arma at torproject.org
Wed May 18 00:53:07 UTC 2011


commit 480a75cbbd8067b32b2954303ca69401bfee58d9
Author: Robert Ransom <rransom.8774 at gmail.com>
Date:   Thu Apr 28 15:16:54 2011 -0700

    Check onion keys in microdescriptors, too
---
 changes/bug3207      |    4 ++++
 src/or/routerparse.c |    5 +++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/changes/bug3207 b/changes/bug3207
new file mode 100644
index 0000000..65a7dac
--- /dev/null
+++ b/changes/bug3207
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Require that onion keys have exponent 65537 in microdescriptors too.
+      Fixes part of bug 3207; bugfix on 0.2.2.25-alpha
+
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index be7a3fe..57436f7 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -4336,6 +4336,11 @@ microdescs_parse_from_string(const char *s, const char *eos,
     }
 
     tok = find_by_keyword(tokens, K_ONION_KEY);
+    if (!crypto_pk_check_key_public_exponent(tok->key)) {
+      log_warn(LD_DIR,
+               "Relay's onion key had invalid exponent.");
+      goto next;
+    }
     md->onion_pkey = tok->key;
     tok->key = NULL;
 





More information about the tor-commits mailing list