OpenDNSSEC-signer 1.3.0
|
#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 |
Defines | |
#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 57 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 263 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 1217 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 1149 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 646 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_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 239 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 227 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 100 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 324 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 425 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, keylist_lookup_by_dnskey(), 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 207 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 1186 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.
Definition at line 1108 of file rrset.c.
References fifoq_push(), worker_struct::jobs_appointed, lock_basic_lock, lock_basic_unlock, ods_log_assert, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, fifoq_struct::q_lock, and worker_struct::worker_lock.
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 148 of file rrset.c.
References log_rr(), rrset_struct::needs_signing, ods_log_assert, ods_log_error(), 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 701 of file rrset.c.
References rrset_struct::add, rrset_struct::add_count, rrset_struct::del, and rrset_struct::del_count.
Referenced by domain_rollback(), and zone_prepare_nsec3().
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 signd |
[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 950 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, log_rr(), rrsigs_struct::next, key_struct::next, ods_log_assert, ods_log_deeebug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, 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, 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 388 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(), denial_nsecify3(), and zone_prepare_nsec3().