This file contains functions for dealing with validator key entries. More...
Data Structures | |
struct | key_entry_key |
A key entry for the validator. More... | |
struct | key_entry_data |
Key entry for the validator. More... | |
Functions | |
size_t | key_entry_sizefunc (void *key, void *data) |
function for lruhash operation | |
int | key_entry_compfunc (void *k1, void *k2) |
function for lruhash operation | |
void | key_entry_delkeyfunc (void *key, void *userarg) |
function for lruhash operation | |
void | key_entry_deldatafunc (void *data, void *userarg) |
function for lruhash operation | |
void | key_entry_hash (struct key_entry_key *kk) |
calculate hash for key entry More... | |
struct key_entry_key * | key_entry_copy_toregion (struct key_entry_key *kkey, struct regional *region) |
Copy a key entry, to be region-allocated. More... | |
struct key_entry_key * | key_entry_copy (struct key_entry_key *kkey, int copy_reason) |
Copy a key entry, malloced. More... | |
int | key_entry_isnull (struct key_entry_key *kkey) |
See if this is a null entry. More... | |
int | key_entry_isgood (struct key_entry_key *kkey) |
See if this entry is good. More... | |
int | key_entry_isbad (struct key_entry_key *kkey) |
See if this entry is bad. More... | |
char * | key_entry_get_reason (struct key_entry_key *kkey) |
Get reason why a key is bad. More... | |
sldns_ede_code | key_entry_get_reason_bogus (struct key_entry_key *kkey) |
Get the EDE (RFC8914) code why a key is bad. More... | |
struct key_entry_key * | key_entry_create_null (struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, sldns_ede_code reason_bogus, const char *reason, time_t now) |
Create a null entry, in the given region. More... | |
struct key_entry_key * | key_entry_create_rrset (struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, struct ub_packed_rrset_key *rrset, uint8_t *sigalg, sldns_ede_code reason_bogus, const char *reason, time_t now) |
Create a key entry from an rrset, in the given region. More... | |
struct key_entry_key * | key_entry_create_bad (struct regional *region, uint8_t *name, size_t namelen, uint16_t dclass, time_t ttl, sldns_ede_code reason_bogus, const char *reason, time_t now) |
Create a bad entry, in the given region. More... | |
struct ub_packed_rrset_key * | key_entry_get_rrset (struct key_entry_key *kkey, struct regional *region) |
Obtain rrset from a key entry, allocated in region. More... | |
size_t | key_entry_keysize (struct key_entry_key *kkey) |
Get keysize of the keyentry. More... | |
This file contains functions for dealing with validator key entries.
void key_entry_hash | ( | struct key_entry_key * | kk | ) |
calculate hash for key entry
kk | key entry. The lruhash entry.hash value is filled in. |
References dname_query_hash(), key_entry_key::entry, lruhash_entry::hash, hashlittle(), key_entry_key::key_class, and key_entry_key::name.
Referenced by key_cache_insert(), key_cache_remove(), and key_cache_search().
struct key_entry_key* key_entry_copy_toregion | ( | struct key_entry_key * | kkey, |
struct regional * | region | ||
) |
Copy a key entry, to be region-allocated.
kkey | the key entry key (and data pointer) to copy. |
region | where to allocate it |
References key_entry_data::algo, lruhash_entry::data, key_entry_key::entry, lruhash_entry::key, key_entry_key::name, key_entry_key::namelen, packed_rrset_ptr_fixup(), packed_rrset_sizeof(), key_entry_data::reason, regional_alloc_init(), regional_strdup(), and key_entry_data::rrset_data.
Referenced by key_cache_obtain().
struct key_entry_key* key_entry_copy | ( | struct key_entry_key * | kkey, |
int | copy_reason | ||
) |
Copy a key entry, malloced.
kkey | the key entry key (and data pointer) to copy. |
copy_reason | if the reason string needs to be copied (allocated). |
References key_entry_data::algo, lruhash_entry::data, key_entry_key::entry, lruhash_entry::key, lruhash_entry::lock, memdup(), key_entry_key::name, key_entry_key::namelen, packed_rrset_ptr_fixup(), packed_rrset_sizeof(), key_entry_data::reason, and key_entry_data::rrset_data.
Referenced by key_cache_insert().
int key_entry_isnull | ( | struct key_entry_key * | kkey | ) |
See if this is a null entry.
Does not do locking.
kkey | must have data pointer set correctly |
References lruhash_entry::data, key_entry_key::entry, key_entry_data::isbad, and key_entry_data::rrset_data.
Referenced by iter_indicates_dnssec(), processFindKey(), and processValidate().
int key_entry_isgood | ( | struct key_entry_key * | kkey | ) |
See if this entry is good.
Does not do locking.
kkey | must have data pointer set correctly |
References lruhash_entry::data, key_entry_key::entry, key_entry_data::isbad, and key_entry_data::rrset_data.
Referenced by iter_indicates_dnssec(), key_entry_keysize(), and process_ds_response().
int key_entry_isbad | ( | struct key_entry_key * | kkey | ) |
See if this entry is bad.
Does not do locking.
kkey | must have data pointer set correctly |
References lruhash_entry::data, key_entry_key::entry, and key_entry_data::isbad.
Referenced by iter_indicates_dnssec(), process_ds_response(), processFindKey(), and processValidate().
char* key_entry_get_reason | ( | struct key_entry_key * | kkey | ) |
Get reason why a key is bad.
kkey | bad key |
References lruhash_entry::data, key_entry_key::entry, and key_entry_data::reason.
sldns_ede_code key_entry_get_reason_bogus | ( | struct key_entry_key * | kkey | ) |
Get the EDE (RFC8914) code why a key is bad.
Can return LDNS_EDE_NONE.
kkey | bad key |
References lruhash_entry::data, key_entry_key::entry, and key_entry_data::reason_bogus.
struct key_entry_key* key_entry_create_null | ( | struct regional * | region, |
uint8_t * | name, | ||
size_t | namelen, | ||
uint16_t | dclass, | ||
time_t | ttl, | ||
sldns_ede_code | reason_bogus, | ||
const char * | reason, | ||
time_t | now | ||
) |
Create a null entry, in the given region.
region | where to allocate |
name | the key name |
namelen | length of name |
dclass | class of key entry. (host order); |
ttl | what ttl should the key have. relative. |
reason_bogus | accompanying EDE code. |
reason | accompanying NULL-terminated EDE string (or NULL). |
now | current time (added to ttl). |
References key_entry_data::isbad, key_entry_setup(), key_entry_data::reason, key_entry_data::reason_bogus, regional_strdup(), key_entry_data::rrset_type, and key_entry_data::ttl.
struct key_entry_key* key_entry_create_rrset | ( | struct regional * | region, |
uint8_t * | name, | ||
size_t | namelen, | ||
uint16_t | dclass, | ||
struct ub_packed_rrset_key * | rrset, | ||
uint8_t * | sigalg, | ||
sldns_ede_code | reason_bogus, | ||
const char * | reason, | ||
time_t | now | ||
) |
Create a key entry from an rrset, in the given region.
region | where to allocate. |
name | the key name |
namelen | length of name |
dclass | class of key entry. (host order); |
rrset | data for key entry. This is copied to the region. |
sigalg | signalled algorithm list (or NULL). |
reason_bogus | accompanying EDE code (usually LDNS_EDE_NONE). |
reason | accompanying NULL-terminated EDE string (or NULL). |
now | current time (added to ttl of rrset) |
References key_entry_data::algo, lruhash_entry::data, ub_packed_rrset_key::entry, key_entry_data::isbad, key_entry_setup(), packed_rrset_ptr_fixup(), packed_rrset_sizeof(), key_entry_data::reason, key_entry_data::reason_bogus, regional_alloc_init(), regional_strdup(), ub_packed_rrset_key::rk, key_entry_data::rrset_data, key_entry_data::rrset_type, packed_rrset_data::ttl, key_entry_data::ttl, and packed_rrset_key::type.
Referenced by val_verify_DNSKEY_with_TA(), and val_verify_new_DNSKEYs_with_ta().
struct key_entry_key* key_entry_create_bad | ( | struct regional * | region, |
uint8_t * | name, | ||
size_t | namelen, | ||
uint16_t | dclass, | ||
time_t | ttl, | ||
sldns_ede_code | reason_bogus, | ||
const char * | reason, | ||
time_t | now | ||
) |
Create a bad entry, in the given region.
region | where to allocate |
name | the key name |
namelen | length of name |
dclass | class of key entry. (host order); |
ttl | what ttl should the key have. relative. |
reason_bogus | accompanying EDE code. |
reason | accompanying NULL-terminated EDE string (or NULL). |
now | current time (added to ttl). |
References key_entry_data::isbad, key_entry_setup(), key_entry_data::reason, key_entry_data::reason_bogus, regional_strdup(), key_entry_data::rrset_type, and key_entry_data::ttl.
struct ub_packed_rrset_key* key_entry_get_rrset | ( | struct key_entry_key * | kkey, |
struct regional * | region | ||
) |
Obtain rrset from a key entry, allocated in region.
kkey | key entry to convert to a rrset. |
region | where to allocate rrset |
References lruhash_entry::data, key_entry_key::entry, key_entry_key::key_class, key_entry_key::name, key_entry_key::namelen, packed_rrset_ptr_fixup(), packed_rrset_sizeof(), regional_alloc(), regional_alloc_init(), key_entry_data::rrset_data, and key_entry_data::rrset_type.
Referenced by process_ds_response().
size_t key_entry_keysize | ( | struct key_entry_key * | kkey | ) |
Get keysize of the keyentry.
kkey | key, must be a good key, with contents. |
References packed_rrset_data::count, lruhash_entry::data, DNSKEY_BIT_ZSK, dnskey_get_keysize(), key_entry_key::entry, kd_get_flags(), and key_entry_isgood().
Referenced by nsec3_iteration_count_high().