From: Bob Halley Date: Tue, 9 Apr 2019 00:41:27 +0000 (-0700) Subject: Parse decimal integer time in RRSIG records. X-Git-Tag: v2.0.0rc1~367 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=84d567e735b6adce893b679f9c27dac97155031c;p=thirdparty%2Fdnspython.git Parse decimal integer time in RRSIG records. Patch by Brian Wellington (thanks!) [Issue #364] --- diff --git a/dns/rdtypes/ANY/RRSIG.py b/dns/rdtypes/ANY/RRSIG.py index d3756ece..80c65098 100644 --- a/dns/rdtypes/ANY/RRSIG.py +++ b/dns/rdtypes/ANY/RRSIG.py @@ -32,6 +32,8 @@ class BadSigTime(dns.exception.DNSException): def sigtime_to_posixtime(what): + if len(what) <= 10 and what.isdigit(): + return int(what) if len(what) != 14: raise BadSigTime year = int(what[0:4]) diff --git a/tests/example b/tests/example index a5c85521..2378ef0c 100644 --- a/tests/example +++ b/tests/example @@ -168,6 +168,7 @@ apl02 APL 1:224.0.0.0/4 2:FF00:0:0:0:0:0:0:0/8 unknown2 TYPE999 \# 8 0a0000010a000001 unknown3 A \# 4 7f000002 rrsig01 RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY= +rrsig02 RRSIG NSEC 1 3 3600 1577836800 1041379200 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz45IkskceFGgi WCn/GxHhai6VAuHAoNUz4YoU1tVfSCSqQYn6//11U6Nl d80jEeC8aTrO+KKmCaY= nsec01 NSEC a.secure A MX RRSIG NSEC TYPE1234 nsec02 NSEC . ( NSAP-PTR NSEC ) nsec03 NSEC . ( NSEC TYPE65535 ) diff --git a/tests/example1.good b/tests/example1.good index a2e82d21..8c5e8bf7 100644 --- a/tests/example1.good +++ b/tests/example1.good @@ -96,6 +96,7 @@ px02 3600 IN PX 65535 . . rp01 3600 IN RP mbox-dname txt-dname rp02 3600 IN RP . . rrsig01 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= +rrsig02 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= rt01 3600 IN RT 0 intermediate-host rt02 3600 IN RT 65535 . s 300 IN NS ns.s diff --git a/tests/example2.good b/tests/example2.good index 6daf30c3..65efdbfc 100644 --- a/tests/example2.good +++ b/tests/example2.good @@ -96,6 +96,7 @@ px02.example. 3600 IN PX 65535 . . rp01.example. 3600 IN RP mbox-dname.example. txt-dname.example. rp02.example. 3600 IN RP . . rrsig01.example. 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo.example. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= +rrsig02.example. 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo.example. MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= rt01.example. 3600 IN RT 0 intermediate-host.example. rt02.example. 3600 IN RT 65535 . s.example. 300 IN NS ns.s.example. diff --git a/tests/example3.good b/tests/example3.good index a2e82d21..8c5e8bf7 100644 --- a/tests/example3.good +++ b/tests/example3.good @@ -96,6 +96,7 @@ px02 3600 IN PX 65535 . . rp01 3600 IN RP mbox-dname txt-dname rp02 3600 IN RP . . rrsig01 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= +rrsig02 3600 IN RRSIG NSEC 1 3 3600 20200101000000 20030101000000 2143 foo MxFcby9k/yvedMfQgKzhH5er0Mu/vILz 45IkskceFGgiWCn/GxHhai6VAuHAoNUz 4YoU1tVfSCSqQYn6//11U6Nld80jEeC8 aTrO+KKmCaY= rt01 3600 IN RT 0 intermediate-host rt02 3600 IN RT 65535 . s 300 IN NS ns.s