Skip to content

Give RSA/MD5 DNSKEYs from zone files their RFC key tag - #197

Merged
NelsonVides merged 1 commit into
mainfrom
zone-rsamd5-key-tag
Nov 16, 2026
Merged

NelsonVides merged 1 commit into
mainfrom
zone-rsamd5-key-tag

Conversation

@NelsonVides

Copy link
Copy Markdown
Contributor

RFC 4034 Appendix B.1, as erratum 193 corrects it, has the key tag of an algorithm 1 (RSA/MD5) key be the third- and second-to-last octets of its modulus, not the checksum the other algorithms take. The wire decoder gives that key tag, but the zone reader computed the checksum for every algorithm itself, so the same DNSKEY had another keytag read from a zone file than decoded from the wire.

The zone reader now takes the key tag from dns_dnskey:key_tag/1, as the wire decoder does, for DNSKEY and CDNSKEY alike, and its own checksum is gone.

Tests: keytag_rsamd5, which pins the key tags dnspython 2.9.1 gives three RSA/MD5 keys against the wire decoder and add_keytag_to_dnskey/1, reads the same keys from zone text too, as DNSKEY and CDNSKEY. With the old checksum it fails.

RFC 4034 Appendix B.1 has an algorithm 1 key tag be the third- and
second-to-last octets of the modulus. The wire decoder gives it so, but
the zone reader computed its own checksum for every algorithm.

It now takes the key tag from dns_dnskey:key_tag/1, as the wire decoder
does, and the test that pins dnspython's key tags reads the same keys
from zone text.
@NelsonVides NelsonVides added the bug Code defect or incorrect behavior label Nov 16, 2026
@NelsonVides NelsonVides self-assigned this Nov 16, 2026
@NelsonVides
NelsonVides merged commit b1300ae into main Nov 16, 2026
6 checks passed
@NelsonVides
NelsonVides deleted the zone-rsamd5-key-tag branch November 16, 2026 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Code defect or incorrect behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant