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

Make ldns_calc_keytag() available for CDNSKEY RR #246

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions dnssec.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ ldns_calc_keytag(const ldns_rr *key)
}

if (ldns_rr_get_type(key) != LDNS_RR_TYPE_DNSKEY &&
ldns_rr_get_type(key) != LDNS_RR_TYPE_CDNSKEY &&
ldns_rr_get_type(key) != LDNS_RR_TYPE_KEY
) {
return 0;
Expand Down
6 changes: 6 additions & 0 deletions test/12-unit-tests-dnssec.tpkg/12-unit-tests-dnssec.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ check_ldns_calc_keytag(void)
result = LDNS_STATUS_ERR;
}

key_str = "jelte.nlnetlabs.nl. IN CDNSKEY 256 3 5 AQOraLfzarHAlFskVGwAGnX0LRjlcOiO6y5WM4Kz+QvZ9vX28h4lOvnf d5tkxnZm7ERLTAJoFq+1w/wl7VXs2Isz75BSZ7LQh3OT2xXnS6VT5ZxX ko/UCOdoGiKZZ63jHZ0jNSTCYy8+5rfvwRD8s3gGuErp5KcHg3V8VLUK SDNNEQ==";
expected_keytag = 42860;
if (check_ldns_calc_keytag_part(key_str, expected_keytag) != LDNS_STATUS_OK) {
result = LDNS_STATUS_ERR;
}

/* template for adding extra keys
key_str = "";
expected_keytag = ;
Expand Down
Loading