From 57e2336e2bcc9340f5591489cb152c094ea5f60f Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Tue, 12 Jan 2010 00:38:23 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=82=B9=E3=82=A4?= =?UTF-8?q?=E3=83=83=E3=83=81=E3=81=ABHSM=E3=83=AA=E3=82=BB=E3=83=83?= =?UTF-8?q?=E3=83=88=E5=88=87=E6=9B=BF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@168 ff987cc8-cf2f-4642-8568-d52cce064691 --- Makefile | 7 ++++++- cr_hsm_code.c | 5 ++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 8413b01..7859ef5 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,11 @@ # 最終的なビルドスイッチの設定は、以下の通り。 # DEV_CYGWIN = FALSE # USE_HSM = TRUE +# RESET_HSM = TRUE DEV_CYGWIN = FALSE USE_HSM = TRUE - +RESET_HSM = TRUE ifeq ($(USE_HSM),TRUE) @@ -125,6 +126,10 @@ LDLIBS += $(NFAST_LDLIBS) MERGE_PROG = merge_lib_objs_hsm.plx endif +ifeq ($(RESET_HSM),TRUE) +CFLAGS += -DRESET_HSM +endif + .SUFFIXES: all: package_build $(KEYS_C) $(TARGET_LIB) $(TARGET) diff --git a/cr_hsm_code.c b/cr_hsm_code.c index 867edb3..69ffd25 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -161,21 +161,20 @@ const NFKM_KeyIdent hsmEcdsaPubkeyidentProd = { (char*)"simple", (char*)"nct2-pu int hsm_ecdsa_load_keypair( NFKM_KeyIdent privKeyident, M_KeyID *privKeyid, NFKM_KeyIdent pubKeyident, M_KeyID *pubKeyid ); -#define EXE_AUTH_OK // init HSM int hsm_initialize( void ) { int ret_code = CR_GENID_SUCCESS; +#ifdef RESET_HSM // HSM のリセット処理 -#ifdef EXE_AUTH_OK ret_code = hsm_reset_module(); if ( ret_code != CR_GENID_SUCCESS ) { SetErrorInfo( __FUNCTION__, __LINE__ ); return ret_code; } -#endif +#endif // RESET_HSM // init HSM ret_code = NFastApp_Init( &hsmHandle, my_hsm_malloc, my_hsm_realloc, my_hsm_free, NULL );