summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2006-11-01 18:16:44 +0000
committerNick Mathewson <nickm@torproject.org>2006-11-01 18:16:44 +0000
commit5d7ca19b446d6c74501e23ba1d2c27f7202b1e99 (patch)
treedc761a949590e58d25fed297d135800181678eaf /src/or/routerparse.c
parentc195b8f80664158f7093c2b52f8aa217a01d2f27 (diff)
downloadtor-5d7ca19b446d6c74501e23ba1d2c27f7202b1e99.tar.gz
tor-5d7ca19b446d6c74501e23ba1d2c27f7202b1e99.zip
r9465@auth3-479: nickm | 2006-11-01 13:16:21 -0500
Add some temporary code to count how many *distinct* router digests we verify. (I have a sneaking suspicion that the numbers look way way high.) svn:r8890
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 4839ed8809..5bf519e2a8 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -699,6 +699,17 @@ router_parse_list_from_string(const char **s, smartlist_t *dest,
return 0;
}
+void dump_distinct_digests_xx(int severity);
+static digestmap_t *verified_digests_tmp = NULL; // XXXX0124 remove me.
+// remove me too.
+void
+dump_distinct_digests_xx(int severity) {
+ if (!verified_digests_tmp)
+ verified_digests_tmp = digestmap_new();
+ log(severity, LD_GENERAL, "%d *distinct* router digests verified",
+ digestmap_size(verified_digests_tmp));
+}
+
/** Helper function: reads a single router entry from *<b>s</b> ...
* *<b>end</b>. Mallocs a new router and returns it if all goes well, else
* returns NULL.
@@ -913,6 +924,9 @@ router_parse_entry_from_string(const char *s, const char *end,
goto err;
}
note_crypto_pk_op(VERIFY_RTR);
+ if (!verified_digests_tmp)
+ verified_digests_tmp = digestmap_new();
+ digestmap_set(verified_digests_tmp, signed_digest, (void*)(uintptr_t)1);
if ((t=crypto_pk_public_checksig(router->identity_pkey, signed_digest,
tok->object_body, 128)) != 20) {
log_warn(LD_DIR, "Invalid signature %d",t);