[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r9136: Implement GETINFO fingerprint. (in tor/trunk: . src/or)



Author: nickm
Date: 2006-12-15 16:51:24 -0500 (Fri, 15 Dec 2006)
New Revision: 9136

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/control.c
Log:
 r11609@Kushana:  nickm | 2006-12-15 16:42:21 -0500
 Implement GETINFO fingerprint.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r11609] on c95137ef-5f19-0410-b913-86e773d04f59

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-12-15 21:51:19 UTC (rev 9135)
+++ tor/trunk/ChangeLog	2006-12-15 21:51:24 UTC (rev 9136)
@@ -61,6 +61,7 @@
     - Have GETINFO dir/status/* work on hosts with DirPort disabled.
     - Reimplement GETINFO so that info/names stays in sync with the
       actual keys.
+    - Implement "GETINFO fingerprint".
 
   o Controller bugfixes:
     - Report the circuit number correctly in STREAM CLOSED events. (Bug

Modified: tor/trunk/src/or/control.c
===================================================================
--- tor/trunk/src/or/control.c	2006-12-15 21:51:19 UTC (rev 9135)
+++ tor/trunk/src/or/control.c	2006-12-15 21:51:24 UTC (rev 9136)
@@ -1449,6 +1449,15 @@
     *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 @@
        "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."),