aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-16 14:50:53 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-16 14:50:53 -0400
commit03ccce6d776c617d81837ae9cc1f33f45d154e92 (patch)
treea85fb96f4f6c5908968649ca883664a6f78284e2 /src/or/routerparse.c
parente423447f53f3a1b3b72cea3e52f345143e847d48 (diff)
parente908e3a332dd469af2facac0846d0dc8349a30d3 (diff)
downloadtor-03ccce6d776c617d81837ae9cc1f33f45d154e92.tar.gz
tor-03ccce6d776c617d81837ae9cc1f33f45d154e92.zip
Merge remote-tracking branch 'origin/maint-0.2.2'
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 3f5aad8dfa..dcfb6f86b2 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1459,6 +1459,11 @@ router_parse_entry_from_string(const char *s, const char *end,
goto err;
tok = find_by_keyword(tokens, K_ONION_KEY);
+ if (!crypto_pk_public_exponent_ok(tok->key)) {
+ log_warn(LD_DIR,
+ "Relay's onion key had invalid exponent.");
+ goto err;
+ }
router->onion_pkey = tok->key;
tok->key = NULL; /* Prevent free */
@@ -4991,10 +4996,22 @@ rend_parse_introduction_points(rend_service_descriptor_t *parsed,
}
/* Parse onion key. */
tok = find_by_keyword(tokens, R_IPO_ONION_KEY);
+ if (!crypto_pk_public_exponent_ok(tok->key)) {
+ log_warn(LD_REND,
+ "Introduction point's onion key had invalid exponent.");
+ rend_intro_point_free(intro);
+ goto err;
+ }
info->onion_key = tok->key;
tok->key = NULL; /* Prevent free */
/* Parse service key. */
tok = find_by_keyword(tokens, R_IPO_SERVICE_KEY);
+ if (!crypto_pk_public_exponent_ok(tok->key)) {
+ log_warn(LD_REND,
+ "Introduction point key had invalid exponent.");
+ rend_intro_point_free(intro);
+ goto err;
+ }
intro->intro_key = tok->key;
tok->key = NULL; /* Prevent free */
/* Add extend info to list of introduction points. */