aboutsummaryrefslogtreecommitdiff
path: root/src/feature/hs/hs_descriptor.c
diff options
context:
space:
mode:
authorGeorge Kadianakis <desnacked@riseup.net>2020-03-11 15:18:47 +0200
committerDavid Goulet <dgoulet@torproject.org>2020-03-30 13:38:29 -0400
commit42e56f5bacc6ead39bfef790c6f9ca9be0419739 (patch)
tree9e180693554fd4df2b701505bb07935172f01514 /src/feature/hs/hs_descriptor.c
parente472737297f5924a584fc8f434aba085e89b887a (diff)
downloadtor-42e56f5bacc6ead39bfef790c6f9ca9be0419739.tar.gz
tor-42e56f5bacc6ead39bfef790c6f9ca9be0419739.zip
hs-v3: Relax severity of a log message when decoding descriptors.
Make it LOG_PROTOCOL_WARN and also add the expiration timestamp in there to ease debugging in the future.
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 65d6c7a581..4d4200bd64 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"
@@ -1287,11 +1288,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;
}