NSEC3 = 50
NSEC3PARAM = 51
TLSA = 52
+ SMIMEA = 53
HIP = 55
NINFO = 56
CDS = 59
NSEC3 = RdataType.NSEC3
NSEC3PARAM = RdataType.NSEC3PARAM
TLSA = RdataType.TLSA
+SMIMEA = RdataType.SMIMEA
HIP = RdataType.HIP
NINFO = RdataType.NINFO
CDS = RdataType.CDS
--- /dev/null
+import dns.rdatatype
+from dns.rdtypes.ANY.TLSA import TLSA
+
+
+@dns.immutable.immutable
+class SMIMEA(TLSA):
+ """SMIMEA record, same format as TLSA per https://tools.ietf.org/html/rfc8162#section-2"""
'RP',
'RRSIG',
'RT',
+ 'SMIMEA',
'SOA',
'SPF',
'SSHFP',
A ``dns.name.Name``, the exchange name.
+.. autoclass:: dns.rdtypes.ANY.SMIMEA.SMIMEA
+ :members:
+
+ .. attribute:: usage
+
+ An ``int``, the certificate usage.
+
+ .. attribute:: selector
+
+ An ``int``, the selector.
+
+ .. attribute:: mtype
+
+ An ``int``, the matching type.
+
+ .. attribute:: cert
+
+ A ``bytes``, the certificate association data.
+
.. autoclass:: dns.rdtypes.ANY.SOA.SOA
:members:
:annotation: = 46
.. py:data:: dns.rdatatype.RT
:annotation: = 21
+.. py:data:: dns.rdatatype.SMIMEA
+ :annotation: = 53
.. py:data:: dns.rdatatype.SIG
:annotation: = 24
.. py:data:: dns.rdatatype.SOA
`RFC 1035 <https://tools.ietf.org/html/rfc1035>`_
RRSIG
`RFC 4034 <https://tools.ietf.org/html/rfc4034>`_
+SMIMEA
+ `RFC 8162 <https://tools.ietf.org/html/rfc8162>`_
SOA
`RFC 1035 <https://tools.ietf.org/html/rfc1035>`_
SPF
tlsa1 TLSA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
tlsa2 TLSA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
tlsa3 TLSA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
+smimea1 SMIMEA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
+smimea2 SMIMEA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
+smimea3 SMIMEA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
txt01 TXT "foo"
txt02 TXT "foo" "bar"
txt03 TXT foo
rt02 3600 IN RT 65535 .
s 300 IN NS ns.s
ns.s 300 IN A 73.80.65.49
+smimea1 3600 IN SMIMEA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
+smimea2 3600 IN SMIMEA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
+smimea3 3600 IN SMIMEA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
spf 3600 IN SPF "v=spf1 mx -all"
srv01 3600 IN SRV 0 0 0 .
srv02 3600 IN SRV 65535 65535 65535 old-slow-box.example.com.
rt02.example. 3600 IN RT 65535 .
s.example. 300 IN NS ns.s.example.
ns.s.example. 300 IN A 73.80.65.49
+smimea1.example. 3600 IN SMIMEA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
+smimea2.example. 3600 IN SMIMEA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
+smimea3.example. 3600 IN SMIMEA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
spf.example. 3600 IN SPF "v=spf1 mx -all"
srv01.example. 3600 IN SRV 0 0 0 .
srv02.example. 3600 IN SRV 65535 65535 65535 old-slow-box.example.com.
rt02 3600 IN RT 65535 .
s 300 IN NS ns.s
ns.s 300 IN A 73.80.65.49
+smimea1 3600 IN SMIMEA 3 1 1 a9cdf989b504fe5dca90c0d2167b6550570734f7c763e09fdf88904e06157065
+smimea2 3600 IN SMIMEA 1 0 1 efddf0d915c7bdc5782c0881e1b2a95ad099fbdd06d7b1f77982d9364338d955
+smimea3 3600 IN SMIMEA 1 0 2 81ee7f6c0ecc6b09b7785a9418f54432de630dd54dc6ee9e3c49de547708d236d4c413c3e97e44f969e635958aa410495844127c04883503e5b024cf7a8f6a94
spf 3600 IN SPF "v=spf1 mx -all"
srv01 3600 IN SRV 0 0 0 .
srv02 3600 IN SRV 65535 65535 65535 old-slow-box.example.com.
with self.assertRaises(dns.exception.SyntaxError):
dns.rdata.from_text('in', 'txt', 'a' * 256)
+ def equal_smimea(self, a, b):
+ a = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.SMIMEA, a)
+ b = dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.SMIMEA, b)
+ self.assertEqual(a, b)
+
+ def test_good_SMIMEA(self):
+ self.equal_smimea('3 0 1 aabbccddeeff', '3 0 01 AABBCCDDEEFF')
+
+ def test_bad_SMIMEA(self):
+ with self.assertRaises(dns.exception.SyntaxError):
+ dns.rdata.from_text(dns.rdataclass.IN, dns.rdatatype.SMIMEA, '1 1 1 aGVsbG8gd29ybGQh')
+
class UtilTestCase(unittest.TestCase):