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

[PR #5914/3da24d50 backport][stable-5] dig lookup: fix DNSKEY's algorithm handling #5915

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Jan 29, 2023

This is a backport of PR #5914 as merged into main (3da24d5).

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

Fix DNSKEY's algorithm handling.

(cherry picked from commit 3da24d5)
@ansibullbot
Copy link
Collaborator

cc @jpmens
click here for bot help

@ansibullbot ansibullbot added backport bug This issue/PR relates to a bug lookup lookup plugin new_contributor Help guide this first time contributor plugins plugin (any type) labels Jan 29, 2023
@felixfontein felixfontein merged commit 38616e4 into stable-5 Jan 29, 2023
@felixfontein felixfontein deleted the patchback/backports/stable-5/3da24d50cdadfd4aa383800f72ca6dab22ee93f2/pr-5914 branch January 29, 2023 17:37
@jpmens
Copy link
Contributor

jpmens commented Jan 29, 2023

shipit

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 new_contributor Help guide this first time contributor plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants