OpenDNSSEC-signer
1.3.16
|
#include "adapter/adapi.h"
#include "adapter/adapter.h"
#include "scheduler/schedule.h"
#include "scheduler/task.h"
#include "shared/allocator.h"
#include "shared/file.h"
#include "shared/hsm.h"
#include "shared/locks.h"
#include "shared/log.h"
#include "shared/status.h"
#include "shared/util.h"
#include "signer/backup.h"
#include "signer/nsec3params.h"
#include "signer/signconf.h"
#include "signer/zone.h"
#include "signer/zonedata.h"
#include <ldns/ldns.h>
Go to the source code of this file.
Functions | |
zone_type * | zone_create (char *name, ldns_rr_class klass) |
ods_status | zone_add_rr (zone_type *zone, ldns_rr *rr, int do_stats) |
ods_status | zone_del_rr (zone_type *zone, ldns_rr *rr, int do_stats) |
ods_status | zone_load_signconf (zone_type *zone, task_id *tbs) |
ods_status | zone_publish_dnskeys (zone_type *zone, int recover) |
ods_status | zone_prepare_nsec3 (zone_type *zone, int recover) |
ods_status | zone_backup (zone_type *zone) |
ods_status | zone_recover (zone_type *zone) |
void | zone_merge (zone_type *z1, zone_type *z2) |
ods_status | zone_prepare_keys (zone_type *zone) |
ods_status | zone_update_serial (zone_type *zone) |
ods_status | zone_print (FILE *fd, zone_type *zone) |
ods_status | zone_examine (zone_type *zone) |
void | zone_cleanup (zone_type *zone) |
ods_status zone_add_rr | ( | zone_type * | zone, |
ldns_rr * | rr, | ||
int | do_stats | ||
) |
Add RR.
Definition at line 144 of file zone.c.
References zone_struct::dname, domain_struct::dname, signconf_struct::dnskey_ttl, domain_add_rrset(), domain_create(), domain_lookup_rrset(), DOMAIN_STATUS_APEX, domain_struct::dstatus, duration2time(), zone_struct::name, ods_log_assert, ods_log_error(), ods_log_verbose(), ods_log_warning(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, rrset_add_rr(), rrset_create(), SE_SOA_RDATA_MINIMUM, zone_struct::signconf, signconf_struct::soa_min, signconf_struct::soa_ttl, stats_struct::sort_count, zone_struct::stats, zone_struct::zonedata, zonedata_add_domain(), and zonedata_lookup_domain().
Referenced by adapi_add_rr(), zone_prepare_nsec3(), and zone_publish_dnskeys().
ods_status zone_backup | ( | zone_type * | zone | ) |
Backup zone.
Backup zone
Backup task
Backup signconf
Backup NSEC3 parameters
Backup keylist
Backup domains and stuff
Done
Definition at line 709 of file zone.c.
References zonedata_struct::default_ttl, zonedata_struct::inbound_serial, zonedata_struct::internal_serial, keylist_backup(), signconf_struct::keys, zone_struct::klass, zone_struct::name, signconf_struct::nsec3_algo, signconf_struct::nsec3_iterations, signconf_struct::nsec3_optout, signconf_struct::nsec3_salt, zone_struct::nsec3params, nsec3params_backup(), ods_build_path(), ods_fclose(), ods_fopen(), ods_log_assert, ODS_STATUS_FOPEN_ERR, ODS_STATUS_OK, zonedata_struct::outbound_serial, nsec3params_struct::rr, zone_struct::signconf, signconf_backup(), zone_struct::task, task_backup(), zone_struct::zonedata, and zonedata_backup().
void zone_cleanup | ( | zone_type * | zone | ) |
Clean up zone.
Definition at line 1320 of file zone.c.
References adapter_cleanup(), zone_struct::adinbound, zone_struct::adoutbound, zone_struct::allocator, allocator_cleanup(), allocator_deallocate(), zone_struct::dname, lock_basic_destroy, zone_struct::name, zone_struct::notify_ns, zone_struct::nsec3params, nsec3params_cleanup(), zone_struct::policy_name, zone_struct::signconf, signconf_cleanup(), zone_struct::signconf_filename, zone_struct::stats, stats_cleanup(), zone_struct::zone_lock, zone_struct::zonedata, and zonedata_cleanup().
Referenced by engine_update_zones(), parse_zonelist_zones(), zone_create(), zonelist_add_zone(), and zonelist_lookup_zone_by_name().
zone_type* zone_create | ( | char * | name, |
ldns_rr_class | klass | ||
) |
Create a new zone.
Definition at line 61 of file zone.c.
References zone_struct::adinbound, zone_struct::adoutbound, zone_struct::allocator, allocator_alloc(), allocator_cleanup(), allocator_create(), allocator_strdup(), zone_struct::dname, zone_struct::fetch, zone_struct::just_added, zone_struct::just_updated, zone_struct::klass, lock_basic_init, zone_struct::name, zone_struct::notify_ns, zone_struct::nsec3params, ods_log_assert, ods_log_error(), zone_struct::policy_name, zone_struct::prepared, zone_struct::processed, zone_struct::signconf, signconf_create(), zone_struct::signconf_filename, zone_struct::stats, stats_create(), zone_struct::task, zone_struct::tobe_removed, zone_cleanup(), zone_struct::zone_lock, zone_struct::zone_locked, zone_struct::zonedata, and zonedata_create().
Referenced by parse_zonelist_zones(), and zonelist_lookup_zone_by_name().
ods_status zone_del_rr | ( | zone_type * | zone, |
ldns_rr * | rr, | ||
int | do_stats | ||
) |
Delete RR.
Definition at line 271 of file zone.c.
References domain_lookup_rrset(), ods_log_assert, ods_log_error(), ods_log_warning(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, rrset_del_rr(), stats_struct::sort_count, zone_struct::stats, zone_struct::zonedata, and zonedata_lookup_domain().
Referenced by adapi_del_rr().
ods_status zone_examine | ( | zone_type * | zone | ) |
Examine zone.
Definition at line 1305 of file zone.c.
References zone_struct::adinbound, zone_struct::dname, ODS_STATUS_ASSERT_ERR, adapter_struct::type, zone_struct::zonedata, and zonedata_examine().
Referenced by adfile_read().
ods_status zone_load_signconf | ( | zone_type * | zone, |
task_id * | tbs | ||
) |
Load signer configuration for zone.
Or NSEC -> NSEC3, or NSEC3 -> NSEC, or NSEC3 params changed. All NSEC(3)s become invalid.
Definition at line 371 of file zone.c.
References zonedata_struct::default_ttl, duration2time(), signconf_struct::last_modified, zone_struct::name, zone_struct::nsec3params, nsec3params_cleanup(), ods_log_assert, ods_log_debug(), ods_log_error(), ods_log_verbose(), ods_log_warning(), ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_INSECURE, ODS_STATUS_MALLOC_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, nsec3params_struct::rr, zone_struct::signconf, signconf_cleanup(), signconf_compare_denial(), signconf_compare_keys(), zone_struct::signconf_filename, signconf_log(), signconf_update(), signconf_struct::soa_min, TASK_NONE, TASK_NSECIFY, TASK_READ, TASK_SIGN, task_what2str(), time_datestamp(), zone_struct::zonedata, zonedata_cleanup_chain(), zonedata_init_denial(), zonedata_rollback(), and zonedata_wipe_denial().
Merge zones.
Definition at line 1095 of file zone.c.
References adapter_compare(), zone_struct::adinbound, zone_struct::adoutbound, zone_struct::just_updated, zone_struct::name, ods_log_error(), ods_strcmp(), zone_struct::policy_name, and zone_struct::signconf_filename.
ods_status zone_prepare_keys | ( | zone_type * | zone | ) |
Prepare keys for signing.
Definition at line 1164 of file zone.c.
References zone_struct::dname, key_struct::dnskey, keylist_struct::first_key, key_struct::hsmkey, signconf_struct::keys, lhsm_get_key(), zone_struct::name, key_struct::next, ods_log_assert, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_HSM_ERR, ODS_STATUS_OK, key_struct::params, zone_struct::signconf, and zone_struct::zonedata.
ods_status zone_prepare_nsec3 | ( | zone_type * | zone, |
int | recover | ||
) |
Prepare for NSEC3.
Always set bit 7 of the flags to zero, according to rfc5155 section 11
Definition at line 616 of file zone.c.
References nsec3params_struct::algorithm, zone_struct::dname, duration2time(), nsec3params_struct::iterations, zone_struct::klass, zone_struct::name, signconf_struct::nsec3_algo, signconf_struct::nsec3_iterations, signconf_struct::nsec3_optout, signconf_struct::nsec3_salt, signconf_struct::nsec3param_ttl, zone_struct::nsec3params, nsec3params_cleanup(), nsec3params_create(), signconf_struct::nsec_type, ods_log_assert, ods_log_debug(), ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_MALLOC_ERR, ODS_STATUS_OK, nsec3params_struct::rr, nsec3params_struct::salt_data, nsec3params_struct::salt_len, zone_struct::signconf, and zone_add_rr().
Referenced by zone_recover().
ods_status zone_print | ( | FILE * | fd, |
zone_type * | zone | ||
) |
Print zone.
Definition at line 1291 of file zone.c.
References ODS_STATUS_ASSERT_ERR, zone_struct::zonedata, and zonedata_print().
Referenced by adfile_write().
ods_status zone_publish_dnskeys | ( | zone_type * | zone, |
int | recover | ||
) |
Publish DNSKEYs.
Definition at line 510 of file zone.c.
References keylist_struct::count, zonedata_struct::default_ttl, zone_struct::dname, key_struct::dnskey, signconf_struct::dnskey_ttl, duration2time(), keylist_struct::first_key, signconf_struct::keys, zone_struct::klass, lhsm_get_key(), key_struct::locator, zone_struct::name, key_struct::next, ods_log_assert, ods_log_error(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_HSM_ERR, ODS_STATUS_OK, key_struct::publish, zone_struct::signconf, zone_add_rr(), zone_struct::zonedata, and zonedata_rollback().
Referenced by zone_recover().
ods_status zone_recover | ( | zone_type * | zone | ) |
Recover zone from backup.
The function zone_publish_dnskeys() uses hsm_create_context(). We don't have to check the hsm connection here, zone_recover() is part of engine_start() and is ran only once.
Definition at line 768 of file zone.c.
References adbackup_read(), signconf_struct::allocator, zone_struct::allocator, allocator_strdup(), signconf_struct::audit, backup_read_check_str(), backup_read_duration(), backup_read_int(), backup_read_rr_type(), backup_read_str(), backup_read_time_t(), backup_read_uint32_t(), zonedata_struct::default_ttl, zone_struct::dname, signconf_struct::dnskey_ttl, zonedata_struct::inbound_serial, zonedata_struct::initialized, zonedata_struct::internal_serial, key_recover(), keylist_create(), keylist_push(), signconf_struct::keys, zone_struct::klass, signconf_struct::last_modified, lock_basic_lock, lock_basic_unlock, LOCKED_STATS_ZONE_RECOVER, zone_struct::name, signconf_struct::nsec3_algo, signconf_struct::nsec3_iterations, signconf_struct::nsec3_optout, signconf_struct::nsec3_salt, zone_struct::nsec3params, nsec3params_cleanup(), nsec3params_create(), signconf_struct::nsec_type, ods_build_path(), ods_fclose(), ods_fopen(), ods_log_assert, ods_log_error(), ODS_STATUS_ERR, ODS_STATUS_OK, ODS_STATUS_UNCHANGED, ods_strcmp(), zonedata_struct::outbound_serial, zone_struct::prepared, nsec3params_struct::rr, signconf_struct::sig_inception_offset, signconf_struct::sig_jitter, signconf_struct::sig_refresh_interval, signconf_struct::sig_resign_interval, signconf_struct::sig_validity_default, signconf_struct::sig_validity_denial, zone_struct::signconf, signconf_cleanup(), signconf_create(), signconf_struct::soa_min, signconf_struct::soa_serial, signconf_struct::soa_ttl, zone_struct::stats, stats_clear(), stats_struct::stats_lock, stats_struct::stats_locked, zone_struct::task, task_cleanup(), task_create(), zone_prepare_nsec3(), zone_publish_dnskeys(), zone_struct::zonedata, zonedata_cleanup(), zonedata_commit(), zonedata_create(), zonedata_entize(), and zonedata_recover().
ods_status zone_update_serial | ( | zone_type * | zone | ) |
Update serial.
Definition at line 1207 of file zone.c.
References zone_struct::dname, domain_lookup_rrset(), zonedata_struct::internal_serial, zone_struct::name, rrset_struct::needs_signing, ods_log_assert, ods_log_error(), ods_status2str(), ODS_STATUS_ASSERT_ERR, ODS_STATUS_CONFLICT_ERR, ODS_STATUS_ERR, ODS_STATUS_OK, rrset_struct::rr_type, rrset_struct::rrs, SE_SOA_RDATA_SERIAL, zone_struct::signconf, zone_struct::zonedata, zonedata_lookup_domain(), and zonedata_update_serial().