From 3c03a3110ab4b98074646b38f4da9ece25116046 Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Thu, 7 Jan 2010 02:31:35 +0000 Subject: [PATCH] =?UTF-8?q?=E5=88=9D=E6=9C=9F=E5=8C=96=E6=99=82=E3=81=AB?= =?UTF-8?q?=E3=81=AF=E3=81=A9=E3=82=93=E3=81=AA=E7=8A=B6=E6=85=8B=E3=81=A7?= =?UTF-8?q?=E3=82=82"=E3=83=AA=E3=82=BB=E3=83=83=E3=83=88=E2=80=9D?= =?UTF-8?q?=E3=81=AF=E8=A1=8C=E3=81=86=E3=82=88=E3=81=86=E3=81=AB=E6=88=BB?= =?UTF-8?q?=E3=81=97=E3=81=9F(=E5=BE=A9=E6=97=A7=E5=87=A6=E7=90=86?= =?UTF-8?q?=E3=81=AF=E8=A1=8C=E3=82=8F=E3=81=AA=E3=81=84)?= 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@150 ff987cc8-cf2f-4642-8568-d52cce064691 --- cr_hsm_code.c | 104 +++++++++++++++++++++++++------------------------- 1 file changed, 52 insertions(+), 52 deletions(-) diff --git a/cr_hsm_code.c b/cr_hsm_code.c index 1773b79..8e52239 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -358,60 +358,60 @@ int hsm_reset_module( void ) SetErrorInfo( __FUNCTION__, __LINE__ ); 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 ) ); - - // モジュールのリセット - cmd.cmd = Cmd_ClearUnit; - cmd.args.clearunit.module = HSM_MODULE_ID; - ret_code = NFastApp_Transact( connection, NULL, &cmd, &reply, NULL ); - if ( ret_code != CR_GENID_SUCCESS ) - { - SetErrorInfo( __FUNCTION__, __LINE__ ); - return ret_code; - } - ret_code = reply.status; - if ( ret_code != CR_GENID_SUCCESS ) - { - SetErrorInfo( __FUNCTION__, __LINE__ ); - 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 ) ); - - // モジュールの状態を再度確認 - cmd.cmd = Cmd_NewEnquiry; - cmd.args.newenquiry.module = HSM_MODULE_ID; - cmd.args.newenquiry.version = EnqVer_Six; - ret_code = NFastApp_Transact( connection, NULL, &cmd, &reply, NULL ); - if ( ret_code != CR_GENID_SUCCESS ) - { - SetErrorInfo( __FUNCTION__, __LINE__ ); - return ret_code; - } - ret_code = reply.status; - if ( ret_code != CR_GENID_SUCCESS ) - { - SetErrorInfo( __FUNCTION__, __LINE__ ); - return ret_code; - } - - // 復旧しないようなら終了するしかない - if ( reply.reply.newenquiry.flags & Cmd_NewEnquiry_Reply_flags_Failed ) - { - SetErrorInfo( __FUNCTION__, __LINE__ ); - return Status_HardwareFailed; - } } // 復旧処理 + NFastApp_Free_Command( handle, NULL, NULL, &cmd ); + NFastApp_Free_Reply( handle, NULL, NULL, &reply ); + + memset( &cmd, 0, sizeof( cmd ) ); + memset( &reply, 0, sizeof( reply ) ); + + // モジュールのリセット + cmd.cmd = Cmd_ClearUnit; + cmd.args.clearunit.module = HSM_MODULE_ID; + ret_code = NFastApp_Transact( connection, NULL, &cmd, &reply, NULL ); + if ( ret_code != CR_GENID_SUCCESS ) + { + SetErrorInfo( __FUNCTION__, __LINE__ ); + return ret_code; + } + ret_code = reply.status; + if ( ret_code != CR_GENID_SUCCESS ) + { + SetErrorInfo( __FUNCTION__, __LINE__ ); + 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 ) ); + + // モジュールの状態を再度確認 + cmd.cmd = Cmd_NewEnquiry; + cmd.args.newenquiry.module = HSM_MODULE_ID; + cmd.args.newenquiry.version = EnqVer_Six; + ret_code = NFastApp_Transact( connection, NULL, &cmd, &reply, NULL ); + if ( ret_code != CR_GENID_SUCCESS ) + { + SetErrorInfo( __FUNCTION__, __LINE__ ); + return ret_code; + } + ret_code = reply.status; + if ( ret_code != CR_GENID_SUCCESS ) + { + SetErrorInfo( __FUNCTION__, __LINE__ ); + return ret_code; + } + + // まだ failed state ならば、終了するしかない + if ( reply.reply.newenquiry.flags & Cmd_NewEnquiry_Reply_flags_Failed ) + { + SetErrorInfo( __FUNCTION__, __LINE__ ); + return Status_HardwareFailed; + } + // 切断 ret_code = NFastApp_Disconnect( hsmConnection, NULL ); if ( ret_code != CR_GENID_SUCCESS )