]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
4831. [bug] Convert the RRSIG expirytime to 64 bits for
authorMark Andrews <marka@isc.org>
Wed, 29 Nov 2017 04:20:23 +0000 (15:20 +1100)
committerMark Andrews <marka@isc.org>
Wed, 29 Nov 2017 04:20:23 +0000 (15:20 +1100)
                        comparisions in diff.c:resign. [RT #46710]

CHANGES
lib/dns/diff.c

diff --git a/CHANGES b/CHANGES
index 46e4bcdca578429d4a364f07baee1f74bd452169..db8a6d56cace378ab90ba7d74f581660251e6467 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+4831.  [bug]           Convert the RRSIG expirytime to 64 bits for
+                       comparisions in diff.c:resign. [RT #46710]
+
 4830.  [bug]           Failure to configure ATF when requested did not cause
                        an error in top-level configure script. [RT #46655]
 
index ef3ad4f38a67e9765a587a1e23776e23632ebdd9..0dad091523852c4924654a7dffd8d3bf17c0da03 100644 (file)
@@ -30,6 +30,7 @@
 #include <dns/rdatastruct.h>
 #include <dns/rdatatype.h>
 #include <dns/result.h>
+#include <dns/time.h>
 
 #define CHECK(op) \
        do { result = (op);                                     \
@@ -195,7 +196,7 @@ static isc_stdtime_t
 setresign(dns_rdataset_t *modified) {
        dns_rdata_t rdata = DNS_RDATA_INIT;
        dns_rdata_rrsig_t sig;
-       isc_stdtime_t when;
+       isc_int64_t when;
        isc_result_t result;
 
        result = dns_rdataset_first(modified);
@@ -205,7 +206,7 @@ setresign(dns_rdataset_t *modified) {
        if ((rdata.flags & DNS_RDATA_OFFLINE) != 0)
                when = 0;
        else
-               when = sig.timeexpire;
+               when = dns_time64_from32(sig.timeexpire);
        dns_rdata_reset(&rdata);
 
        result = dns_rdataset_next(modified);
@@ -215,14 +216,14 @@ setresign(dns_rdataset_t *modified) {
                if ((rdata.flags & DNS_RDATA_OFFLINE) != 0) {
                        goto next_rr;
                }
-               if (when == 0 || sig.timeexpire < when)
-                       when = sig.timeexpire;
+               if (when == 0 || dns_time64_from32(sig.timeexpire) < when)
+                       when = dns_time64_from32(sig.timeexpire);
  next_rr:
                dns_rdata_reset(&rdata);
                result = dns_rdataset_next(modified);
        }
        INSIST(result == ISC_R_NOMORE);
-       return (when);
+       return ((isc_stdtime_t)when);
 }
 
 static void