summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-07-22 06:22:04 +0000
committerRoger Dingledine <arma@torproject.org>2004-07-22 06:22:04 +0000
commitf355a9c9f1969dd0cce9d1772483df81431e280b (patch)
treec66389a9737fb26c1541559110fdbc2fd9a8da65
parentc1450319f472f80783e5e2b234d27ee63fc97f7c (diff)
downloadtor-f355a9c9f1969dd0cce9d1772483df81431e280b.tar.gz
tor-f355a9c9f1969dd0cce9d1772483df81431e280b.zip
put our fingerprint into the descriptor, so we can match a
desc to a running-routers entry svn:r2100
-rw-r--r--src/or/router.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/or/router.c b/src/or/router.c
index bd7e666d2d..821ccc9a91 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -573,6 +573,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
char digest[20];
char signature[128];
char published[32];
+ char fingerprint[FINGERPRINT_LEN+1];
struct in_addr in;
int onion_pkeylen, identity_pkeylen;
int written;
@@ -590,6 +591,12 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
return -1;
}
+ /* record our fingerprint, so we can include it in the descriptor */
+ if (crypto_pk_get_fingerprint(router->identity_pkey, fingerprint)<0) {
+ log_fn(LOG_ERR, "Error computing fingerprint");
+ return -1;
+ }
+
/* PEM-encode the onion key */
if(crypto_pk_write_public_key_to_string(router->onion_pkey,
&onion_pkey,&onion_pkeylen)<0) {
@@ -613,6 +620,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
"router %s %s %d %d %d\n"
"platform %s\n"
"published %s\n"
+ "opt fingerprint %s\n"
"opt uptime %ld\n"
"bandwidth %d %d %d\n"
"onion-key\n%s"
@@ -627,6 +635,7 @@ int router_dump_router_to_string(char *s, int maxlen, routerinfo_t *router,
router->is_trusted_dir ? router->dir_port : 0,
router->platform,
published,
+ fingerprint,
stats_n_seconds_uptime,
(int) router->bandwidthrate,
(int) router->bandwidthburst,