summaryrefslogtreecommitdiff
path: root/src/feature/nodelist/routerlist.c
diff options
context:
space:
mode:
authorNeel Chauhan <neel@neelc.org>2019-12-14 13:16:59 -0500
committerNick Mathewson <nickm@torproject.org>2020-01-09 15:27:26 -0500
commitd0068be0ddad3113052b213f5eab4d17211c38b3 (patch)
treefb8abdc69d5bf8084c62de4a60f12d9f6e0fb58a /src/feature/nodelist/routerlist.c
parenta7b6c01468171096f9e4b6262771c85511e0e4e7 (diff)
downloadtor-d0068be0ddad3113052b213f5eab4d17211c38b3.tar.gz
tor-d0068be0ddad3113052b213f5eab4d17211c38b3.zip
Allow ed25519 keys to be banned in approved-routers
Diffstat (limited to 'src/feature/nodelist/routerlist.c')
-rw-r--r--src/feature/nodelist/routerlist.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/feature/nodelist/routerlist.c b/src/feature/nodelist/routerlist.c
index 0709a3bbe8..59d421da6a 100644
--- a/src/feature/nodelist/routerlist.c
+++ b/src/feature/nodelist/routerlist.c
@@ -2558,8 +2558,15 @@ update_consensus_router_descriptor_downloads(time_t now, int is_vote,
map = digestmap_new();
list_pending_descriptor_downloads(map, 0);
SMARTLIST_FOREACH_BEGIN(consensus->routerstatus_list, void *, rsp) {
- routerstatus_t *rs =
- is_vote ? &(((vote_routerstatus_t *)rsp)->status) : rsp;
+ routerstatus_t *rs;
+ vote_routerstatus_t *vrs;
+ if (is_vote) {
+ rs = &(((vote_routerstatus_t *)rsp)->status);
+ vrs = rsp;
+ } else {
+ rs = rsp;
+ vrs = NULL;
+ }
signed_descriptor_t *sd;
if ((sd = router_get_by_descriptor_digest(rs->descriptor_digest))) {
const routerinfo_t *ri;
@@ -2584,7 +2591,7 @@ update_consensus_router_descriptor_downloads(time_t now, int is_vote,
++n_delayed; /* Not ready for retry. */
continue;
}
- if (authdir && dirserv_would_reject_router(rs)) {
+ if (authdir && is_vote && dirserv_would_reject_router(rs, vrs)) {
++n_would_reject;
continue; /* We would throw it out immediately. */
}