OpenDNSSEC-enforcer
1.4.10
|
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include "ksm/database.h"
#include "ksm/database_statement.h"
#include "ksm/db_fields.h"
#include "ksm/debug.h"
#include "ksm/ksm.h"
#include "ksm/kmedef.h"
#include "ksm/ksmdef.h"
#include "ksm/message.h"
#include "ksm/memory.h"
#include "ksm/string_util.h"
#include "ksm/string_util2.h"
Go to the source code of this file.
Functions | |
int | KsmRequestKeys (int keytype, int rollover, const char *datetime, KSM_REQUEST_CALLBACK callback, void *context, int policy_id, int zone_id, int run_interval, int *NewDS) |
int | KsmRequestKeysByType (int keytype, int rollover, const char *datetime, KSM_REQUEST_CALLBACK callback, void *context, int policy_id, int zone_id, int run_interval, int *NewDS) |
int | KsmRequestSetActiveExpectedRetire (int keytype, const char *datetime, int zone_id) |
int | KsmRequestChangeStatePublishReady (int keytype, const char *datetime, int zone_id, int policy_id, int rfc5011, int *NewDS) |
int | KsmRequestChangeStatePublishActive (int keytype, const char *datetime, int zone_id, int policy_id, int *NewDS) |
int | KsmRequestChangeStateReadyActive (int keytype, const char *datetime, int zone_id, int policy_id, int *NewDS) |
int | KsmRequestChangeStateDSPublishDSReady (int keytype, const char *datetime, int zone_id, int policy_id) |
int | KsmRequestChangeStateDSReadyKeyPublish (const char *datetime, int zone_id, int policy_id) |
int | KsmRequestChangeStateKeyPublishActive (const char *datetime, int zone_id, int policy_id, int *NewDS) |
int | KsmRequestChangeStateActiveRetire (int keytype, const char *datetime, int zone_id, int policy_id, int revoke) |
int | KsmRequestChangeStateRetireDead (int keytype, const char *datetime, int zone_id, int policy_id, int rollover_scheme, int *NewDS) |
int | KsmRequestChangeState (int keytype, const char *datetime, int src_state, int dst_state, int zone_id, int policy_id, int rollover_scheme, int rfc5011, int revoke, int *NewDS) |
int | KsmRequestChangeStateGeneratePublish (int keytype, const char *datetime, int count, int zone_id) |
int | KsmRequestChangeStateGenerateDSSub (int keytype, const char *datetime, int count, int zone_id) |
int | KsmRequestChangeStateReadyActiveN (int keytype, const char *datetime, int count, int zone_id) |
int | KsmRequestChangeStateN (int keytype, const char *datetime, int count, int src_state, int dst_state, int zone_id) |
int | KsmRequestChangeStateGenerateDSSubConditional (int keytype, const char *datetime, KSM_PARCOLL *collection, int zone_id, int *NewDS) |
int | KsmRequestChangeStateGeneratePublishConditional (int keytype, const char *datetime, KSM_PARCOLL *collection, int zone_id, int run_interval) |
int | KsmRequestPendingRetireCount (int keytype, const char *datetime, KSM_PARCOLL *parameters, int *count, int zone_id, int interval) |
int | KsmRequestAvailableCount (int keytype, const char *datetime, KSM_PARCOLL *parameters, int *count, int zone_id) |
int | KsmRequestGenerateCount (int keytype, int *count, int zone_id) |
int | KsmRequestStandbyKSKCount (int *count, int zone_id) |
int | KsmRequestCheckActiveKey (int keytype, const char *datetime, int *count, int zone_id) |
int | KsmRequestCountReadyKey (int keytype, const char *datetime, int *count, int zone_id) |
int | KsmRequestCheckFirstPass (int keytype, int *first_pass_flag, int zone_id) |
int | KsmRequestCheckCompromisedFlag (int keytype, int zone_id, int *comp_flag) |
int | KsmRequestIssueKeys (int keytype, KSM_REQUEST_CALLBACK callback, void *context, int zone_id) |
int | KsmRequestPrintKey (void *context, KSM_KEYDATA *data) |
int KsmRequestAvailableCount | ( | int | keytype, |
const char * | datetime, | ||
KSM_PARCOLL * | parameters, | ||
int * | count, | ||
int | zone_id | ||
) |
Definition at line 1640 of file ksm_request.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_KEYPUBLISH, KSM_STATE_PUBLISH, KSM_STATE_READY, and MsgLog().
Referenced by KsmRequestChangeStateGeneratePublishConditional().
int KsmRequestChangeState | ( | int | keytype, |
const char * | datetime, | ||
int | src_state, | ||
int | dst_state, | ||
int | zone_id, | ||
int | policy_id, | ||
int | rollover_scheme, | ||
int | rfc5011, | ||
int | revoke, | ||
int * | NewDS | ||
) |
Definition at line 789 of file ksm_request.c.
References DB_KEYDATA_FIELDS, DbErrmsg(), DbExecuteSqlNoResult(), DBG_M_REQUEST, DbgLog(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DQS_COMPARE_LE, DqsConditionInt(), DqsConditionString(), DqsCountInit(), DqsEnd(), DqsFree(), DqsSpecifyInit(), DusConditionInt(), DusConditionKeyword(), DusEnd(), DusFree(), DusInit(), DusSetInt(), DusSetString(), KSM_KEYDATA::keypair_id, KME_DS_REM_ZONE, KME_KEYCHSTATE, KME_NEW_DS, KME_SQLFAIL, KSM_ROLL_DS, KSM_STATE_DEAD, KSM_STATE_DSREADY, KSM_STATE_KEYPUBLISH, KSM_STATE_PUBLISH_STRING, KSM_STATE_READY, KSM_STATE_READY_STRING, KSM_TYPE_KSK, KsmKey(), KsmKeyEnd(), KsmKeyInitSql(), KsmKeywordStateValueToName(), KsmZoneNameFromId(), MemMalloc(), MsgLog(), StrAppend(), StrFree, StrStrdup(), and StrToUpper().
Referenced by KsmRequestChangeStateActiveRetire(), KsmRequestChangeStateDSPublishDSReady(), KsmRequestChangeStateDSReadyKeyPublish(), KsmRequestChangeStateKeyPublishActive(), KsmRequestChangeStatePublishActive(), KsmRequestChangeStatePublishReady(), KsmRequestChangeStateReadyActive(), and KsmRequestChangeStateRetireDead().
int KsmRequestChangeStateActiveRetire | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id, | ||
int | revoke | ||
) |
Definition at line 737 of file ksm_request.c.
References KSM_STATE_ACTIVE, KSM_STATE_RETIRE, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateDSPublishDSReady | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id | ||
) |
Definition at line 717 of file ksm_request.c.
References KSM_STATE_DSPUBLISH, KSM_STATE_DSREADY, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateDSReadyKeyPublish | ( | const char * | datetime, |
int | zone_id, | ||
int | policy_id | ||
) |
Definition at line 724 of file ksm_request.c.
References KSM_STATE_DSREADY, KSM_STATE_KEYPUBLISH, KSM_TYPE_KSK, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateGenerateDSSub | ( | int | keytype, |
const char * | datetime, | ||
int | count, | ||
int | zone_id | ||
) |
Definition at line 1018 of file ksm_request.c.
References KSM_STATE_DSSUB, KSM_STATE_GENERATE, and KsmRequestChangeStateN().
Referenced by KsmRequestChangeStateGenerateDSSubConditional().
int KsmRequestChangeStateGenerateDSSubConditional | ( | int | keytype, |
const char * | datetime, | ||
KSM_PARCOLL * | collection, | ||
int | zone_id, | ||
int * | NewDS | ||
) |
Definition at line 1285 of file ksm_request.c.
References DBG_M_REQUEST, DbgLog(), KME_GENERATECNT, KME_INSFGENKEY, KsmKeywordTypeValueToName(), KsmParameterStandbyKSKeys(), KsmRequestChangeStateGenerateDSSub(), KsmRequestGenerateCount(), KsmRequestStandbyKSKCount(), and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateGeneratePublish | ( | int | keytype, |
const char * | datetime, | ||
int | count, | ||
int | zone_id | ||
) |
Definition at line 1011 of file ksm_request.c.
References KSM_STATE_GENERATE, KSM_STATE_PUBLISH, and KsmRequestChangeStateN().
Referenced by KsmRequestChangeStateGeneratePublishConditional().
int KsmRequestChangeStateGeneratePublishConditional | ( | int | keytype, |
const char * | datetime, | ||
KSM_PARCOLL * | collection, | ||
int | zone_id, | ||
int | run_interval | ||
) |
Definition at line 1390 of file ksm_request.c.
References DBG_M_REQUEST, DbgLog(), KME_AVAILCNT, KME_GENERATECNT, KME_INSFGENKEY, KME_KEYCNTSUMM, KME_RETIRECNT, KSM_TYPE_KSK, KSM_TYPE_ZSK, KsmKeywordTypeValueToName(), KsmParameterStandbyZSKeys(), KsmRequestAvailableCount(), KsmRequestChangeStateGeneratePublish(), KsmRequestGenerateCount(), KsmRequestPendingRetireCount(), and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateKeyPublishActive | ( | const char * | datetime, |
int | zone_id, | ||
int | policy_id, | ||
int * | NewDS | ||
) |
Definition at line 731 of file ksm_request.c.
References KSM_STATE_ACTIVE, KSM_STATE_KEYPUBLISH, KSM_TYPE_KSK, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateN | ( | int | keytype, |
const char * | datetime, | ||
int | count, | ||
int | src_state, | ||
int | dst_state, | ||
int | zone_id | ||
) |
Definition at line 1066 of file ksm_request.c.
References DQS_QUERY_CONDITION::code, DQS_QUERY_CONDITION::compare, DQS_QUERY_CONDITION::data, DB_KEYDATA_KEYTYPE, DB_KEYDATA_STATE, DB_KEYDATA_ZONE_ID, DbErrmsg(), DbExecuteSqlNoResult(), DBG_M_REQUEST, DbgLog(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DQS_END_OF_LIST, DqsFree(), DusConditionInt(), DusConditionKeyword(), DusEnd(), DusFree(), DusInit(), DusSetInt(), DusSetString(), KSM_KEYDATA::keypair_id, KME_BACK_FATAL, KME_BACK_NON_FATAL, KME_KEYCHSTATE, KME_SQLFAIL, KSM_INVARG, KSM_SQLFAIL, KSM_STATE_ACTIVE, KSM_STATE_DSSUB, KSM_STATE_PUBLISH_STRING, KSM_TYPE_KSK, KsmKey(), KsmKeyEnd(), KsmKeyInit(), KsmKeywordStateValueToName(), MemFree, MemMalloc(), MsgLog(), DQS_QUERY_CONDITION::number, StrAppend(), StrFree, StrStrdup(), and StrToUpper().
Referenced by KsmRequestChangeStateGenerateDSSub(), KsmRequestChangeStateGeneratePublish(), KsmRequestChangeStateReadyActiveN(), and KsmRequestKeysByType().
int KsmRequestChangeStatePublishActive | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id, | ||
int * | NewDS | ||
) |
Definition at line 705 of file ksm_request.c.
References KSM_STATE_ACTIVE, KSM_STATE_PUBLISH, and KsmRequestChangeState().
int KsmRequestChangeStatePublishReady | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id, | ||
int | rfc5011, | ||
int * | NewDS | ||
) |
Definition at line 699 of file ksm_request.c.
References KSM_STATE_PUBLISH, KSM_STATE_READY, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateReadyActive | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id, | ||
int * | NewDS | ||
) |
Definition at line 711 of file ksm_request.c.
References KSM_STATE_ACTIVE, KSM_STATE_READY, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateReadyActiveN | ( | int | keytype, |
const char * | datetime, | ||
int | count, | ||
int | zone_id | ||
) |
Definition at line 1025 of file ksm_request.c.
References KSM_STATE_ACTIVE, KSM_STATE_READY, and KsmRequestChangeStateN().
Referenced by KsmRequestKeysByType().
int KsmRequestChangeStateRetireDead | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id, | ||
int | policy_id, | ||
int | rollover_scheme, | ||
int * | NewDS | ||
) |
Definition at line 744 of file ksm_request.c.
References KSM_STATE_DEAD, KSM_STATE_RETIRE, and KsmRequestChangeState().
Referenced by KsmRequestKeysByType().
int KsmRequestCheckActiveKey | ( | int | keytype, |
const char * | datetime, | ||
int * | count, | ||
int | zone_id | ||
) |
Definition at line 1839 of file ksm_request.c.
References DbErrmsg(), DBG_M_REQUEST, DbgLog(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_GT, DqsConditionInt(), DqsConditionKeyword(), DqsConditionString(), DqsCountInit(), DqsEnd(), DqsFree(), KME_REMAINACT, KME_SQLFAIL, KSM_STATE_ACTIVE, KsmKeywordTypeValueToName(), and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestCheckCompromisedFlag | ( | int | keytype, |
int | zone_id, | ||
int * | comp_flag | ||
) |
Definition at line 2011 of file ksm_request.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DqsConditionInt(), DqsCountInit(), DqsEnd(), DqsFree(), KME_SQLFAIL, KSM_STATE_ACTIVE, and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestCheckFirstPass | ( | int | keytype, |
int * | first_pass_flag, | ||
int | zone_id | ||
) |
Definition at line 1955 of file ksm_request.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_GE, DqsConditionInt(), DqsCountInit(), DqsEnd(), DqsFree(), KME_SQLFAIL, KSM_STATE_PUBLISH, and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestCountReadyKey | ( | int | keytype, |
const char * | datetime, | ||
int * | count, | ||
int | zone_id | ||
) |
Definition at line 1903 of file ksm_request.c.
References DbErrmsg(), DBG_M_REQUEST, DbgLog(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DqsConditionInt(), DqsCountInit(), DqsEnd(), DqsFree(), KME_READYCNT, KME_SQLFAIL, KSM_STATE_READY, KsmKeywordTypeValueToName(), and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestGenerateCount | ( | int | keytype, |
int * | count, | ||
int | zone_id | ||
) |
Definition at line 1710 of file ksm_request.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DqsConditionInt(), DqsCountInit(), DqsEnd(), DqsFree(), KME_SQLFAIL, KSM_STATE_GENERATE, and MsgLog().
Referenced by commGenSignConf(), KsmRequestChangeStateGenerateDSSubConditional(), and KsmRequestChangeStateGeneratePublishConditional().
int KsmRequestIssueKeys | ( | int | keytype, |
KSM_REQUEST_CALLBACK | callback, | ||
void * | context, | ||
int | zone_id | ||
) |
Definition at line 2073 of file ksm_request.c.
References DB_KEYDATA_FIELDS, DQS_COMPARE_EQ, DQS_COMPARE_IN, DqsConditionInt(), DqsConditionKeyword(), DqsEnd(), DqsFree(), DqsSpecifyInit(), KME_BUFFEROVF, KSM_STATE_ACTIVE, KSM_STATE_KEYPUBLISH, KSM_STATE_PUBLISH, KSM_STATE_READY, KSM_STATE_RETIRE, KsmKey(), KsmKeyEnd(), KsmKeyInitSql(), and MsgLog().
Referenced by KsmRequestKeysByType().
int KsmRequestKeys | ( | int | keytype, |
int | rollover, | ||
const char * | datetime, | ||
KSM_REQUEST_CALLBACK | callback, | ||
void * | context, | ||
int | policy_id, | ||
int | zone_id, | ||
int | run_interval, | ||
int * | NewDS | ||
) |
Definition at line 95 of file ksm_request.c.
References DbBeginTransaction(), DbCommit(), DbErrmsg(), DbHandle(), DbRollback(), KME_SQLFAIL, KSM_TYPE_KSK, KSM_TYPE_ZSK, KsmRequestKeysByType(), KsmUpdate(), and MsgLog().
Referenced by commGenSignConf().
int KsmRequestKeysByType | ( | int | keytype, |
int | rollover, | ||
const char * | datetime, | ||
KSM_REQUEST_CALLBACK | callback, | ||
void * | context, | ||
int | policy_id, | ||
int | zone_id, | ||
int | run_interval, | ||
int * | NewDS | ||
) |
Definition at line 210 of file ksm_request.c.
References DbErrmsg(), DBG_M_REQUEST, DbgLog(), DbHandle(), KME_BACK_FATAL, KME_DS_SUBMISSION, KME_MAN_ROLL_REQUIRED, KME_NOREADYKEY, KME_PROM_PUB, KME_REQKEYTYPE, KME_ROLL_ZONE, KME_SQLFAIL, KME_UNKEYTYPE, KSM_PARCOLL::kskmanroll, KSM_PARCOLL::kskroll, KSM_ROLL_DNSKEY, KSM_STATE_ACTIVE, KSM_STATE_PUBLISH, KSM_TYPE_KSK, KSM_TYPE_ZSK, KsmParameterCollection(), KsmRequestChangeStateActiveRetire(), KsmRequestChangeStateDSPublishDSReady(), KsmRequestChangeStateDSReadyKeyPublish(), KsmRequestChangeStateGenerateDSSubConditional(), KsmRequestChangeStateGeneratePublishConditional(), KsmRequestChangeStateKeyPublishActive(), KsmRequestChangeStateN(), KsmRequestChangeStatePublishReady(), KsmRequestChangeStateReadyActive(), KsmRequestChangeStateReadyActiveN(), KsmRequestChangeStateRetireDead(), KsmRequestCheckActiveKey(), KsmRequestCheckCompromisedFlag(), KsmRequestCheckFirstPass(), KsmRequestCountReadyKey(), KsmRequestIssueKeys(), KsmRequestSetActiveExpectedRetire(), KsmZoneNameFromId(), MsgLog(), KSM_PARCOLL::rfc5011, StrFree, and KSM_PARCOLL::zskmanroll.
Referenced by KsmRequestKeys().
int KsmRequestPendingRetireCount | ( | int | keytype, |
const char * | datetime, | ||
KSM_PARCOLL * | parameters, | ||
int * | count, | ||
int | zone_id, | ||
int | interval | ||
) |
Definition at line 1507 of file ksm_request.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_LE, DqsConditionInt(), DqsConditionKeyword(), DqsCountInit(), DqsEnd(), DqsFree(), KME_BUFFEROVF, KME_SQLFAIL, KSM_STATE_ACTIVE, KSM_TYPE_ZSK, KsmParameterKskPropagationDelay(), KsmParameterKskTtl(), KsmParameterPropagationDelay(), KsmParameterPubSafety(), KsmParameterZskTtl(), and MsgLog().
Referenced by allocateKeysToZone(), and KsmRequestChangeStateGeneratePublishConditional().
int KsmRequestPrintKey | ( | void * | context, |
KSM_KEYDATA * | data | ||
) |
Definition at line 2152 of file ksm_request.c.
References KSM_KEYDATA::algorithm, KSM_KEYDATA::keypair_id, KSM_KEYDATA::keytype, KsmKeywordStateValueToName(), KSM_KEYDATA::location, and KSM_KEYDATA::state.
int KsmRequestSetActiveExpectedRetire | ( | int | keytype, |
const char * | datetime, | ||
int | zone_id | ||
) |
Definition at line 532 of file ksm_request.c.
References DB_KEYDATA_FIELDS, DbErrmsg(), DbExecuteSqlNoResult(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DqsConditionInt(), DqsCountInit(), DqsEnd(), DqsFree(), DqsSpecifyInit(), DusConditionKeyword(), DusEnd(), DusFree(), DusInit(), DusSetInt(), DusSetString(), KSM_KEYDATA::keypair_id, KME_SQLFAIL, KSM_STATE_ACTIVE, KsmKey(), KsmKeyEnd(), KsmKeyInitSql(), MemMalloc(), MsgLog(), StrAppend(), and StrFree.
Referenced by KsmRequestKeysByType().
int KsmRequestStandbyKSKCount | ( | int * | count, |
int | zone_id | ||
) |
Definition at line 1760 of file ksm_request.c.
References DbErrmsg(), DbHandle(), DbIntQuery(), DQS_COMPARE_EQ, DQS_COMPARE_IN, DqsConditionInt(), DqsConditionKeyword(), DqsCountInit(), DqsEnd(), DqsFree(), KME_BUFFEROVF, KME_SQLFAIL, KSM_STATE_DSPUBLISH, KSM_STATE_DSREADY, KSM_STATE_DSSUB, KSM_TYPE_KSK, and MsgLog().
Referenced by KsmRequestChangeStateGenerateDSSubConditional().