diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-08-21 14:20:38 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-08-21 14:20:38 -0400 |
commit | 6f3208670a11cc7f0c5917852d28890b07ab87d2 (patch) | |
tree | a972baf5ac34881fe8cdf9b72ed6f4ecd3ea5a39 /src/or/hs_descriptor.c | |
parent | 257f50b22fbaf9c9cb5859e257437b24af46c7ab (diff) | |
parent | 6be0e28670517048ce3ab017911cd41238543a13 (diff) | |
download | tor-6f3208670a11cc7f0c5917852d28890b07ab87d2.tar.gz tor-6f3208670a11cc7f0c5917852d28890b07ab87d2.zip |
Merge branch 'maint-0.3.1'
Diffstat (limited to 'src/or/hs_descriptor.c')
-rw-r--r-- | src/or/hs_descriptor.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/or/hs_descriptor.c b/src/or/hs_descriptor.c index 9a1e377155..2dfed1653f 100644 --- a/src/or/hs_descriptor.c +++ b/src/or/hs_descriptor.c @@ -1273,7 +1273,7 @@ cert_is_valid(tor_cert_t *cert, uint8_t type, const char *log_obj_type) } /* The following will not only check if the signature matches but also the * expiration date and overall validity. */ - if (tor_cert_checksig(cert, &cert->signing_key, time(NULL)) < 0) { + if (tor_cert_checksig(cert, &cert->signing_key, approx_time()) < 0) { log_warn(LD_REND, "Invalid signature for %s.", log_obj_type); goto err; } @@ -1927,7 +1927,8 @@ desc_sig_is_valid(const char *b64_sig, sig_start = tor_memstr(encoded_desc, encoded_len, "\n" str_signature); /* Getting here means the token parsing worked for the signature so if we * can't find the start of the signature, we have a code flow issue. */ - if (BUG(!sig_start)) { + if (!sig_start) { + log_warn(LD_GENERAL, "Malformed signature line. Rejecting."); goto err; } /* Skip newline, it has to go in the signature check. */ |