]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Bugfixes in fetching certificates for a consensus: fetch tor/keys/fp/X, not tor/keys...
authorNick Mathewson <nickm@torproject.org>
Tue, 9 Oct 2007 17:40:23 +0000 (17:40 +0000)
committerNick Mathewson <nickm@torproject.org>
Tue, 9 Oct 2007 17:40:23 +0000 (17:40 +0000)
svn:r11805

src/or/dirvote.c
src/or/routerlist.c

index 83360588cb9af895ad30a02fcdbbc5ef45edfa87..1e19f65534589720b1260aa6fa769763f99a94ec 100644 (file)
@@ -725,11 +725,13 @@ networkstatus_check_consensus_signature(networkstatus_vote_t *consensus,
         authority_cert_get_by_digests(voter->identity_digest,
                                       voter->signing_key_digest);
       if (! cert) {
-        if (!trusteddirserver_get_by_v3_auth_digest(voter->identity_digest))
+        if (!trusteddirserver_get_by_v3_auth_digest(voter->identity_digest)) {
           smartlist_add(unrecognized, voter);
-        else
+          ++n_unknown;
+        } else {
           smartlist_add(need_certs_from, voter);
-        ++n_unknown;
+          ++n_missing_key;
+        }
         continue;
       }
       if (networkstatus_check_voter_signature(consensus, voter, cert) < 0) {
index 48ce2f186bcb59dcc7b50786071a4dc41ee4bbd9..36cd20fccdc5e88c045f47bdcdeb6b2bf6b65a37 100644 (file)
@@ -318,12 +318,16 @@ authority_certs_fetch_missing(networkstatus_vote_t *status)
 
   {
     smartlist_t *fps = smartlist_create();
+    smartlist_add(fps, tor_strdup("fp/"));
     SMARTLIST_FOREACH(missing_digests, const char *, d, {
-        char *fp = tor_malloc(HEX_DIGEST_LEN+1);
+        char *fp = tor_malloc(HEX_DIGEST_LEN+2);
         base16_encode(fp, HEX_DIGEST_LEN+1, d, DIGEST_LEN);
+        fp[HEX_DIGEST_LEN] = '+';
+        fp[HEX_DIGEST_LEN+1] = '\0';
         smartlist_add(fps, fp);
       });
-    resource = smartlist_join_strings(fps, "+", 0, NULL);
+    resource = smartlist_join_strings(fps, "", 0, NULL);
+    resource[strlen(resource)-1] = '\0';
     SMARTLIST_FOREACH(fps, char *, cp, tor_free(cp));
     smartlist_free(fps);
   }