This file contains storage for the trust anchors for the validator. More...
Data Structures | |
| struct | val_anchors |
| Trust anchor store. More... | |
| struct | ta_key |
| Trust anchor key. More... | |
| struct | trust_anchor |
| A trust anchor in the trust anchor store. More... | |
Functions | |
| struct val_anchors * | anchors_create (void) |
| Create trust anchor storage. | |
| void | anchors_delete (struct val_anchors *anchors) |
| Delete trust anchor storage. | |
| int | anchors_apply_cfg (struct val_anchors *anchors, struct config_file *cfg) |
| Process trust anchor config. | |
| void | anchors_init_parents_locked (struct val_anchors *anchors) |
| Recalculate parent pointers. | |
| struct trust_anchor * | anchors_lookup (struct val_anchors *anchors, uint8_t *qname, size_t qname_len, uint16_t qclass) |
| Given a qname/qclass combination, find the trust anchor closest above it. | |
| struct trust_anchor * | anchor_find (struct val_anchors *anchors, uint8_t *name, int namelabs, size_t namelen, uint16_t dclass) |
| Find a trust anchor. | |
| struct trust_anchor * | anchor_store_str (struct val_anchors *anchors, ldns_buffer *buffer, const char *str) |
| Store one string as trust anchor RR. | |
| size_t | anchors_get_mem (struct val_anchors *anchors) |
| Get memory in use by the trust anchor storage. | |
| int | anchor_cmp (const void *k1, const void *k2) |
| compare two trust anchors | |
This file contains storage for the trust anchors for the validator.
| struct val_anchors* anchors_create | ( | void | ) | [read] |
Create trust anchor storage.
References val_anchors::region, regional_create(), val_anchors::tree, rbtree_create(), anchor_cmp(), anchors_delete(), val_anchors::autr, autr_global_create(), and val_anchors::lock.
Referenced by anchors_test(), and val_apply_cfg().
| void anchors_delete | ( | struct val_anchors * | anchors | ) |
Delete trust anchor storage.
| anchors,: | to delete. |
References val_anchors::lock, val_anchors::autr, traverse_postorder(), val_anchors::tree, anchors_delfunc(), regional_destroy(), val_anchors::region, and autr_global_delete().
Referenced by anchors_test(), anchors_create(), and val_deinit().
| int anchors_apply_cfg | ( | struct val_anchors * | anchors, |
| struct config_file * | cfg | ||
| ) |
Process trust anchor config.
| anchors,: | struct anchor storage |
| cfg,: | config options. |
References config_file::domain_insecure, config_strlist::next, config_strlist::str, anchor_insert_insecure(), log_err(), config_file::trust_anchor_file_list, config_file::chrootdir, anchor_read_file(), config_file::trusted_keys_file_list, anchor_read_bind_file_wild(), config_file::trust_anchor_list, anchor_store_str(), config_file::dlv_anchor_file, val_anchors::lock, val_anchors::dlv_anchor, config_file::dlv_anchor_list, config_file::auto_trust_anchor_file_list, autr_read_file(), anchors_assemble_rrsets(), init_parents(), verbosity, VERB_ALGO, and autr_debug_print().
Referenced by val_apply_cfg().
| void anchors_init_parents_locked | ( | struct val_anchors * | anchors | ) |
Recalculate parent pointers.
The caller must hold the lock on the anchors structure (say after removing an item from the rbtree). Caller must not hold any locks on trust anchors. After the call is complete the parent pointers are updated and an item just removed is no longer referenced in parent pointers.
| anchors,: | the structure to update. |
References trust_anchor::node, RBTREE_FOR, val_anchors::tree, trust_anchor::lock, trust_anchor::parent, trust_anchor::dclass, dname_lab_cmp(), trust_anchor::name, and trust_anchor::namelabs.
Referenced by autr_tp_remove(), and init_parents().
| struct trust_anchor* anchors_lookup | ( | struct val_anchors * | anchors, |
| uint8_t * | qname, | ||
| size_t | qname_len, | ||
| uint16_t | qclass | ||
| ) | [read] |
Given a qname/qclass combination, find the trust anchor closest above it.
Or return NULL if none exists.
| anchors,: | struct anchor storage |
| qname,: | query name, uncompressed wireformat. |
| qname_len,: | length of qname. |
| qclass,: | class to query for. |
References trust_anchor::node, rbnode_t::key, trust_anchor::name, trust_anchor::namelabs, dname_count_labels(), trust_anchor::namelen, trust_anchor::dclass, val_anchors::lock, rbtree_find_less_equal(), val_anchors::tree, dname_lab_cmp(), trust_anchor::parent, and trust_anchor::lock.
Referenced by test_anchor_empty(), test_anchor_one(), test_anchors(), check_no_anchor(), and processInit().
| struct trust_anchor* anchor_find | ( | struct val_anchors * | anchors, |
| uint8_t * | name, | ||
| int | namelabs, | ||
| size_t | namelen, | ||
| uint16_t | dclass | ||
| ) | [read] |
Find a trust anchor.
Exact matching.
| anchors,: | anchor storage. |
| name,: | name of trust anchor (wireformat) |
| namelabs,: | labels in name |
| namelen,: | length of name |
| dclass,: | class of trust anchor |
References trust_anchor::node, rbnode_t::key, trust_anchor::name, trust_anchor::namelabs, trust_anchor::namelen, trust_anchor::dclass, val_anchors::lock, rbtree_search(), and val_anchors::tree.
Referenced by iter_indicates_dnssec(), find_add_tp(), anchor_store_new_key(), and process_prime_response().
| struct trust_anchor* anchor_store_str | ( | struct val_anchors * | anchors, |
| ldns_buffer * | buffer, | ||
| const char * | str | ||
| ) | [read] |
Store one string as trust anchor RR.
| anchors,: | anchor storage. |
| buffer,: | parsing buffer, to generate the RR wireformat in. |
| str,: | string. |
References log_err(), and anchor_store_new_rr().
Referenced by test_anchor_one(), test_anchors(), process_bind_contents(), and anchors_apply_cfg().
| size_t anchors_get_mem | ( | struct val_anchors * | anchors | ) |
Get memory in use by the trust anchor storage.
| anchors,: | anchor storage. |
References regional_get_mem(), and val_anchors::region.
Referenced by val_get_mem().