summaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-08-30 08:48:50 -0400
committerNick Mathewson <nickm@torproject.org>2016-11-03 08:37:22 -0400
commitfae7060aea5c562fc59e7089b6a3459a5718b2d0 (patch)
treeeacff22a1786872d336b6099c3fabce28b22b2c0 /src/or/routerparse.c
parent0b4221f98dbb93c9322e7a778f04bcbcfcc79738 (diff)
downloadtor-fae7060aea5c562fc59e7089b6a3459a5718b2d0.tar.gz
tor-fae7060aea5c562fc59e7089b6a3459a5718b2d0.zip
Fix a misfeature with the Ed cert expiration API
The batch-verification helper didn't expose the expiration time, which made it pretty error-prone. This closes ticket 15087.
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 03f8f4eded..686ac48e40 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2028,12 +2028,13 @@ router_parse_entry_from_string(const char *s, const char *end,
ed25519_checkable_t check[3];
int check_ok[3];
- if (tor_cert_get_checkable_sig(&check[0], cert, NULL) < 0) {
+ time_t expires = TIME_MAX;
+ if (tor_cert_get_checkable_sig(&check[0], cert, NULL, &expires) < 0) {
log_err(LD_BUG, "Couldn't create 'checkable' for cert.");
goto err;
}
if (tor_cert_get_checkable_sig(&check[1],
- ntor_cc_cert, &ntor_cc_pk) < 0) {
+ ntor_cc_cert, &ntor_cc_pk, &expires) < 0) {
log_err(LD_BUG, "Couldn't create 'checkable' for ntor_cc_cert.");
goto err;
}
@@ -2063,10 +2064,7 @@ router_parse_entry_from_string(const char *s, const char *end,
}
/* We check this before adding it to the routerlist. */
- if (cert->valid_until < ntor_cc_cert->valid_until)
- router->cert_expiration_time = cert->valid_until;
- else
- router->cert_expiration_time = ntor_cc_cert->valid_until;
+ router->cert_expiration_time = expires;
}
}
@@ -2376,7 +2374,7 @@ extrainfo_parse_entry_from_string(const char *s, const char *end,
ed25519_checkable_t check[2];
int check_ok[2];
- if (tor_cert_get_checkable_sig(&check[0], cert, NULL) < 0) {
+ if (tor_cert_get_checkable_sig(&check[0], cert, NULL, NULL) < 0) {
log_err(LD_BUG, "Couldn't create 'checkable' for cert.");
goto err;
}