diff options
author | Roger Dingledine <arma@torproject.org> | 2007-02-24 01:26:09 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-02-24 01:26:09 +0000 |
commit | 33430d3a9e39c141dfcad9260a243fe9da4fc8ed (patch) | |
tree | 442d827ce2c2468395417887f6b361cc9ac86ce1 | |
parent | 9946bb7fbd85eb27a7a1e8ded7bac2881e1da4bf (diff) | |
download | tor-33430d3a9e39c141dfcad9260a243fe9da4fc8ed.tar.gz tor-33430d3a9e39c141dfcad9260a243fe9da4fc8ed.zip |
bugfix on r9568: we were throwing around an uninitialized
nickname array, and only treating a server as reachable if
the array magically has the right nickname in it. this was
causing the authorities to label only themselves as running,
and clients were "mysteriously" failing.
svn:r9628
-rw-r--r-- | src/or/connection_or.c | 5 | ||||
-rw-r--r-- | src/or/dirserv.c | 10 | ||||
-rw-r--r-- | src/or/or.h | 1 |
3 files changed, 5 insertions, 11 deletions
diff --git a/src/or/connection_or.c b/src/or/connection_or.c index bd1554be5b..34c890b5ae 100644 --- a/src/or/connection_or.c +++ b/src/or/connection_or.c @@ -591,7 +591,6 @@ connection_or_check_valid_handshake(or_connection_t *conn, int started_here, char *digest_rcvd) { crypto_pk_env_t *identity_rcvd=NULL; - char nickname[MAX_NICKNAME_LEN+1]; or_options_t *options = get_options(); int severity = server_mode(options) ? LOG_PROTOCOL_WARN : LOG_WARN; const char *safe_address = @@ -668,10 +667,10 @@ connection_or_check_valid_handshake(or_connection_t *conn, int started_here, } if (authdir_mode(options)) { /* We initiated this connection to address:port. Drop all routers - * with the same address:port and a different key or nickname. + * with the same address:port and a different key. */ dirserv_orconn_tls_done(conn->_base.address, conn->_base.port, - digest_rcvd, nickname, as_advertised); + digest_rcvd, as_advertised); } if (!as_advertised) return -1; diff --git a/src/or/dirserv.c b/src/or/dirserv.c index 07ebe77177..d2b6661935 100644 --- a/src/or/dirserv.c +++ b/src/or/dirserv.c @@ -1914,8 +1914,7 @@ dirserv_get_routerdescs(smartlist_t *descs_out, const char *key, /** Called when a TLS handshake has completed successfully with a * router listening at <b>address</b>:<b>or_port</b>, and has yielded - * a certificate with digest <b>digest_rcvd</b> and nickname - * <b>nickname_rcvd</b>. + * a certificate with digest <b>digest_rcvd</b>. * * Also, if as_advertised is 1, then inform the reachability checker * that we could get to this guy. @@ -1924,20 +1923,17 @@ void dirserv_orconn_tls_done(const char *address, uint16_t or_port, const char *digest_rcvd, - const char *nickname_rcvd, int as_advertised) { routerlist_t *rl = router_get_routerlist(); tor_assert(address); tor_assert(digest_rcvd); - tor_assert(nickname_rcvd); SMARTLIST_FOREACH(rl->routers, routerinfo_t *, ri, { if (!strcasecmp(address, ri->address) && or_port == ri->or_port && as_advertised && - !memcmp(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN) && - !strcasecmp(nickname_rcvd, ri->nickname)) { - /* correct nickname and digest. mark this router reachable! */ + !memcmp(ri->cache_info.identity_digest, digest_rcvd, DIGEST_LEN)) { + /* correct digest. mark this router reachable! */ log_info(LD_DIRSERV, "Found router %s to be reachable. Yay.", ri->nickname); ri->last_reachable = time(NULL); diff --git a/src/or/or.h b/src/or/or.h index 1eb8702f32..54b2f15bcd 100644 --- a/src/or/or.h +++ b/src/or/or.h @@ -2465,7 +2465,6 @@ int dirserv_get_routerdescs(smartlist_t *descs_out, const char *key, void dirserv_orconn_tls_done(const char *address, uint16_t or_port, const char *digest_rcvd, - const char *nickname, int as_advertised); void dirserv_test_reachability(int try_all); int authdir_wants_to_reject_router(routerinfo_t *ri, const char **msg, |