From 89dc78e4a3e20632e098def65c7296541f5d7dcd Mon Sep 17 00:00:00 2001 From: Peter Thomassen Date: Mon, 24 Jan 2022 11:14:03 +0100 Subject: Require trailing field in rdata of TLSA and friends (cherry picked from commit 4c70268984d865f8b0e93ca019518807af5fd344) --- tests/test_dnssec.py | 3 ++- tests/test_rdata.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/test_dnssec.py b/tests/test_dnssec.py index 12651d7..d4d7627 100644 --- a/tests/test_dnssec.py +++ b/tests/test_dnssec.py @@ -533,7 +533,8 @@ class DNSSECMakeDSTestCase(unittest.TestCase): dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.CDS, f'0 0 0 00') test_records = { - 'digest length inconsistent with digest type': ['0 0 0', '0 0 0 0000'], + 'expecting another identifier': ['0 0 0', '0 0 0 '], + 'digest length inconsistent with digest type': ['0 0 0 0000'], 'Odd-length string': ['0 0 0 0', '0 0 0 000'], } for msg, records in test_records.items(): diff --git a/tests/test_rdata.py b/tests/test_rdata.py index f87ff56..c002e7a 100644 --- a/tests/test_rdata.py +++ b/tests/test_rdata.py @@ -539,6 +539,9 @@ class RdataTestCase(unittest.TestCase): with self.assertRaises(dns.exception.SyntaxError): dns.rdata.from_text('in', 'type45678', '\\# 6 000a03666f6f00') + def test_empty_generic(self): + dns.rdata.from_text('in', 'type45678', r'\# 0') + def test_covered_repr(self): text = 'NSEC 1 3 3600 20190101000000 20030101000000 ' + \ '2143 foo Ym9ndXM=' -- cgit v1.2.1