From: Nick Mathewson Date: Mon, 5 Nov 2012 03:12:11 +0000 (-0500) Subject: Allow an optional $ in GETINFO ns/id/ X-Git-Tag: tor-0.2.4.7-alpha~37^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0e8be13b9fa4dc794519a4c74197c313a202b6b5;p=thirdparty%2Ftor.git Allow an optional $ in GETINFO ns/id/ That's not where I'd want to put a $, but apparently the other foo/id/ 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. --- diff --git a/changes/bug7059a b/changes/bug7059a new file mode 100644 index 0000000000..b0c0611705 --- /dev/null +++ b/changes/bug7059a @@ -0,0 +1,5 @@ + o Minor features (controller): + - Allow an optional $ before the node identity digest in the + controller command GETINFO ns/id/, for consistency with + md/id/ and desc/id/. + diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c index 89afb5a5c1..7296f9698c 100644 --- a/src/or/networkstatus.c +++ b/src/or/networkstatus.c @@ -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; }