From 6e530397d8b6c247e572ec669331eff08ed87264 Mon Sep 17 00:00:00 2001 From: kubodera_yuichi Date: Tue, 22 Dec 2009 05:20:29 +0000 Subject: [PATCH] =?UTF-8?q?linux=E3=81=A7=E3=81=AE=E3=83=93=E3=83=AB?= =?UTF-8?q?=E3=83=89=E3=82=92=E9=80=9A=E3=81=99=20=E3=81=9D=E3=81=AE4?= 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@18 ff987cc8-cf2f-4642-8568-d52cce064691 --- cr_hsm_code.c | 12 ++++++++---- cr_hsm_code.h | 2 ++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/cr_hsm_code.c b/cr_hsm_code.c index 5d33717..e057f04 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -117,6 +117,8 @@ #include #include +#include "cr_generate_id.h" + #ifdef USE_HSM #include "cr_hsm_code.h" @@ -156,6 +158,8 @@ M_ByteBlock *hsmBlobptr = NULL; // init HSM int hsm_initialize( void ) { + int ret_code = 0; + // init HSM ret_code = NFastApp_InitEx( &hsmHandle, NULL, NULL ); if ( ret_code != CR_GENID_SUCCESS ) @@ -376,8 +380,8 @@ int hsm_aes_encrypt( unsigned char *dst_buf, unsigned char *org_buf, int size ) // iv set enc_iv.mech = Mech_RijndaelmCBCpNONE; - memset( enc_iv.iv.generic128.iv.bytes, 0, sizeof( enc_iv.generic128.iv.bytes ) ); - printf( "enc_iv.---.bytes : %d bytes\n", sizeof( enc_iv.generic128.iv.bytes ) ); + memset( enc_iv.iv.generic128.iv.bytes, 0, sizeof( enc_iv.iv.generic128.iv.bytes ) ); + printf( "enc_iv.---.bytes : %d bytes\n", sizeof( enc_iv.iv.generic128.iv.bytes ) ); // encrypt command set cmd.cmd = Cmd_Encrypt; @@ -425,8 +429,8 @@ int hsm_aes_decrypt( unsigned char *dst_buf, unsigned char *org_buf, int size ) // iv set dec_iv.mech = Mech_RijndaelmCBCpNONE; - memset( dec_iv.iv.generic128.iv.bytes, 0, sizeof( dec_iv.generic128.iv.bytes ) ); - printf( "dec_iv.---.bytes : %d bytes\n", sizeof( dec_iv.generic128.iv.bytes ) ); + memset( dec_iv.iv.generic128.iv.bytes, 0, sizeof( dec_iv.iv.generic128.iv.bytes ) ); + printf( "dec_iv.---.bytes : %d bytes\n", sizeof( dec_iv.iv.generic128.iv.bytes ) ); // decyrpt cmd.cmd = Cmd_Decrypt; diff --git a/cr_hsm_code.h b/cr_hsm_code.h index 7103bf9..28d25b6 100644 --- a/cr_hsm_code.h +++ b/cr_hsm_code.h @@ -116,6 +116,8 @@ extern "C" { #endif +#define HSM_MODULE_ID ( 1) + // functions int hsm_initialize( void ); void hsm_finalize( void );