Loading src/or/routerlist.c +6 −12 Changes for src/or/routerlist.c: 6 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -440,17 +440,19 @@ void router_mark_as_down(const char *digest) { int router_add_to_routerlist(routerinfo_t *router) { int i; routerinfo_t *r; char id_digest[DIGEST_LEN]; crypto_pk_get_digest(router->identity_pkey, id_digest); /* If we have a router with this name, and the identity key is the same, * choose the newer one. If the identity key has changed, drop the router. */ for (i = 0; i < smartlist_len(routerlist->routers); ++i) { r = smartlist_get(routerlist->routers, i); /* XXXX008 should just compare digests instead. */ if (!strcasecmp(router->nickname, r->nickname)) { if (!crypto_pk_cmp_keys(router->identity_pkey, r->identity_pkey)) { if (router->published_on > r->published_on) { log_fn(LOG_DEBUG, "Replacing entry for router '%s'", router->nickname); log_fn(LOG_DEBUG, "Replacing entry for router '%s/%s' [%s]", router->nickname, r->nickname, hex_str(id_digest,DIGEST_LEN)); /* Remember whether we trust this router as a dirserver. */ if (r->is_trusted_dir) router->is_trusted_dir = 1; Loading @@ -472,14 +474,6 @@ int router_add_to_routerlist(routerinfo_t *router) { routerinfo_free(router); return -1; } } else { /* XXXX008 It's okay to have two keys for a nickname as soon as * all the 007 clients are dead. */ log_fn(LOG_WARN, "Identity key mismatch for router '%s'", router->nickname); routerinfo_free(router); return -1; } } } /* We haven't seen a router with this name before. Add it to the end of Loading Loading
src/or/routerlist.c +6 −12 Changes for src/or/routerlist.c: 6 added lines, 12 removed lines. Original line number Diff line number Diff line Loading @@ -440,17 +440,19 @@ void router_mark_as_down(const char *digest) { int router_add_to_routerlist(routerinfo_t *router) { int i; routerinfo_t *r; char id_digest[DIGEST_LEN]; crypto_pk_get_digest(router->identity_pkey, id_digest); /* If we have a router with this name, and the identity key is the same, * choose the newer one. If the identity key has changed, drop the router. */ for (i = 0; i < smartlist_len(routerlist->routers); ++i) { r = smartlist_get(routerlist->routers, i); /* XXXX008 should just compare digests instead. */ if (!strcasecmp(router->nickname, r->nickname)) { if (!crypto_pk_cmp_keys(router->identity_pkey, r->identity_pkey)) { if (router->published_on > r->published_on) { log_fn(LOG_DEBUG, "Replacing entry for router '%s'", router->nickname); log_fn(LOG_DEBUG, "Replacing entry for router '%s/%s' [%s]", router->nickname, r->nickname, hex_str(id_digest,DIGEST_LEN)); /* Remember whether we trust this router as a dirserver. */ if (r->is_trusted_dir) router->is_trusted_dir = 1; Loading @@ -472,14 +474,6 @@ int router_add_to_routerlist(routerinfo_t *router) { routerinfo_free(router); return -1; } } else { /* XXXX008 It's okay to have two keys for a nickname as soon as * all the 007 clients are dead. */ log_fn(LOG_WARN, "Identity key mismatch for router '%s'", router->nickname); routerinfo_free(router); return -1; } } } /* We haven't seen a router with this name before. Add it to the end of Loading