aboutsummaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-10-26 14:57:26 +0000
committerNick Mathewson <nickm@torproject.org>2007-10-26 14:57:26 +0000
commit2ac37c8b01c00fcb372d8868fb4eaacad2f49b30 (patch)
tree26a43d0ef5a07d9f83ccf188ece0e1c14fbd42f3 /src/or
parent40970ccdaa5f63c7a1c554d9c45f8de95742b5ec (diff)
downloadtor-2ac37c8b01c00fcb372d8868fb4eaacad2f49b30.tar
tor-2ac37c8b01c00fcb372d8868fb4eaacad2f49b30.tar.gz
r16174@catbus: nickm | 2007-10-26 10:55:26 -0400
Better log on vote from unknown authority. Make get_by_v3_authority_id retrun only v3 authorities. svn:r12203
Diffstat (limited to 'src/or')
-rw-r--r--src/or/dirvote.c12
-rw-r--r--src/or/routerlist.c3
2 files changed, 5 insertions, 10 deletions
diff --git a/src/or/dirvote.c b/src/or/dirvote.c
index 88f18a3b8..e75986a3c 100644
--- a/src/or/dirvote.c
+++ b/src/or/dirvote.c
@@ -1519,18 +1519,12 @@ dirvote_add_vote(const char *vote_body, const char **msg_out, int *status_out)
vi = get_voter(vote);
tor_assert(vi->good_signature == 1);
ds = trusteddirserver_get_by_v3_auth_digest(vi->identity_digest);
- if (!ds || !(ds->type & V3_AUTHORITY)) {
+ if (!ds) {
char *keys = list_v3_auth_ids();
log_warn(LD_DIR, "Got a vote from an authority with authority key ID %s. "
- "This authority %s. Known v3 key IDs are: %s",
- hex_str(vi->identity_digest, DIGEST_LEN),
- ds?"is not recognized":"is recognized, but is not listed as v3",
-/* XXX020 isn't the above line backwards? -RD */
-/* In fact, how can ds->v3_identity_digest be set if it's not a
- * V3_AUTHORITY? */
- keys);
+ "This key ID is not recognized. Known v3 key IDs are: %s",
+ hex_str(vi->identity_digest, DIGEST_LEN), keys);
tor_free(keys);
-
*msg_out = "Vote not from a recognized v3 authority";
goto err;
}
diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index d12e26f0b..472d20d19 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -779,7 +779,8 @@ trusteddirserver_get_by_v3_auth_digest(const char *digest)
SMARTLIST_FOREACH(trusted_dir_servers, trusted_dir_server_t *, ds,
{
- if (!memcmp(ds->v3_identity_digest, digest, DIGEST_LEN))
+ if (!memcmp(ds->v3_identity_digest, digest, DIGEST_LEN) &&
+ (ds->type & V3_AUTHORITY))
return ds;
});