diff options
author | Nick Mathewson <nickm@torproject.org> | 2011-07-13 12:44:41 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2011-07-13 12:45:18 -0400 |
commit | 5000e59b5ff4234c6119c5ac0e9f419430c8b699 (patch) | |
tree | caea7bf92091e46da7f39abc9c976e3633bdb086 /src | |
parent | 3ab09763ced6d892cd72956e53f2dfb804ec0a7c (diff) | |
download | tor-5000e59b5ff4234c6119c5ac0e9f419430c8b699.tar tor-5000e59b5ff4234c6119c5ac0e9f419430c8b699.tar.gz |
Change GETINFO fingerprint to look at server_mode, not my_descriptor
It's possible for us to be a server and have a fingerprint without
having yet generated a descriptor.
Fixes bug 3577; bugfix on 0.2.0.1-alpha
Diffstat (limited to 'src')
-rw-r--r-- | src/or/control.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/or/control.c b/src/or/control.c index da0a95da1..d33d33734 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) { + crypto_pk_env_t *server_key; + if (!server_mode(get_options())) { *errmsg = "No routerdesc known; am I really a server?"; 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; } |