mirror of
https://gitlab.nic.cz/knot/knot-dns.git
synced 2026-05-28 04:02:31 -04:00
RDATA lowercase: Removed unnecessary conversions
This commit is contained in:
parent
1761a1343d
commit
2a3ebbbbdf
3 changed files with 3 additions and 22 deletions
|
|
@ -384,7 +384,6 @@ static int connect_nsec3_nodes(zone_node_t *a, zone_node_t *b,
|
|||
|
||||
assert(raw_length == knot_nsec3_hash_length(algorithm));
|
||||
|
||||
knot_dname_to_lower(b->owner);
|
||||
uint8_t *b32_hash = (uint8_t *)knot_dname_to_str(b->owner);
|
||||
size_t b32_length = knot_nsec3_hash_b32_length(algorithm);
|
||||
if (!b32_hash) {
|
||||
|
|
|
|||
|
|
@ -602,10 +602,6 @@ static int insert_rr(zone_contents_t *z,
|
|||
return KNOT_EINVAL;
|
||||
}
|
||||
|
||||
/* TODO [lowercase]: Here we would need the RR to be in lowercase, at least
|
||||
* the owner.
|
||||
*/
|
||||
|
||||
// check if the RRSet belongs to the zone
|
||||
if (!knot_dname_is_sub(rr->owner, z->apex->owner) &&
|
||||
!knot_dname_is_equal(rr->owner, z->apex->owner)) {
|
||||
|
|
|
|||
|
|
@ -346,7 +346,6 @@ static int check_rrsig_rdata(err_handler_t *handler,
|
|||
|
||||
/* signer's name is same as in the zone apex */
|
||||
knot_dname_t *signer = knot_dname_copy(knot_rrsig_signer_name(rrsig, rr_pos), NULL);
|
||||
knot_dname_to_lower(signer);
|
||||
|
||||
/* dnskey is in the apex node */
|
||||
if (!knot_rrset_empty(dnskey_rrset) &&
|
||||
|
|
@ -939,25 +938,18 @@ static int semantic_checks_dnssec(zone_contents_t *zone,
|
|||
*/
|
||||
const knot_dname_t *next_domain =
|
||||
knot_nsec_next(nsec_rrs);
|
||||
// Convert name to lowercase for trie lookup
|
||||
knot_dname_t *lowercase = knot_dname_copy(next_domain, NULL);
|
||||
if (lowercase == NULL) {
|
||||
return KNOT_ENOMEM;
|
||||
}
|
||||
knot_dname_to_lower(lowercase);
|
||||
|
||||
if (zone_contents_find_node(zone, lowercase) == NULL) {
|
||||
if (zone_contents_find_node(zone, next_domain) == NULL) {
|
||||
err_handler_handle_error(handler, zone, node,
|
||||
ZC_ERR_NSEC_RDATA_CHAIN,
|
||||
NULL);
|
||||
}
|
||||
|
||||
if (knot_dname_is_equal(lowercase, zone->apex->owner)) {
|
||||
if (knot_dname_is_equal(next_domain, zone->apex->owner)) {
|
||||
/* saving the last node */
|
||||
*last_node = node;
|
||||
|
||||
}
|
||||
knot_dname_free(&lowercase, NULL);
|
||||
} else if (nsec3 && (auth || deleg)) { /* nsec3 */
|
||||
int ret = check_nsec3_node_in_zone(zone, node,
|
||||
handler);
|
||||
|
|
@ -1112,17 +1104,11 @@ void log_cyclic_errors_in_zone(err_handler_t *handler,
|
|||
|
||||
const knot_dname_t *next_dname = knot_nsec_next(nsec_rrs);
|
||||
assert(next_dname);
|
||||
knot_dname_t *lowercase = knot_dname_copy(next_dname, NULL);
|
||||
if (lowercase == NULL) {
|
||||
return;
|
||||
}
|
||||
knot_dname_to_lower(lowercase);
|
||||
|
||||
if (knot_dname_cmp(lowercase, zone->apex->owner) != 0) {
|
||||
if (knot_dname_cmp(next_dname, zone->apex->owner) != 0) {
|
||||
err_handler_handle_error(handler, zone, last_node,
|
||||
ZC_ERR_NSEC_RDATA_CHAIN_NOT_CYCLIC, NULL);
|
||||
}
|
||||
knot_dname_free(&lowercase, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue