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
This commit is contained in:
Nick Mathewson
2008-12-03 03:42:19 +00:00
parent 14fae5f2b3
commit a26188cee9
2 changed files with 9 additions and 1 deletions
+6 -1
View File
@@ -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;