]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Allow an optional $ in GETINFO ns/id/<identity>
authorNick Mathewson <nickm@torproject.org>
Mon, 5 Nov 2012 03:12:11 +0000 (22:12 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 5 Nov 2012 03:12:11 +0000 (22:12 -0500)
That's not where I'd want to put a $, but apparently the other
foo/id/<identity> things allow it, as does an arguably valid
interpretation of control-spec.txt.  So let's be consistent.

Fix for a piece of bug 7059.

changes/bug7059a [new file with mode: 0644]
src/or/networkstatus.c

diff --git a/changes/bug7059a b/changes/bug7059a
new file mode 100644 (file)
index 0000000..b0c0611
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor features (controller):
+    - Allow an optional $ before the node identity digest in the
+      controller command GETINFO ns/id/<identity>, for consistency with
+      md/id/<identity> and desc/id/<identity>.
+
index 89afb5a5c112274195518c9415ecc61e82c7ce02..7296f9698cfb7cc4d3520d61666d4de5b446796e 100644 (file)
@@ -2374,8 +2374,11 @@ getinfo_helper_networkstatus(control_connection_t *conn,
     return 0;
   } else if (!strcmpstart(question, "ns/id/")) {
     char d[DIGEST_LEN];
+    const char *q = question + 6;
+    if (*q == '$')
+      ++q;
 
-    if (base16_decode(d, DIGEST_LEN, question+6, strlen(question+6))) {
+    if (base16_decode(d, DIGEST_LEN, q, strlen(q))) {
       *errmsg = "Data not decodeable as hex";
       return -1;
     }