From: Kees Monshouwer Date: Mon, 29 Oct 2018 10:30:25 +0000 (+0100) Subject: rec: allow the signture inception to be off by a number of seconds. X-Git-Tag: dnsdist-1.3.3~3^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9a3ab3e4f53f1c5400aec406df9624fb6209abbc;p=thirdparty%2Fpdns.git rec: allow the signture inception to be off by a number of seconds. --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 3c7ec0ee31..e8a4807d8e 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -3364,6 +3364,12 @@ static int serviceMain(int argc, char*argv[]) exit(1); } + g_signatureInceptionSkew = ::arg().asNum("signature-inception-skew"); + if (g_signatureInceptionSkew < 0) { + g_log<`. +.. _setting-signature-inception-skew: + +``signature-inception-skew`` +---------------------------------- +- Integer +- Default: 60 + +Allow the signture inception to be off by this number of seconds. Negative values are not allowed. + .. _setting-single-socket: ``single-socket`` diff --git a/pdns/validate.cc b/pdns/validate.cc index f0fba47392..c081fe1556 100644 --- a/pdns/validate.cc +++ b/pdns/validate.cc @@ -6,6 +6,7 @@ #include "base32.hh" #include "logger.hh" bool g_dnssecLOG{false}; +time_t g_signatureInceptionSkew{0}; uint16_t g_maxNSEC3Iterations{0}; #define LOG(x) if(g_dnssecLOG) { g_log < getZoneCuts(const DNSName& begin, const DNSName& en bool isRRSIGNotExpired(const time_t now, const shared_ptr sig) { - return sig->d_siginception <= now && sig->d_sigexpire >= now; + return sig->d_siginception - g_signatureInceptionSkew <= now && sig->d_sigexpire >= now; } static bool checkSignatureWithKey(time_t now, const shared_ptr sig, const shared_ptr key, const std::string& msg) @@ -693,7 +694,7 @@ static bool checkSignatureWithKey(time_t now, const shared_ptrd_tag<<" and algorithm "<d_algorithm)<<" was " << (result ? "" : "NOT ")<<"valid"<d_siginception > now) ? "not yet valid" : "expired")<<" (inception: "<d_siginception<<", expiration: "<d_sigexpire<<", now: "<d_siginception - g_signatureInceptionSkew > now) ? "not yet valid" : "expired")<<" (inception: "<d_siginception<<", inception skew: "<d_sigexpire<<", now: "<