Skip to content

Commit

Permalink
Merge pull request #246 from tgreenx/cdnskey_calc_keytag
Browse files Browse the repository at this point in the history
Make ldns_calc_keytag() available for CDNSKEY RR
  • Loading branch information
wtoorop authored Aug 27, 2024
2 parents 46f2f00 + aeaf02e commit d6b2ca8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
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

0 comments on commit d6b2ca8

Please sign in to comment.