SSHFP support for Source AXFR/Zonefile

This commit is contained in:
Aquifoliales
2022-05-18 14:43:12 +02:00
parent 4416756c16
commit 8b2bfa5dea
3 changed files with 25 additions and 5 deletions
+17 -1
View File
@@ -26,7 +26,7 @@ class AxfrBaseSource(BaseSource):
SUPPORTS_GEO = False
SUPPORTS_DYNAMIC = False
SUPPORTS = set(('A', 'AAAA', 'CAA', 'CNAME', 'LOC', 'MX', 'NS', 'PTR',
'SPF', 'SRV', 'TXT'))
'SPF', 'SRV', 'SSHFP', 'TXT'))
def __init__(self, id):
super(AxfrBaseSource, self).__init__(id)
@@ -135,6 +135,22 @@ class AxfrBaseSource(BaseSource):
'values': values
}
def _data_for_SSHFP(self, _type, records):
values = []
for record in records:
algorithm, fingerprint_type, fingerprint = \
record['value'].split(' ', 2)
values.append({
'algorithm': algorithm,
'fingerprint_type': fingerprint_type,
'fingerprint': fingerprint,
})
return {
'type': _type,
'ttl': records[0]['ttl'],
'values': values
}
def populate(self, zone, target=False, lenient=False):
self.log.debug('populate: name=%s, target=%s, lenient=%s', zone.name,
target, lenient)