summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-14 17:20:01 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-14 17:20:01 -0400
commit866a2828bdcb88398ee8332e918e9a9028397156 (patch)
tree7183215fc2e42a643a0e562c111cc0c000e40399
parent5580fbb0c481a1f52fcef9e5b65966d5a91446d9 (diff)
parent2e34416c6db20156619e80975e46c8b1030bb3a1 (diff)
downloadtor-866a2828bdcb88398ee8332e918e9a9028397156.tar.gz
tor-866a2828bdcb88398ee8332e918e9a9028397156.zip
Merge branch 'bug3577' into maint-0.2.2
-rw-r--r--changes/bug35774
-rw-r--r--src/or/control.c10
2 files changed, 9 insertions, 5 deletions
diff --git a/changes/bug3577 b/changes/bug3577
new file mode 100644
index 0000000000..6335272752
--- /dev/null
+++ b/changes/bug3577
@@ -0,0 +1,4 @@
+ o Minor bugfixes:
+ - Allow GETINFO fingerprint to return a fingerprint even when
+ we have not yet built a router descriptor. Fixes bug 3577;
+ bugfix on 0.2.0.1-alpha.
diff --git a/src/or/control.c b/src/or/control.c
index da0a95da15..954da65143 100644
--- a/src/or/control.c
+++ b/src/or/control.c
@@ -1394,14 +1394,14 @@ getinfo_helper_misc(control_connection_t *conn, const char *question,
} else if (!strcmp(question, "dir-usage")) {
*answer = directory_dump_request_log();
} else if (!strcmp(question, "fingerprint")) {
- routerinfo_t *me = router_get_my_routerinfo();
- if (!me) {
- *errmsg = "No routerdesc known; am I really a server?";
+ crypto_pk_env_t *server_key;
+ if (!server_mode(get_options())) {
+ *errmsg = "Not running in server mode";
return -1;
}
+ server_key = get_server_identity_key();
*answer = tor_malloc(HEX_DIGEST_LEN+1);
- base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest,
- DIGEST_LEN);
+ crypto_pk_get_fingerprint(server_key, *answer, 0);
}
return 0;
}