diff options
author | Roger Dingledine <arma@torproject.org> | 2006-03-22 06:22:12 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2006-03-22 06:22:12 +0000 |
commit | 0d7efbe65d930dde7475d1614e3ede4b4046a2cd (patch) | |
tree | 046bfd643ef71fff89b9b2e5b784631bc7e3a984 | |
parent | 51a3981d107261b0e45749f77dc7df3424c7e0af (diff) | |
download | tor-0d7efbe65d930dde7475d1614e3ede4b4046a2cd.tar.gz tor-0d7efbe65d930dde7475d1614e3ede4b4046a2cd.zip |
Note a vulnerability with our current recommended-version concensus
building.
Make the warnings about invalid and unnamed nodes scale better, and
update the text of the warnings.
Change router_have_minimum_dir_info() to only be happy when it has
enough network-statuses ("more than half") to be willing to actually
build circuits.
Not yet done: when we fail to get a networkstatus that we wanted, and
!router_have_minimum_dir_info(), we should retry it quicker than a whole
minute from now.
svn:r6227
-rw-r--r-- | src/or/directory.c | 2 | ||||
-rw-r--r-- | src/or/routerlist.c | 32 |
2 files changed, 18 insertions, 16 deletions
diff --git a/src/or/directory.c b/src/or/directory.c index 538cbc6a3f..5254d6bc9e 100644 --- a/src/or/directory.c +++ b/src/or/directory.c @@ -1857,7 +1857,7 @@ dir_networkstatus_download_failed(smartlist_t *failed) }); } -/** Called when one or more networkstatus fetches have failed (with uppercase +/** Called when one or more routerdesc fetches have failed (with uppercase * fingerprints listed in <b>failed</>). */ static void dir_routerdesc_download_failed(smartlist_t *failed) diff --git a/src/or/routerlist.c b/src/or/routerlist.c index 8cdb65884b..e5c806af1f 100644 --- a/src/or/routerlist.c +++ b/src/or/routerlist.c @@ -2738,6 +2738,8 @@ compute_recommended_versions(time_t now, int client) vers = client ? ns->client_versions : ns->server_versions; if (!vers) continue; + /* XXX Attack: a single dirserver can make a version recommended + * by repeating it many times in his recommended list. -RD */ smartlist_split_string(combined, vers, ",", SPLIT_SKIP_SPACE|SPLIT_IGNORE_BLANK, 0); }); @@ -2809,22 +2811,18 @@ routers_update_all_from_networkstatus(void) ++n_named; }); - if (n_recent >= 2 && n_listing >= 2) { - /* XXX When we have more than 3 dirservers, these warnings - * might become spurious depending on which combination of - * network-statuses we have. Perhaps we should wait until we - * have tried all of them? -RD */ + if (n_recent >= 2 && n_listing >= 2 && + have_tried_downloading_all_statuses()) { if (n_valid <= n_recent/2) { log_warn(LD_GENERAL, "%d/%d recent statements from directory authorities list us " - "as invalid. Please " - "consider sending your identity fingerprint to the tor-ops.", + "as unapproved. Are you misconfigured?", n_recent-n_valid, n_recent); have_warned_about_invalid_status = 1; - } else if (!n_named && have_tried_downloading_all_statuses()) { + } else if (n_naming && !n_named) { log_warn(LD_GENERAL, "0/%d name-binding directory authorities " - "recognize this server. Please consider sending your " - "identity fingerprint to the tor-ops.", + "recognize your nickname. Please consider sending your " + "nickname and identity fingerprint to the tor-ops.", n_naming); have_warned_about_invalid_status = 1; } @@ -3591,7 +3589,7 @@ update_router_descriptor_cache_downloads(time_t now) * - if d is a member of some downloadable[x], d is a member of some * download_from[y]. (Everything we want to download, we try to download * from somebody.) - * - If d is a mamber of download_from[y], d is a member of downloadable[y]. + * - If d is a member of download_from[y], d is a member of downloadable[y]. * (We only try to download descriptors from authorities who claim to have * them.) * - No d is a member of download_from[x] and download_from[y] s.t. x != y. @@ -3657,21 +3655,25 @@ update_router_descriptor_downloads(time_t now) } /** Return true iff we have enough networkstatus and router information to - * start building circuits. Right now, this means "at least 2 networkstatus - * documents, and at least 1/4 of expected routers." */ + * start building circuits. Right now, this means "more than half the + * networkstatus documents, and at least 1/4 of expected routers." */ //XXX should consider whether we have enough exiting nodes here. int router_have_minimum_dir_info(void) { int tot = 0, num_running = 0; - int n_ns, res, avg; + int n_ns, n_authorities, res, avg; static int have_enough = 0; if (!networkstatus_list || !routerlist) { res = 0; goto done; } + n_authorities = smartlist_len(trusted_dir_servers); n_ns = smartlist_len(networkstatus_list); - if (n_ns<2) { + if (n_ns<=n_authorities/2) { + log_info(LD_DIR, + "We have %d of %d network statuses, and we want " + "more than %d.", n_ns, n_authorities, n_authorities/2); res = 0; goto done; } |