ビルドスイッチにHSMリセット切替を追加

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@168 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2010-01-12 00:38:23 +00:00
parent 4c033494c2
commit 57e2336e2b
2 changed files with 8 additions and 4 deletions

View File

@ -8,10 +8,11 @@
# 最終的なビルドスイッチの設定は、以下の通り。 # 最終的なビルドスイッチの設定は、以下の通り。
# DEV_CYGWIN = FALSE # DEV_CYGWIN = FALSE
# USE_HSM = TRUE # USE_HSM = TRUE
# RESET_HSM = TRUE
DEV_CYGWIN = FALSE DEV_CYGWIN = FALSE
USE_HSM = TRUE USE_HSM = TRUE
RESET_HSM = TRUE
ifeq ($(USE_HSM),TRUE) ifeq ($(USE_HSM),TRUE)
@ -125,6 +126,10 @@ LDLIBS += $(NFAST_LDLIBS)
MERGE_PROG = merge_lib_objs_hsm.plx MERGE_PROG = merge_lib_objs_hsm.plx
endif endif
ifeq ($(RESET_HSM),TRUE)
CFLAGS += -DRESET_HSM
endif
.SUFFIXES: .SUFFIXES:
all: package_build $(KEYS_C) $(TARGET_LIB) $(TARGET) all: package_build $(KEYS_C) $(TARGET_LIB) $(TARGET)

View File

@ -161,21 +161,20 @@ const NFKM_KeyIdent hsmEcdsaPubkeyidentProd = { (char*)"simple", (char*)"nct2-pu
int hsm_ecdsa_load_keypair( NFKM_KeyIdent privKeyident, M_KeyID *privKeyid, int hsm_ecdsa_load_keypair( NFKM_KeyIdent privKeyident, M_KeyID *privKeyid,
NFKM_KeyIdent pubKeyident, M_KeyID *pubKeyid ); NFKM_KeyIdent pubKeyident, M_KeyID *pubKeyid );
#define EXE_AUTH_OK
// init HSM // init HSM
int hsm_initialize( void ) int hsm_initialize( void )
{ {
int ret_code = CR_GENID_SUCCESS; int ret_code = CR_GENID_SUCCESS;
#ifdef RESET_HSM
// HSM のリセット処理 // HSM のリセット処理
#ifdef EXE_AUTH_OK
ret_code = hsm_reset_module(); ret_code = hsm_reset_module();
if ( ret_code != CR_GENID_SUCCESS ) if ( ret_code != CR_GENID_SUCCESS )
{ {
SetErrorInfo( __FUNCTION__, __LINE__ ); SetErrorInfo( __FUNCTION__, __LINE__ );
return ret_code; return ret_code;
} }
#endif #endif // RESET_HSM
// init HSM // init HSM
ret_code = NFastApp_Init( &hsmHandle, my_hsm_malloc, my_hsm_realloc, my_hsm_free, NULL ); ret_code = NFastApp_Init( &hsmHandle, my_hsm_malloc, my_hsm_realloc, my_hsm_free, NULL );