OpenDNSSEC-signer
1.3.14
|
#include "config.h"
#include "daemon/worker.h"
#include "scheduler/fifoq.h"
#include "shared/allocator.h"
#include "shared/hsm.h"
#include "shared/locks.h"
#include "shared/status.h"
#include "signer/keys.h"
#include "signer/rrsigs.h"
#include "signer/signconf.h"
#include "signer/stats.h"
#include <ldns/ldns.h>
Go to the source code of this file.
Data Structures | |
struct | rrset_struct |
Macros | |
#define | COUNT_RR 0 |
#define | COUNT_ADD 1 |
#define | COUNT_DEL 2 |
Typedefs | |
typedef struct rrset_struct | rrset_type |
Functions | |
rrset_type * | rrset_create (ldns_rr_type rrtype) |
ods_status | rrset_recover (rrset_type *rrset, ldns_rr *rrsig, const char *locator, uint32_t flags) |
size_t | rrset_count_rr (rrset_type *rrset, int which) |
size_t | rrset_count_RR (rrset_type *rrset) |
ldns_rr * | rrset_add_rr (rrset_type *rrset, ldns_rr *rr) |
ldns_rr * | rrset_del_rr (rrset_type *rrset, ldns_rr *rr, int dupallowed) |
ods_status | rrset_wipe_out (rrset_type *rrset) |
ods_status | rrset_diff (rrset_type *rrset, keylist_type *kl) |
ods_status | rrset_commit (rrset_type *rrset) |
void | rrset_rollback (rrset_type *rrset) |
ods_status | rrset_sign (hsm_ctx_t *ctx, rrset_type *rrset, ldns_rdf *owner, signconf_type *sc, time_t signtime, stats_type *stats) |
ods_status | rrset_queue (rrset_type *rrset, fifoq_type *q, worker_type *worker) |
int | rrset_examine_ns_rdata (rrset_type *rrset, ldns_rdf *nsdname) |
void | rrset_cleanup (rrset_type *rrset) |
void | log_rr (ldns_rr *rr, const char *pre, int level) |
void | rrset_print (FILE *fd, rrset_type *rrset, int skip_rrsigs) |
void | rrset_backup (FILE *fd, rrset_type *rrset) |
#define COUNT_ADD 1 |
Definition at line 52 of file rrset.h.
Referenced by domain_commit(), and rrset_count_rr().
#define COUNT_DEL 2 |
Definition at line 53 of file rrset.h.
Referenced by domain_commit(), and rrset_count_rr().
#define COUNT_RR 0 |
RRset.
Definition at line 51 of file rrset.h.
Referenced by domain_commit(), domain_count_rrset(), and rrset_count_rr().
typedef struct rrset_struct rrset_type |
void log_rr | ( | ldns_rr * | rr, |
const char * | pre, | ||
int | level | ||
) |
Log RR.
[in] | rr | RR |
[in] | pre | string to log before RR |
[in] | level | log level |
Log RR.
Definition at line 58 of file rrset.c.
References ods_log_debug(), ods_log_deeebug(), ods_log_error(), ods_log_get_level(), ods_log_info(), ods_log_verbose(), and ods_log_warning().
Referenced by domain_examine_rrset_is_alone(), rrset_add_rr(), rrset_del_rr(), rrset_recover(), and rrset_sign().
ldns_rr* rrset_add_rr | ( | rrset_type * | rrset, |
ldns_rr * | rr | ||
) |
Add RR to RRset.
[in] | rrset | RRset |
[in] | rr | RR |
Add RR to RRset.
Definition at line 265 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, log_rr(), ods_log_assert, ods_log_error(), ods_log_warning(), rrset_struct::rr_type, and util_dnssec_rrs_add_rr().
Referenced by denial_nsecify(), denial_nsecify3(), domain_recover(), and zone_add_rr().
void rrset_backup | ( | FILE * | fd, |
rrset_type * | rrset | ||
) |
Backup RRset.
[in] | fd | file descriptor |
[in] | rrset | RRset |
Backup RRset.
Definition at line 1255 of file rrset.c.
References rrset_struct::rrsigs, and rrsigs_print().
Referenced by domain_backup().
void rrset_cleanup | ( | rrset_type * | rrset) |
Clean up RRset.
[in] | rrset | RRset to be cleaned up |
Clean up RRset.
Definition at line 1187 of file rrset.c.
References rrset_struct::add, rrset_struct::allocator, allocator_cleanup(), allocator_deallocate(), rrset_struct::del, rrset_struct::rrs, rrset_struct::rrsigs, and rrsigs_cleanup().
Referenced by denial_cleanup(), domain_del_rrset(), and zonedata_wipe_denial().
ods_status rrset_commit | ( | rrset_type * | rrset) |
Commit updates from RRset.
[in] | rrset | RRset |
Commit updates from RRset.
Definition at line 653 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, rrset_struct::del, rrset_struct::del_count, rrset_struct::needs_signing, ods_log_alert(), ods_log_assert, ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, and rrset_struct::rr_type.
Referenced by denial_nsecify(), denial_nsecify3(), domain_commit(), and domain_recover().
size_t rrset_count_rr | ( | rrset_type * | rrset, |
int | which | ||
) |
Count the number of RRs in this RRset.
[in] | rrset | RRset |
[in] | which | which RRset to be counted |
Count the number of RRs in this RRset.
Definition at line 241 of file rrset.c.
References rrset_struct::add_count, COUNT_ADD, COUNT_DEL, COUNT_RR, rrset_struct::del_count, and rrset_struct::rr_count.
Referenced by domain_commit(), and domain_count_rrset().
size_t rrset_count_RR | ( | rrset_type * | rrset) |
Return the number of RRs in RRset after an update.
[in] | rrset | RRset |
Return the number of RRs in RRset after an update.
Definition at line 229 of file rrset.c.
References rrset_struct::add_count, rrset_struct::del_count, ods_log_assert, and rrset_struct::rr_count.
Referenced by domain_examine_data_exists(), domain_examine_rrset_is_alone(), domain_examine_rrset_is_singleton(), and domain_examine_valid_zonecut().
rrset_type* rrset_create | ( | ldns_rr_type | rrtype) |
Create new RRset.
[in] | rrtype | RRtype |
Create new RRset.
Definition at line 101 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, rrset_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), rrset_struct::del, rrset_struct::del_count, rrset_struct::needs_signing, ods_log_assert, ods_log_error(), rrset_struct::rr_count, rrset_struct::rr_type, rrset_struct::rrs, rrset_struct::rrsig_count, and rrset_struct::rrsigs.
Referenced by denial_nsecify(), denial_nsecify3(), domain_recover(), and zone_add_rr().
ldns_rr* rrset_del_rr | ( | rrset_type * | rrset, |
ldns_rr * | rr, | ||
int | dupallowed | ||
) |
Delete RR from RRset.
[in] | rrset | RRset |
[in] | rr | RR |
[in] | dupallowed | if true, allow duplicate deletions |
Delete RR from RRset.
Definition at line 326 of file rrset.c.
References rrset_struct::del, rrset_struct::del_count, log_rr(), ods_log_assert, ods_log_error(), ods_log_warning(), rrset_struct::rr_type, and util_dnssec_rrs_add_rr().
Referenced by rrset_diff(), rrset_wipe_out(), and zone_del_rr().
ods_status rrset_diff | ( | rrset_type * | rrset, |
keylist_type * | kl | ||
) |
Calculate differences between the current RRset and the pending new one.
[in] | rrset | RRset |
[in] | kl | current key list |
Calculate differences between the current RRset and the pending new one.
Definition at line 427 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, keylist_lookup_by_dnskey(), rrset_struct::needs_signing, ods_log_assert, ods_log_error(), ODS_STATUS_ERR, ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, rrset_del_rr(), and util_dnssec_rrs_compare().
Referenced by domain_diff().
int rrset_examine_ns_rdata | ( | rrset_type * | rrset, |
ldns_rdf * | nsdname | ||
) |
Examine NS RRset and verify its RDATA.
[in] | rrset | NS RRset |
[in] | nsdname | domain name that should match NS RDATA |
Examine NS RRset and verify its RDATA.
Definition at line 209 of file rrset.c.
References rrset_struct::add, rrset_struct::del, rrset_struct::rr_type, and rrset_struct::rrs.
Referenced by domain_examine_ns_rdata().
void rrset_print | ( | FILE * | fd, |
rrset_type * | rrset, | ||
int | skip_rrsigs | ||
) |
Print RRset.
[in] | fd | file descriptor |
[in] | rrset | RRset to be printed |
[in] | skip_rrsigs | if true, don't print RRSIG records |
Print RRset.
Definition at line 1224 of file rrset.c.
References ods_log_assert, rrset_struct::rr_type, rrset_struct::rrs, rrset_struct::rrsigs, and rrsigs_print().
Referenced by domain_backup(), and domain_print().
ods_status rrset_queue | ( | rrset_type * | rrset, |
fifoq_type * | q, | ||
worker_type * | worker | ||
) |
Queue RRset.
[in] | rrset | RRset |
[in] | q | queue |
[in] | worker | owner of RRset |
Queue RRset.
Apparently the queue is full. Lets take a small break to not hog CPU. The worker will release the signq lock while sleeping and will automatically grab the lock when the queue is nonfull. Queue is nonfull at 10% of the queue size.
Definition at line 1130 of file rrset.c.
References fifoq_push(), worker_struct::jobs_appointed, lock_basic_lock, lock_basic_sleep, lock_basic_unlock, LOCKED_Q_WORKER, LOCKED_WORKER_RRSET, worker_struct::need_to_exit, ods_log_assert, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, fifoq_struct::q_lock, fifoq_struct::q_locked, fifoq_struct::q_nonfull, worker_struct::thread_num, worker_struct::worker_lock, and worker_struct::worker_locked.
Referenced by domain_queue().
ods_status rrset_recover | ( | rrset_type * | rrset, |
ldns_rr * | rrsig, | ||
const char * | locator, | ||
uint32_t | flags | ||
) |
Recover RRSIG from backup.
[in] | rrset | RRset |
[in] | rrsig | RRSIG |
[in] | locator | key locator |
[in] | flags | key flags |
Recover RRSIG from backup.
This RRset was recovered, no need for signing. If the signature is about to expire, the recycle logic will catch that.
Definition at line 149 of file rrset.c.
References log_rr(), rrset_struct::needs_signing, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrsigs_add_sig(), and rrsigs_create().
Referenced by domain_recover().
void rrset_rollback | ( | rrset_type * | rrset) |
Rollback updates from RRset.
[in] | rrset | RRset |
Rollback updates from RRset.
Definition at line 708 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, rrset_struct::del, and rrset_struct::del_count.
Referenced by domain_rollback().
ods_status rrset_sign | ( | hsm_ctx_t * | ctx, |
rrset_type * | rrset, | ||
ldns_rdf * | owner, | ||
signconf_type * | sc, | ||
time_t | signtime, | ||
stats_type * | stats | ||
) |
Sign RRset.
[in] | ctx | HSM context |
[in] | rrset | RRset |
[in] | owner | owner of the zone |
[in] | sc | signer configuration |
[in] | signtime | time when the zone is being signed |
[out] | stats | update statistics |
Sign RRset.
currently, there is no rule that the number of signatures over this RRset equals the number of active keys.
Definition at line 957 of file rrset.c.
References key_struct::algorithm, keylist_struct::first_key, key_struct::flags, rrsigs_struct::key_flags, rrsigs_struct::key_locator, signconf_struct::keys, key_struct::ksk, lhsm_sign(), key_struct::locator, lock_basic_lock, lock_basic_unlock, LOCKED_STATS_RRSET_SIGN, log_rr(), rrsigs_struct::next, key_struct::next, ods_log_assert, ods_log_deeebug(), ods_log_error(), ods_log_warning(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, rrsigs_struct::rr, rrset_struct::rr_type, rrset_struct::rrsig_count, rrset_struct::rrsigs, rrsigs_add_sig(), rrsigs_cleanup(), rrsigs_create(), stats_struct::sig_count, stats_struct::sig_reuse, stats_struct::sig_soa_count, stats_struct::stats_lock, stats_struct::stats_locked, and key_struct::zsk.
ods_status rrset_wipe_out | ( | rrset_type * | rrset) |
Wipe out current RRs in RRset.
[in] | rrset | RRset |
Wipe out current RRs in RRset.
Definition at line 390 of file rrset.c.
References ods_log_error(), ODS_STATUS_ERR, ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, and rrset_del_rr().
Referenced by denial_nsecify(), and denial_nsecify3().