From 501f46af36bdfa8dbc05fdbec08d4c2fd3d66fce Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Thu, 7 Jan 2010 04:56:23 +0000 Subject: [PATCH] =?UTF-8?q?=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E5=87=A6?= =?UTF-8?q?=E7=90=86=E3=80=81=E3=83=90=E3=82=B0=E4=BF=AE=E6=AD=A3?= 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@151 ff987cc8-cf2f-4642-8568-d52cce064691 --- cr_hsm_code.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/cr_hsm_code.c b/cr_hsm_code.c index 8e52239..94c38ab 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -161,6 +161,7 @@ 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 ) { @@ -318,8 +319,8 @@ int hsm_reset_module( void ) // モジュールの状態確認 cmd.cmd = Cmd_NewEnquiry; - cmd.args.newenquiry.module = HSM_MODULE_ID; cmd.args.newenquiry.version = EnqVer_Six; + cmd.args.newenquiry.module = HSM_MODULE_ID; ret_code = NFastApp_Transact( connection, NULL, &cmd, &reply, NULL ); if ( ret_code != CR_GENID_SUCCESS ) { @@ -332,7 +333,7 @@ int hsm_reset_module( void ) SetErrorInfo( __FUNCTION__, __LINE__ ); return ret_code; } - + // モジュールが failed state でないなら以下は必要ないので即終了 if ( reply.reply.newenquiry.flags & Cmd_NewEnquiry_Reply_flags_Failed ) { @@ -360,9 +361,7 @@ int hsm_reset_module( void ) } } // 復旧処理 - NFastApp_Free_Command( handle, NULL, NULL, &cmd ); NFastApp_Free_Reply( handle, NULL, NULL, &reply ); - memset( &cmd, 0, sizeof( cmd ) ); memset( &reply, 0, sizeof( reply ) ); @@ -382,12 +381,9 @@ int hsm_reset_module( void ) return ret_code; } - NFastApp_Free_Command( handle, NULL, NULL, &cmd ); - NFastApp_Free_Reply( handle, NULL, NULL, &reply ); - memset( &cmd, 0, sizeof( cmd ) ); - memset( &reply, 0, sizeof( reply ) ); - + memset( &reply, 0, sizeof( reply ) );; + // モジュールの状態を再度確認 cmd.cmd = Cmd_NewEnquiry; cmd.args.newenquiry.module = HSM_MODULE_ID; @@ -413,7 +409,7 @@ int hsm_reset_module( void ) } // 切断 - ret_code = NFastApp_Disconnect( hsmConnection, NULL ); + ret_code = NFastApp_Disconnect( connection, NULL ); if ( ret_code != CR_GENID_SUCCESS ) { SetErrorInfo( __FUNCTION__, __LINE__ );