[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12203: Better log on vote from unknown authority. Make get_by_v3_au (in tor/trunk: . src/or)



Author: nickm
Date: 2007-10-26 10:57:26 -0400 (Fri, 26 Oct 2007)
New Revision: 12203

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/dirvote.c
   tor/trunk/src/or/routerlist.c
Log:
 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.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r16174] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-10-26 13:41:31 UTC (rev 12202)
+++ tor/trunk/ChangeLog	2007-10-26 14:57:26 UTC (rev 12203)
@@ -6,6 +6,7 @@
   o Minor bugfixes:
     - Refuse to start if both ORPort and UseBridges are set. Bugfix
       on 0.2.0.x.
+    - Better log message on vote from unknown authority.
 
   o Minor bugfixes (memory leaks):
     - Stop leaking memory every time we parse a v3 certificate. Bugfix

Modified: tor/trunk/src/or/dirvote.c
===================================================================
--- tor/trunk/src/or/dirvote.c	2007-10-26 13:41:31 UTC (rev 12202)
+++ tor/trunk/src/or/dirvote.c	2007-10-26 14:57:26 UTC (rev 12203)
@@ -1519,18 +1519,12 @@
   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;
   }

Modified: tor/trunk/src/or/routerlist.c
===================================================================
--- tor/trunk/src/or/routerlist.c	2007-10-26 13:41:31 UTC (rev 12202)
+++ tor/trunk/src/or/routerlist.c	2007-10-26 14:57:26 UTC (rev 12203)
@@ -779,7 +779,8 @@
 
   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;
      });