mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-24 12:23:32 +01:00
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
This commit is contained in:
parent
3ab09763ce
commit
5000e59b5f
4
changes/bug3577
Normal file
4
changes/bug3577
Normal file
@ -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.
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user