OpenDNSSEC-enforcer
1.4.5
|
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "ksm/database.h"
#include "ksm/database_statement.h"
#include "ksm/datetime.h"
#include "ksm/db_fields.h"
#include "ksm/debug.h"
#include "ksm/ksmdef.h"
#include "ksm/kmedef.h"
#include "ksm/ksm.h"
#include "ksm/ksm_internal.h"
#include "ksm/message.h"
#include "ksm/string_util.h"
Go to the source code of this file.
Functions | |
int | KsmPolicyInit (DB_RESULT *result, const char *name) |
int | KsmPolicyParametersInit (DB_RESULT *result, const char *name) |
int | KsmPolicyExists (const char *name) |
int | KsmPolicy (DB_RESULT result, KSM_POLICY *data) |
int | KsmPolicyRead (KSM_POLICY *policy) |
int | KsmPolicyParameter (DB_RESULT result, KSM_POLICY_PARAMETER *data) |
int | KsmPolicyReadFromId (KSM_POLICY *policy) |
int | KsmPolicyNameFromId (KSM_POLICY *policy) |
int | KsmPolicyUpdateSalt (KSM_POLICY *policy) |
int | KsmPolicyNullSaltStamp (int policy_id) |
int | KsmPolicyPopulateSMFromIds (KSM_POLICY *policy) |
int | KsmPolicySetIdFromName (KSM_POLICY *policy) |
int | KsmPolicyIdFromZoneId (int zone_id, int *policy_id) |
int | KsmPolicyUpdateDesc (int policy_id, const char *policy_description) |
KSM_POLICY * | KsmPolicyAlloc () |
void | KsmPolicyFree (KSM_POLICY *policy) |
int KsmPolicy | ( | DB_RESULT | result, |
KSM_POLICY * | data | ||
) |
Definition at line 189 of file ksm_policy.c.
References DB_POLICY_ID, DB_POLICY_NAME, DbErrmsg(), DbFetchRow(), DbFreeRow(), DbHandle(), DbInt(), DbStringBuffer(), KSM_POLICY::id, KSM_INVARG, KSM_NAME_LENGTH, KSM_SQLFAIL, MsgLog(), and KSM_POLICY::name.
Referenced by cmd_exportpolicy(), cmd_purgepolicy(), and server_main().
KSM_POLICY* KsmPolicyAlloc | ( | ) |
Definition at line 953 of file ksm_policy.c.
References KSM_POLICY::denial, KSM_POLICY::description, KSM_POLICY::enforcer, KSM_POLICY::keys, KSM_POLICY::ksk, KSM_POLICY_DESC_LENGTH, KsmPolicyFree(), KSM_POLICY::parent, KSM_POLICY::signature, KSM_POLICY::signer, KSM_POLICY::zone, and KSM_POLICY::zsk.
Referenced by cmd_genkeys(), cmd_purgepolicy(), LinkKeys(), server_main(), and update_policies().
int KsmPolicyExists | ( | const char * | name | ) |
Definition at line 149 of file ksm_policy.c.
References DbErrmsg(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), KSM_SQLFAIL, KsmPolicyInit(), and MsgLog().
Referenced by cmd_genkeys(), LinkKeys(), server_main(), and update_policies().
void KsmPolicyFree | ( | KSM_POLICY * | policy | ) |
Definition at line 991 of file ksm_policy.c.
References KSM_POLICY::denial, KSM_POLICY::description, KSM_POLICY::enforcer, KSM_POLICY::keys, KSM_POLICY::ksk, KSM_POLICY::parent, KSM_POLICY::signature, KSM_POLICY::signer, KSM_POLICY::zone, and KSM_POLICY::zsk.
Referenced by cmd_exportpolicy(), cmd_genkeys(), cmd_purgepolicy(), KsmPolicyAlloc(), LinkKeys(), server_main(), and update_policies().
int KsmPolicyIdFromZoneId | ( | int | zone_id, |
int * | policy_id | ||
) |
Definition at line 860 of file ksm_policy.c.
References DbErrmsg(), DbExecuteSql(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbInt(), DQS_COMPARE_EQ, DqsConditionInt(), DqsFree(), DqsOrderBy(), DqsSpecifyInit(), KSM_INVARG, KSM_SQLFAIL, and MsgLog().
Referenced by cmd_dsseen(), cmd_exportkeys(), cmd_kskretire(), and NewDSSet().
int KsmPolicyInit | ( | DB_RESULT * | result, |
const char * | name | ||
) |
Definition at line 67 of file ksm_policy.c.
References DbExecuteSql(), DbHandle(), DQS_COMPARE_EQ, DqsConditionString(), DqsFree(), DqsOrderBy(), and DqsSpecifyInit().
Referenced by cmd_exportpolicy(), cmd_purgepolicy(), KsmPolicyExists(), KsmPolicySetIdFromName(), and server_main().
int KsmPolicyNameFromId | ( | KSM_POLICY * | policy | ) |
Definition at line 431 of file ksm_policy.c.
References DB_POLICY_NAME, DbErrmsg(), DbExecuteSql(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbStringBuffer(), DQS_COMPARE_EQ, DqsConditionInt(), DqsFree(), DqsOrderBy(), DqsSpecifyInit(), KSM_POLICY::id, KSM_INVARG, KSM_NAME_LENGTH, KSM_SQLFAIL, MsgLog(), and KSM_POLICY::name.
Referenced by KsmPolicyReadFromId().
int KsmPolicyNullSaltStamp | ( | int | policy_id | ) |
Definition at line 677 of file ksm_policy.c.
References DbExecuteSqlNoResult(), DbHandle(), KME_BUFFEROVF, KSM_INVARG, KSM_SQL_SIZE, and MsgLog().
Referenced by SetParamOnPolicy().
int KsmPolicyParameter | ( | DB_RESULT | result, |
KSM_POLICY_PARAMETER * | data | ||
) |
Definition at line 370 of file ksm_policy.c.
References KSM_POLICY_PARAMETER::category, DB_POLICY_PARAMETER_CATEGORY, DB_POLICY_PARAMETER_NAME, DB_POLICY_PARAMETER_VALUE, DbErrmsg(), DbFetchRow(), DbFreeRow(), DbHandle(), DbInt(), DbStringBuffer(), KSM_INVARG, KSM_SQLFAIL, MsgLog(), KSM_POLICY_PARAMETER::name, and KSM_POLICY_PARAMETER::value.
Referenced by KsmPolicyRead().
int KsmPolicyParametersInit | ( | DB_RESULT * | result, |
const char * | name | ||
) |
Definition at line 108 of file ksm_policy.c.
References DbExecuteSql(), DbHandle(), DQS_COMPARE_EQ, DqsConditionKeyword(), DqsConditionString(), DqsFree(), DqsOrderBy(), and DqsSpecifyInit().
Referenced by KsmPolicyRead().
int KsmPolicyPopulateSMFromIds | ( | KSM_POLICY * | policy | ) |
Definition at line 710 of file ksm_policy.c.
References DB_SECURITY_MODULE_CAPACITY, DB_SECURITY_MODULE_FIELDS, DB_SECURITY_MODULE_NAME, DB_SECURITY_MODULE_REQUIREBACKUP, DB_SECURITY_MODULE_TABLE, DbErrmsg(), DbExecuteSql(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbInt(), DbStringBuffer(), DbUnsignedLong(), DQS_COMPARE_EQ, DqsConditionInt(), DqsFree(), DqsSpecifyInit(), KSM_POLICY::ksk, KSM_INVARG, KSM_NAME_LENGTH, KSM_SQLFAIL, MsgLog(), KSM_KEY_POLICY::require_backup, KSM_KEY_POLICY::sm, KSM_KEY_POLICY::sm_capacity, KSM_KEY_POLICY::sm_name, and KSM_POLICY::zsk.
Referenced by KsmPolicyRead().
int KsmPolicyRead | ( | KSM_POLICY * | policy | ) |
Definition at line 230 of file ksm_policy.c.
References KSM_DENIAL_POLICY::algorithm, KSM_KEY_POLICY::algorithm, KSM_KEY_POLICY::bits, KSM_POLICY_PARAMETER::category, KSM_SIGNATURE_POLICY::clockskew, KSM_POLICY::denial, KSM_PARENT_POLICY::ds_ttl, KSM_POLICY::enforcer, KSM_DENIAL_POLICY::iteration, KSM_SIGNER_POLICY::jitter, KSM_ENFORCER_POLICY::keygeninterval, KSM_POLICY::keys, KSM_POLICY::ksk, KSM_INVARG, KsmParameterEnd(), KsmPolicyParameter(), KsmPolicyParametersInit(), KsmPolicyPopulateSMFromIds(), KsmPolicySetIdFromName(), KSM_KEY_POLICY::lifetime, KSM_KEY_POLICY::manual_rollover, MsgLog(), KSM_POLICY::name, KSM_POLICY_PARAMETER::name, KSM_DENIAL_POLICY::optout, KSM_KEY_POLICY::overlap, KSM_POLICY::parent, KSM_SIGNER_POLICY::propdelay, KSM_ZONE_POLICY::propdelay, KSM_PARENT_POLICY::propdelay, KSM_COMMON_KEY_POLICY::publish_safety, KSM_COMMON_KEY_POLICY::purge, KSM_SIGNER_POLICY::refresh, KSM_DENIAL_POLICY::resalt, KSM_SIGNATURE_POLICY::resign, KSM_COMMON_KEY_POLICY::retire_safety, KSM_KEY_POLICY::rfc5011, KSM_KEY_POLICY::rollover_scheme, KSM_DENIAL_POLICY::saltlength, KSM_SIGNER_POLICY::serial, KSM_ZONE_POLICY::serial, KSM_COMMON_KEY_POLICY::share_keys, KSM_POLICY::shared_keys, KSM_POLICY::signature, KSM_POLICY::signer, KSM_KEY_POLICY::sm, KSM_ZONE_POLICY::soa_min, KSM_PARENT_POLICY::soa_min, KSM_ZONE_POLICY::soa_ttl, KSM_PARENT_POLICY::soa_ttl, KSM_SIGNER_POLICY::soamin, KSM_SIGNER_POLICY::soattl, KSM_KEY_POLICY::standby_keys, KSM_DENIAL_POLICY::ttl, KSM_COMMON_KEY_POLICY::ttl, KSM_KEY_POLICY::ttl, KSM_SIGNATURE_POLICY::valdefault, KSM_SIGNATURE_POLICY::valdenial, KSM_POLICY_PARAMETER::value, KSM_DENIAL_POLICY::version, KSM_POLICY::zone, and KSM_POLICY::zsk.
Referenced by cmd_exportpolicy(), cmd_genkeys(), do_communication(), kaspReadPolicy(), KsmPolicyReadFromId(), LinkKeys(), and update_policies().
int KsmPolicyReadFromId | ( | KSM_POLICY * | policy | ) |
Definition at line 418 of file ksm_policy.c.
References KsmPolicyNameFromId(), and KsmPolicyRead().
int KsmPolicySetIdFromName | ( | KSM_POLICY * | policy | ) |
Definition at line 811 of file ksm_policy.c.
References DB_POLICY_DESCRIPTION, DB_POLICY_ID, DbErrmsg(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbInt(), DbStringBuffer(), KSM_POLICY::denial, KSM_POLICY::description, KSM_POLICY::id, KSM_INVARG, KSM_POLICY_DESC_LENGTH, KSM_SALT_LENGTH, KSM_SQLFAIL, KsmPolicyInit(), MsgLog(), KSM_POLICY::name, and KSM_DENIAL_POLICY::salt.
Referenced by KsmPolicyRead(), and update_policies().
int KsmPolicyUpdateDesc | ( | int | policy_id, |
const char * | policy_description | ||
) |
Definition at line 923 of file ksm_policy.c.
References DbExecuteSqlNoResult(), DbHandle(), DbQuoteString(), DisFree(), DQS_COMPARE_EQ, DusConditionInt(), DusEnd(), DusInit(), DusSetString(), KSM_INVARG, KSM_POLICY_DESC_LENGTH, and MsgLog().
Referenced by update_policies().
int KsmPolicyUpdateSalt | ( | KSM_POLICY * | policy | ) |
Definition at line 499 of file ksm_policy.c.
References DB_POLICY_SALT, DB_POLICY_SALT_STAMP, DbErrmsg(), DbExecuteSql(), DbExecuteSqlNoResult(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbStringBuffer(), KSM_POLICY::denial, DQS_COMPARE_EQ, DqsConditionInt(), DqsFree(), DqsOrderBy(), DqsSpecifyInit(), DtDateDiff(), DtParseDateTimeString(), KSM_POLICY::id, KME_BUFFEROVF, KSM_INVARG, KSM_SALT_LENGTH, KSM_SQL_SIZE, KSM_SQLFAIL, KSM_TIME_LENGTH, MsgLog(), KSM_DENIAL_POLICY::resalt, KSM_DENIAL_POLICY::salt, KSM_DENIAL_POLICY::salt_stamp, KSM_DENIAL_POLICY::saltlength, StrFree, and StrStrncpy().
Referenced by server_main().