summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorRobert Ransom <rransom.8774@gmail.com>2011-04-28 15:16:54 -0700
committerNick Mathewson <nickm@torproject.org>2011-05-17 19:39:00 -0400
commit480a75cbbd8067b32b2954303ca69401bfee58d9 (patch)
treef87864ee1d1ba004939dd83906c3d7d8a0b9c165 /src/or/routerparse.c
parent2e85c3a5c94902fd2d50749400ec4877f6d0c210 (diff)
downloadtor-480a75cbbd8067b32b2954303ca69401bfee58d9.tar.gz
tor-480a75cbbd8067b32b2954303ca69401bfee58d9.zip
Check onion keys in microdescriptors, too
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index be7a3fe895..57436f75e0 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;