aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_descriptor.c
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2020-03-30 13:38:58 -0400
committerDavid Goulet <dgoulet@torproject.org>2020-03-30 13:38:58 -0400
commitca8e6451f2be09415eb6ebf66f22272b13d02246 (patch)
treef91805edd8725ecfa7d92474cc55bd13bd077d2a /src/feature/hs/hs_descriptor.c
parentec8d41e69931bc717b41831928c720b21719c67f (diff)
parent42e56f5bacc6ead39bfef790c6f9ca9be0419739 (diff)
downloadtor-ca8e6451f2be09415eb6ebf66f22272b13d02246.tar.gz
tor-ca8e6451f2be09415eb6ebf66f22272b13d02246.zip
Merge branch 'maint-0.4.3'
Diffstat (limited to 'src/feature/hs/hs_descriptor.c')
-rw-r--r--src/feature/hs/hs_descriptor.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/feature/hs/hs_descriptor.c b/src/feature/hs/hs_descriptor.c
index c274ed7581..a39a4a09c9 100644
--- a/src/feature/hs/hs_descriptor.c
+++ b/src/feature/hs/hs_descriptor.c
@@ -56,6 +56,7 @@
#define HS_DESCRIPTOR_PRIVATE
#include "core/or/or.h"
+#include "app/config/config.h"
#include "trunnel/ed25519_cert.h" /* Trunnel interface. */
#include "feature/hs/hs_descriptor.h"
#include "core/or/circuitbuild.h"
@@ -1283,11 +1284,20 @@ cert_is_valid(tor_cert_t *cert, uint8_t type, const char *log_obj_type)
log_warn(LD_REND, "Signing key is NOT included for %s.", log_obj_type);
goto err;
}
+
/* 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, approx_time()) < 0) {
- log_warn(LD_REND, "Invalid signature for %s: %s", log_obj_type,
- tor_cert_describe_signature_status(cert));
+ if (cert->cert_expired) {
+ char expiration_str[ISO_TIME_LEN+1];
+ format_iso_time(expiration_str, cert->valid_until);
+ log_fn(LOG_PROTOCOL_WARN, LD_REND, "Invalid signature for %s: %s (%s)",
+ log_obj_type, tor_cert_describe_signature_status(cert),
+ expiration_str);
+ } else {
+ log_warn(LD_REND, "Invalid signature for %s: %s",
+ log_obj_type, tor_cert_describe_signature_status(cert));
+ }
goto err;
}