aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2008-12-03 03:42:19 +0000
committerNick Mathewson <nickm@torproject.org>2008-12-03 03:42:19 +0000
commita26188cee96f3a3224f92e1573c692e318ebf1b2 (patch)
tree38c22c3469fb4d497ca51201d52a8486988c16de /src/or/routerparse.c
parent14fae5f2b364fa5e60135a5877947d988b66393c (diff)
downloadtor-a26188cee96f3a3224f92e1573c692e318ebf1b2.tar
tor-a26188cee96f3a3224f92e1573c692e318ebf1b2.tar.gz
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:r17470
Diffstat (limited to 'src/or/routerparse.c')
-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 5230d481e..701012043 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -1563,7 +1563,12 @@ authority_cert_parse_from_string(const char *s, const char **end_of_string)
memarea_t *area = NULL;
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;