2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-01 06:25:34 +00:00

[2185] Add support for the TLSA RR type

This commit is contained in:
Mukund Sivaraman
2014-01-14 09:36:57 +05:30
parent 17f56de819
commit d88bd04636
21 changed files with 858 additions and 2 deletions

View File

@@ -352,7 +352,7 @@ dict_rrtype = { 'none' : 0, 'a' : 1, 'ns' : 2, 'md' : 3, 'mf' : 4, 'cname' : 5,
'srv' : 33, 'naptr' : 35, 'kx' : 36, 'cert' : 37, 'a6' : 38,
'dname' : 39, 'opt' : 41, 'apl' : 42, 'ds' : 43, 'sshfp' : 44,
'ipseckey' : 45, 'rrsig' : 46, 'nsec' : 47, 'dnskey' : 48,
'dhcid' : 49, 'nsec3' : 50, 'nsec3param' : 51, 'hip' : 55,
'dhcid' : 49, 'nsec3' : 50, 'nsec3param' : 51, 'tlsa' : 52, 'hip' : 55,
'spf' : 99, 'unspec' : 103, 'tkey' : 249, 'tsig' : 250,
'dlv' : 32769, 'ixfr' : 251, 'axfr' : 252, 'mailb' : 253,
'maila' : 254, 'any' : 255 }
@@ -1156,6 +1156,32 @@ class RRSIG(RR):
f.write('# Tag=%d Signer=%s and Signature\n' % (self.tag, self.signer))
f.write('%04x %s %s\n' % (self.tag, name_wire, sig_wire))
class TLSA(RR):
'''Implements rendering TLSA RDATA in the test data format.
Configurable parameters are as follows (see the description of the
same name of attribute for the default value):
- certificate_usage (int): The certificate usage field value.
- selector (int): The selector field value.
- matching_type (int): The matching type field value.
- certificate_association_data (string): The certificate association data.
'''
certificate_usage = 0
selector = 0
matching_type = 1
certificate_association_data = 'd2abde240d7cd3ee6b4b28c54df034b97983a1d16e8a410e4561cb106618e971'
def dump(self, f):
if self.rdlen is None:
self.rdlen = 2 + (len(self.certificate_association_data) / 2)
else:
self.rdlen = int(self.rdlen)
self.dump_header(f, self.rdlen)
f.write('# CERTIFICATE_USAGE=%d SELECTOR=%d MATCHING_TYPE=%d CERTIFICATE_ASSOCIATION_DATA=%s\n' %\
(self.certificate_usage, self.selector, self.matching_type,\
self.certificate_association_data))
f.write('%02x %02x %02x %s\n' % (self.certificate_usage, self.selector, self.matching_type,\
self.certificate_association_data))
class TSIG(RR):
'''Implements rendering TSIG RDATA in the test data format.