]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec validate: use rfc1982 math for RRSIG timestamps
authorPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 9 Jun 2025 13:44:18 +0000 (15:44 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 9 Jun 2025 13:44:18 +0000 (15:44 +0200)
pdns/validate.cc

index 1666460697fba6475233e0b4df9a01dd33342bae..e1e38b50d16bcc44382eedf248deef0be2168c83 100644 (file)
@@ -973,14 +973,12 @@ dState getDenial(const cspmap_t &validrrsets, const DNSName& qname, const uint16
 
 bool isRRSIGNotExpired(const time_t now, const RRSIGRecordContent& sig)
 {
-  // Should use https://www.rfc-editor.org/rfc/rfc4034.txt section 3.1.5
-  return sig.d_sigexpire >= now;
+  return rfc1982LessThan<uint32_t>(now, sig.d_sigexpire);
 }
 
 bool isRRSIGIncepted(const time_t now, const RRSIGRecordContent& sig)
 {
-  // Should use https://www.rfc-editor.org/rfc/rfc4034.txt section 3.1.5
-  return sig.d_siginception - g_signatureInceptionSkew <= now;
+  return rfc1982LessThan<uint32_t>(sig.d_siginception - g_signatureInceptionSkew, now);
 }
 
 namespace {