From 480a75cbbd8067b32b2954303ca69401bfee58d9 Mon Sep 17 00:00:00 2001 From: Robert Ransom Date: Thu, 28 Apr 2011 15:16:54 -0700 Subject: [PATCH 1/3] Check onion keys in microdescriptors, too --- changes/bug3207 | 4 ++++ src/or/routerparse.c | 5 +++++ 2 files changed, 9 insertions(+) create mode 100644 changes/bug3207 diff --git a/changes/bug3207 b/changes/bug3207 new file mode 100644 index 0000000000..65a7dac1ab --- /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 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; From 2e07925a5285fd50626e853c48ab5b79eec8e933 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 17 May 2011 19:45:05 -0400 Subject: [PATCH 2/3] Oops; that function got renamed. --- src/or/routerparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/or/routerparse.c b/src/or/routerparse.c index 57436f75e0..ce98a47b67 100644 --- a/src/or/routerparse.c +++ b/src/or/routerparse.c @@ -4336,7 +4336,7 @@ 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)) { + if (!crypto_pk_public_exponent_ok(tok->key)) { log_warn(LD_DIR, "Relay's onion key had invalid exponent."); goto next; From 21ed575826e701437f7893536ffc5c8d2a71532f Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 17 May 2011 19:46:47 -0400 Subject: [PATCH 3/3] Handle NULL argument to get_configured_bridge_by_addr_port_digest Fixes bug 2313; bugfix on 0.2.2.26-beta. --- changes/bug3213 | 4 ++++ src/or/circuitbuild.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 changes/bug3213 diff --git a/changes/bug3213 b/changes/bug3213 new file mode 100644 index 0000000000..ab7de2d629 --- /dev/null +++ b/changes/bug3213 @@ -0,0 +1,4 @@ + o Major bugfixes: + - Fix a crash bug when changing bridges in a running Tor process. + Fixes bug 3213; bugfix on 0.2.2.26-beta. + diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 860cd27567..2f86e1fa34 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -4539,7 +4539,7 @@ get_configured_bridge_by_addr_port_digest(const tor_addr_t *addr, !tor_addr_compare(&bridge->addr, addr, CMP_EXACT) && bridge->port == port) return bridge; - if (tor_memeq(bridge->identity, digest, DIGEST_LEN)) + if (digest && tor_memeq(bridge->identity, digest, DIGEST_LEN)) return bridge; } SMARTLIST_FOREACH_END(bridge);