Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dig lookup: fix DNSKEY's algorithm handling #5914

Merged
merged 1 commit into from
Jan 29, 2023

Conversation

felixfontein
Copy link
Collaborator

SUMMARY

With dnspython 2.0.0+, algorithm of DNSKEY rdata is an enum type and no longer an int. Explicitly converting it to int makes sure that it is an integer.

Try ansible localhost -m debug -a 'msg={{ q("dig", "com", qtype="DNSKEY", flat=0) }}' with and without this PR, then you get

    "msg": [
        {
            "algorithm": 8,
            "class": "IN",
            "flags": 257,
            "key": "AQPDzldNmMvZFX4NcNJ0uEnKDg7tmv/F3MyQR0lpBmVcNcsIszxNFxsBfKNW9JYCYqpik8366LE7VbIcNRzfp2h9OO8HRl+H+E08zauK8k7evWEmu/6od+2boggPoiEfGNyvNPaSI7FOIroDsnw/taggzHRX1Z7SOiOiPWPNIwSUyWOZ79VmcQ1GLkC6NlYvG3HwYmynQv6oFwGv/KELSw7ZSdrbTQ0HXvZbqMUI7BaMskmvgm1G7oKZ1YiF7O9ioVNc0+7ASbqmZN7Z98EGU/Qh2K/BgUe8Hs0XVcdPKrtyYnoQHd2ynKPcMMlTEih2/2HDHjRPJ2aywIpKNnv4oPo/",
            "owner": "com.",
            "protocol": 3,
            "ttl": 86362,
            "type": "DNSKEY"
        },
        {
            "algorithm": 8,
            "class": "IN",
            "flags": 256,
            "key": "AwEAAb+cCgnkrABgFJ67lulzA/rJtcnjALB/gP3Q33PdpNl3VoW/V0GWzo99F7I7FyK/lpRTgoPp2pe2DRtoocL9XhqVoEDDV04KPk6kJXacSpltf9xu/j+sJElOGz/cWzAxIN2sTJxsRyNRwenTLJLd1pLDqB80hB25he9/d2bwmuWhC7l7mHrXr0RgvkxGGSeP/k0MQg7JGzl1mC+P/yqwx6E=",
            "owner": "com.",
            "protocol": 3,
            "ttl": 86362,
            "type": "DNSKEY"
        }
    ]

vs

    "msg": "[{'flags': 256, 'algorithm': <Algorithm.RSASHA256: 8>, 'protocol': 3, 'key': 'AwEAAb+cCgnkrABgFJ67lulzA/rJtcnjALB/gP3Q33PdpNl3VoW/V0GWzo99F7I7FyK/lpRTgoPp2pe2DRtoocL9XhqVoEDDV04KPk6kJXacSpltf9xu/j+sJElOGz/cWzAxIN2sTJxsRyNRwenTLJLd1pLDqB80hB25he9/d2bwmuWhC7l7mHrXr0RgvkxGGSeP/k0MQg7JGzl1mC+P/yqwx6E=', 'owner': 'com.', 'type': 'DNSKEY', 'ttl': 86400, 'class': 'IN'}, {'flags': 257, 'algorithm': <Algorithm.RSASHA256: 8>, 'protocol': 3, 'key': 'AQPDzldNmMvZFX4NcNJ0uEnKDg7tmv/F3MyQR0lpBmVcNcsIszxNFxsBfKNW9JYCYqpik8366LE7VbIcNRzfp2h9OO8HRl+H+E08zauK8k7evWEmu/6od+2boggPoiEfGNyvNPaSI7FOIroDsnw/taggzHRX1Z7SOiOiPWPNIwSUyWOZ79VmcQ1GLkC6NlYvG3HwYmynQv6oFwGv/KELSw7ZSdrbTQ0HXvZbqMUI7BaMskmvgm1G7oKZ1YiF7O9ioVNc0+7ASbqmZN7Z98EGU/Qh2K/BgUe8Hs0XVcdPKrtyYnoQHd2ynKPcMMlTEih2/2HDHjRPJ2aywIpKNnv4oPo/', 'owner': 'com.', 'type': 'DNSKEY', 'ttl': 86400, 'class': 'IN'}]"

(I also updated the RRSIG field name list, while being at it.)

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

dig lookup plugin

@felixfontein felixfontein added check-before-release PR will be looked at again shortly before release and merged if possible. backport-5 labels Jan 29, 2023
@ansibullbot
Copy link
Collaborator

cc @jpmens
click here for bot help

@ansibullbot ansibullbot added bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) labels Jan 29, 2023
@jpmens
Copy link
Contributor

jpmens commented Jan 29, 2023

shipit

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Jan 29, 2023
@felixfontein felixfontein merged commit 3da24d5 into ansible-collections:main Jan 29, 2023
@patchback
Copy link

patchback bot commented Jan 29, 2023

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/3da24d50cdadfd4aa383800f72ca6dab22ee93f2/pr-5914

Backported as #5915

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein deleted the dig2 branch January 29, 2023 17:18
patchback bot pushed a commit that referenced this pull request Jan 29, 2023
Fix DNSKEY's algorithm handling.

(cherry picked from commit 3da24d5)
@patchback
Copy link

patchback bot commented Jan 29, 2023

Backport to stable-6: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-6/3da24d50cdadfd4aa383800f72ca6dab22ee93f2/pr-5914

Backported as #5916

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein
Copy link
Collaborator Author

@jpmens thanks for reviewing this so quickly!

patchback bot pushed a commit that referenced this pull request Jan 29, 2023
Fix DNSKEY's algorithm handling.

(cherry picked from commit 3da24d5)
felixfontein added a commit that referenced this pull request Jan 29, 2023
…ithm handling (#5915)

dig lookup: fix DNSKEY's algorithm handling (#5914)

Fix DNSKEY's algorithm handling.

(cherry picked from commit 3da24d5)

Co-authored-by: Felix Fontein <felix@fontein.de>
felixfontein added a commit that referenced this pull request Jan 29, 2023
…ithm handling (#5916)

dig lookup: fix DNSKEY's algorithm handling (#5914)

Fix DNSKEY's algorithm handling.

(cherry picked from commit 3da24d5)

Co-authored-by: Felix Fontein <felix@fontein.de>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug lookup lookup plugin plugins plugin (any type) shipit
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants