OpenDNSSEC-enforcer
1.3.8
|
#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/kmedef.h"
#include "ksm/ksm.h"
#include "ksm/ksmdef.h"
#include "ksm/ksm_internal.h"
#include "ksm/message.h"
#include "ksm/string_util.h"
#include "ksm/string_util2.h"
Go to the source code of this file.
Functions | |
int | KsmKeyPairCreate (int policy_id, const char *HSMKeyID, int smID, int size, int alg, const char *generate, DB_ID *id) |
int | KsmDnssecKeyCreate (int zone_id, int keypair_id, int keytype, int state, const char *time, const char *retTime, DB_ID *id) |
int | KsmKeyInitSql (DB_RESULT *result, const char *sql) |
int | KsmKeyInit (DB_RESULT *result, DQS_QUERY_CONDITION *condition) |
int | KsmKeyInitId (DB_RESULT *result, DB_ID id) |
int | KsmKey (DB_RESULT result, KSM_KEYDATA *data) |
void | KsmKeyEnd (DB_RESULT result) |
int | KsmKeyData (DB_ID id, KSM_KEYDATA *data) |
int | KsmKeyPredict (int policy_id, int keytype, int shared_keys, int interval, int *count, int rollover_scheme, int zone_count) |
int | KsmKeyCountQueue (int keytype, int *count, int zone_id) |
int | KsmKeyCountStillGood (int policy_id, int sm, int bits, int algorithm, int interval, const char *datetime, int *count, int keytype) |
int | KsmKeyGetUnallocated (int policy_id, int sm, int bits, int algorithm, int zone_id, int share_keys, int *keypair_id) |
int | KsmMarkKeysAsDead (int zone_id) |
int | KsmKillKey (int keypair_id) |
int KsmDnssecKeyCreate | ( | int | zone_id, |
int | keypair_id, | ||
int | keytype, | ||
int | state, | ||
const char * | time, | ||
const char * | retTime, | ||
DB_ID * | id | ||
) |
Definition at line 143 of file ksm_key.c.
References DbExecuteSqlNoResult(), DbHandle(), DbLastRowId(), DisAppendInt(), DisAppendString(), DisEnd(), DisFree(), DisSpecifyInit(), KSM_INVARG, KSM_STATE_ACTIVE, KSM_STATE_GENERATE, KsmKeywordStateValueToName(), MsgLog(), StrAppend(), and StrFree.
Referenced by allocateKeysToZone(), and cmd_import().
int KsmKey | ( | DB_RESULT | result, |
KSM_KEYDATA * | data | ||
) |
Definition at line 368 of file ksm_key.c.
References KSM_KEYDATA::active, KSM_KEYDATA::algorithm, DB_KEYDATA_ACTIVE, DB_KEYDATA_ALGORITHM, DB_KEYDATA_DEAD, DB_KEYDATA_FIXED_DATE, DB_KEYDATA_GENERATE, DB_KEYDATA_ID, DB_KEYDATA_KEYTYPE, DB_KEYDATA_LOCATION, DB_KEYDATA_PUBLISH, DB_KEYDATA_READY, DB_KEYDATA_RETIRE, DB_KEYDATA_STATE, DB_KEYDATA_ZONE_ID, DbFetchRow(), DbFreeRow(), DbInt(), DbStringBuffer(), DbUnsignedLong(), KSM_KEYDATA::dead, KSM_KEYDATA::fixedDate, KSM_KEYDATA::generate, KSM_KEYDATA::keypair_id, KSM_KEYDATA::keytype, KSM_INVARG, KSM_KEYDATA::location, MsgLog(), KSM_KEYDATA::publish, KSM_KEYDATA::ready, KSM_KEYDATA::retire, KSM_KEYDATA::state, and KSM_KEYDATA::zone_id.
Referenced by ChangeKeyState(), cmd_exportkeys(), KsmKeyData(), KsmMarkKeysAsDead(), KsmRequestChangeState(), KsmRequestChangeStateN(), KsmRequestIssueKeys(), KsmRequestSetActiveExpectedRetire(), KsmUpdate(), and NewDSSet().
int KsmKeyCountQueue | ( | int | keytype, |
int * | count, | ||
int | zone_id | ||
) |
Definition at line 655 of file ksm_key.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DqsConditionInt(), DqsConditionKeyword(), DqsCountInit(), DqsEnd(), DqsFree(), KME_BUFFEROVF, KME_SQLFAIL, KSM_STATE_ACTIVE, KSM_STATE_DSPUBLISH, KSM_STATE_DSREADY, KSM_STATE_DSSUB, KSM_STATE_GENERATE, KSM_STATE_PUBLISH, KSM_STATE_READY, and MsgLog().
Referenced by allocateKeysToZone().
int KsmKeyCountStillGood | ( | int | policy_id, |
int | sm, | ||
int | bits, | ||
int | algorithm, | ||
int | interval, | ||
const char * | datetime, | ||
int * | count, | ||
int | keytype | ||
) |
Definition at line 734 of file ksm_key.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DqsConditionInt(), DqsConditionKeyword(), DqsCountInit(), DqsEnd(), DqsFree(), KME_BUFFEROVF, KME_SQLFAIL, KSM_STATE_ACTIVE, KSM_STATE_DSPUBLISH, KSM_STATE_DSREADY, KSM_STATE_DSSUB, KSM_STATE_GENERATE, KSM_STATE_PUBLISH, KSM_STATE_READY, KSM_TYPE_ZSK, KsmParameterCollection(), KsmParameterKskPropagationDelay(), KsmParameterKskTtl(), KsmParameterPropagationDelay(), KsmParameterPubSafety(), KsmParameterZskTtl(), MsgLog(), and StrAppend().
Referenced by cmd_genkeys(), and do_keygen().
int KsmKeyData | ( | DB_ID | id, |
KSM_KEYDATA * | data | ||
) |
Definition at line 500 of file ksm_key.c.
References KsmKey(), KsmKeyEnd(), and KsmKeyInitId().
Definition at line 471 of file ksm_key.c.
References DbFreeResult().
Referenced by ChangeKeyState(), cmd_exportkeys(), KsmKeyData(), KsmMarkKeysAsDead(), KsmRequestChangeState(), KsmRequestChangeStateN(), KsmRequestIssueKeys(), KsmRequestSetActiveExpectedRetire(), KsmUpdate(), and NewDSSet().
int KsmKeyGetUnallocated | ( | int | policy_id, |
int | sm, | ||
int | bits, | ||
int | algorithm, | ||
int | zone_id, | ||
int | share_keys, | ||
int * | keypair_id | ||
) |
Definition at line 871 of file ksm_key.c.
References DB_KEYDATA_ID, DbErrmsg(), DbExecuteSql(), DbFetchRow(), DbFreeResult(), DbFreeRow(), DbHandle(), DbInt(), DQS_COMPARE_EQ, DQS_COMPARE_IS, DQS_COMPARE_NOT_IN, DqsConditionInt(), DqsConditionKeyword(), DqsFree(), DqsSpecifyInit(), KSM_KEYS_NOT_SHARED, KSM_SQLFAIL, KSM_STATE_DEAD, KSM_STATE_RETIRE, and MsgLog().
Referenced by allocateKeysToZone().
int KsmKeyInit | ( | DB_RESULT * | result, |
DQS_QUERY_CONDITION * | condition | ||
) |
Definition at line 251 of file ksm_key.c.
References DQS_QUERY_CONDITION::compare, DB_KEYDATA_ALGORITHM, DB_KEYDATA_FIELDS, DB_KEYDATA_ID, DB_KEYDATA_KEYTYPE, DB_KEYDATA_STATE, DB_KEYDATA_ZONE_ID, DQS_END_OF_LIST, DqsConditionInt(), DqsEnd(), DqsFree(), DqsSpecifyInit(), KME_UNRCONCOD, KsmKeyInitSql(), MsgLog(), and DQS_QUERY_CONDITION::number.
Referenced by KsmKeyInitId(), KsmRequestChangeStateN(), and KsmUpdate().
int KsmKeyInitId | ( | DB_RESULT * | result, |
DB_ID | id | ||
) |
Definition at line 328 of file ksm_key.c.
References DQS_QUERY_CONDITION::code, DQS_QUERY_CONDITION::compare, DQS_QUERY_CONDITION::data, DB_KEYDATA_ID, DQS_COMPARE_EQ, DQS_END_OF_LIST, KsmKeyInit(), and DQS_QUERY_CONDITION::number.
Referenced by KsmKeyData().
int KsmKeyInitSql | ( | DB_RESULT * | result, |
const char * | sql | ||
) |
Definition at line 219 of file ksm_key.c.
References DbExecuteSql(), and DbHandle().
Referenced by ChangeKeyState(), cmd_exportkeys(), KsmKeyInit(), KsmMarkKeysAsDead(), KsmRequestChangeState(), KsmRequestIssueKeys(), KsmRequestSetActiveExpectedRetire(), and NewDSSet().
int KsmKeyPairCreate | ( | int | policy_id, |
const char * | HSMKeyID, | ||
int | smID, | ||
int | size, | ||
int | alg, | ||
const char * | generate, | ||
DB_ID * | id | ||
) |
Definition at line 86 of file ksm_key.c.
References DbExecuteSqlNoResult(), DbHandle(), DbLastRowId(), DisAppendInt(), DisAppendString(), DisEnd(), DisFree(), DisSpecifyInit(), KSM_INVARG, and MsgLog().
Referenced by cmd_genkeys(), and do_keygen().
int KsmKeyPredict | ( | int | policy_id, |
int | keytype, | ||
int | shared_keys, | ||
int | interval, | ||
int * | count, | ||
int | rollover_scheme, | ||
int | zone_count | ||
) |
Definition at line 564 of file ksm_key.c.
References KSM_PARCOLL::dsttl, KME_UNKEYTYPE, KSM_PARCOLL::ksklife, KSM_PARCOLL::kskpropdelay, KSM_PARCOLL::kskttl, KSM_INVARG, KSM_KEYS_NOT_SHARED, KSM_ROLL_DNSKEY, KSM_ROLL_DS, KSM_TYPE_KSK, KSM_TYPE_ZSK, KsmParameterCollection(), MsgLog(), KSM_PARCOLL::propdelay, KSM_PARCOLL::pub_safety, KSM_PARCOLL::standbyksks, KSM_PARCOLL::standbyzsks, and KSM_PARCOLL::zsklife.
Referenced by allocateKeysToZone(), cmd_genkeys(), and do_keygen().
int KsmKillKey | ( | int | keypair_id | ) |
Definition at line 1006 of file ksm_key.c.
References DbExecuteSqlNoResult(), DbHandle(), DQS_COMPARE_EQ, DtParseDateTimeString(), DusConditionInt(), DusEnd(), DusFree(), DusInit(), DusSetInt(), DusSetString(), KSM_STATE_DEAD, and StrFree.
Referenced by KsmMarkKeysAsDead().
int KsmMarkKeysAsDead | ( | int | zone_id | ) |
Definition at line 947 of file ksm_key.c.
References DB_KEYDATA_FIELDS, DQS_COMPARE_EQ, DQS_COMPARE_GT, DQS_COMPARE_LT, DqsConditionInt(), DqsEnd(), DqsSpecifyInit(), KSM_KEYDATA::keypair_id, KSM_STATE_DEAD, KSM_STATE_GENERATE, KsmKey(), KsmKeyEnd(), KsmKeyInitSql(), and KsmKillKey().
Referenced by cmd_delzone(), and update_zones().