summaryrefslogtreecommitdiff
path: root/src/or
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-03 03:45:23 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-03 03:45:23 +0000
commit05c185bec1aa9ba1b9c5b9c3ba8b8616f639ebd8 (patch)
tree160855fa83eaa33bd7390b832ccd9cd2ae5ff277 /src/or
parent0ee57045459bad92ffef1bd38fc71c03ac76339b (diff)
downloadtor-05c185bec1aa9ba1b9c5b9c3ba8b8616f639ebd8.tar.gz
tor-05c185bec1aa9ba1b9c5b9c3ba8b8616f639ebd8.zip
Backport: fix bug 880: find the end of an authority cert by looking for the first ----END SIGNATURE----- after the first dir-key-certification, not for the first ----END SIGNATURE. Harmless bug, but it made us non-spec-compliant.
svn:r17471
Diffstat (limited to 'src/or')
-rw-r--r--src/or/routerparse.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 1520dc32fa..7675ef5a83 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1483,7 +1483,12 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
int found;
s = eat_whitespace(s);
- eos = strstr(s, "\n-----END SIGNATURE-----\n");
+ eos = strstr(s, "\ndir-key-certification");
+ if (! eos) {
+ log_warn(LD_DIR, "No signature found on key certificate");
+ return NULL;
+ }
+ eos = strstr(eos, "\n-----END SIGNATURE-----\n");
if (! eos) {
log_warn(LD_DIR, "No end-of-signature found on key certificate");
return NULL;