diff options
author | Nick Mathewson <nickm@torproject.org> | 2006-12-15 21:51:24 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2006-12-15 21:51:24 +0000 |
commit | 251f007b75aaef7755dd45069c54ee6786f3a013 (patch) | |
tree | f7c6b9b120c46b20c949a3ced670921312b61f74 /src/or/control.c | |
parent | 9184b594a4690b1e729ea0286dd5e2ece22288df (diff) | |
download | tor-251f007b75aaef7755dd45069c54ee6786f3a013.tar.gz tor-251f007b75aaef7755dd45069c54ee6786f3a013.zip |
r11609@Kushana: nickm | 2006-12-15 16:42:21 -0500
Implement GETINFO fingerprint.
svn:r9136
Diffstat (limited to 'src/or/control.c')
-rw-r--r-- | src/or/control.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/or/control.c b/src/or/control.c index 3fec5ae786..f5b0d5223f 100644 --- a/src/or/control.c +++ b/src/or/control.c @@ -1449,6 +1449,15 @@ getinfo_helper_misc(control_connection_t *conn, const char *question, *answer = tor_dup_addr(addr); } 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) { + *answer = tor_strdup(""); + } else { + *answer = tor_malloc(HEX_DIGEST_LEN+1); + base16_encode(*answer, HEX_DIGEST_LEN+1, me->cache_info.identity_digest, + DIGEST_LEN); + } } return 0; } @@ -1734,10 +1743,10 @@ static const getinfo_item_t getinfo_items[] = { "Time when the accounting period ends."), ITEM("accounting/interval-wake", accounting, "Time to wake up in this accounting period."), - /* deprecated */ - ITEM("helper-nodes", entry_guards, NULL), + ITEM("helper-nodes", entry_guards, NULL), /* deprecated */ ITEM("entry-guards", entry_guards, "Which nodes are we using as entry guards?"), + ITEM("fingerprint", misc, NULL), PREFIX("config/", config, "Current configuration values."), DOC("config/names", "List of configuration options, types, and documentation."), |