diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-11-04 22:12:11 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-11-04 22:12:11 -0500 |
commit | 0e8be13b9fa4dc794519a4c74197c313a202b6b5 (patch) | |
tree | 4c2698938cffc11420ca7ea775e25bd65265be9d /src/or/networkstatus.c | |
parent | 39a0a2c3ae8c93ceed42f6d2d1143002c231fc16 (diff) | |
download | tor-0e8be13b9fa4dc794519a4c74197c313a202b6b5.tar.gz tor-0e8be13b9fa4dc794519a4c74197c313a202b6b5.zip |
Allow an optional $ in GETINFO ns/id/<identity>
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.
Diffstat (limited to 'src/or/networkstatus.c')
-rw-r--r-- | src/or/networkstatus.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |