mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #5914/3da24d50 backport][stable-6] dig lookup: fix DNSKEY's algorithm handling (#5916)
dig lookup: fix DNSKEY's algorithm handling (#5914)
Fix DNSKEY's algorithm handling.
(cherry picked from commit 3da24d50cd
)
Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
24cf561135
commit
9740b76f3c
2 changed files with 5 additions and 1 deletions
2
changelogs/fragments/5914-dig-dnskey.yml
Normal file
2
changelogs/fragments/5914-dig-dnskey.yml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "dig lookup plugin - correctly handle DNSKEY record type's ``algorithm`` field (https://github.com/ansible-collections/community.general/pull/5914)."
|
|
@ -238,7 +238,7 @@ def make_rdata_dict(rdata):
|
||||||
NSEC3PARAM: ['algorithm', 'flags', 'iterations', 'salt'],
|
NSEC3PARAM: ['algorithm', 'flags', 'iterations', 'salt'],
|
||||||
PTR: ['target'],
|
PTR: ['target'],
|
||||||
RP: ['mbox', 'txt'],
|
RP: ['mbox', 'txt'],
|
||||||
# RRSIG: ['algorithm', 'labels', 'original_ttl', 'expiration', 'inception', 'signature'],
|
# RRSIG: ['type_covered', 'algorithm', 'labels', 'original_ttl', 'expiration', 'inception', 'key_tag', 'signer', 'signature'],
|
||||||
SOA: ['mname', 'rname', 'serial', 'refresh', 'retry', 'expire', 'minimum'],
|
SOA: ['mname', 'rname', 'serial', 'refresh', 'retry', 'expire', 'minimum'],
|
||||||
SPF: ['strings'],
|
SPF: ['strings'],
|
||||||
SRV: ['priority', 'weight', 'port', 'target'],
|
SRV: ['priority', 'weight', 'port', 'target'],
|
||||||
|
@ -259,6 +259,8 @@ def make_rdata_dict(rdata):
|
||||||
|
|
||||||
if rdata.rdtype == DS and f == 'digest':
|
if rdata.rdtype == DS and f == 'digest':
|
||||||
val = dns.rdata._hexify(rdata.digest).replace(' ', '')
|
val = dns.rdata._hexify(rdata.digest).replace(' ', '')
|
||||||
|
if rdata.rdtype == DNSKEY and f == 'algorithm':
|
||||||
|
val = int(val)
|
||||||
if rdata.rdtype == DNSKEY and f == 'key':
|
if rdata.rdtype == DNSKEY and f == 'key':
|
||||||
val = dns.rdata._base64ify(rdata.key).replace(' ', '')
|
val = dns.rdata._base64ify(rdata.key).replace(' ', '')
|
||||||
if rdata.rdtype == NSEC3PARAM and f == 'salt':
|
if rdata.rdtype == NSEC3PARAM and f == 'salt':
|
||||||
|
|
Loading…
Reference in a new issue