diff --git a/cr_generate_id_private.h b/cr_generate_id_private.h index 6443814..30cbf2e 100644 --- a/cr_generate_id_private.h +++ b/cr_generate_id_private.h @@ -190,7 +190,7 @@ typedef struct { u32 serial0; /* 0x0c - 0x0f */ s32 errorCode; /* 0x10 - 0x13 */ u32 lineNumber; /* 0x14 - 0x17 */ - char fileName[ 64 ]; /* 0x18 - 0x57 */ // いくつあれば十分か? + char fileName[ 64 ]; /* 0x18 - 0x57 */ u8 bondingOption; /* 0x58 - 0x58 */ u8 reserve[ 167 ]; /* 0x59 - 0xff */ } CR_ERR_BUFFER; diff --git a/cr_hsm_code.c b/cr_hsm_code.c index 5004b94..240afcd 100644 --- a/cr_hsm_code.c +++ b/cr_hsm_code.c @@ -134,7 +134,6 @@ NFast_AppHandle hsmHandle; NFastApp_Connection hsmConnection; NFKM_WorldInfo *hsmWorld = NULL; // allocate -NFKM_ModuleInfo *hsmModuleinfo = NULL; // TODO: 最終鍵に変更する #ifdef ENCRYPT_AES @@ -316,6 +315,7 @@ int hsm_aes_load_key( NFKM_KeyIdent keyident, M_KeyID *keyid ) { int ret_code = CR_GENID_SUCCESS; NFKM_Key *keyinfo = NULL; + NFKM_ModuleInfo *moduleinfo = NULL; M_ByteBlock *blobPtr = NULL; // find key @@ -327,8 +327,8 @@ int hsm_aes_load_key( NFKM_KeyIdent keyident, M_KeyID *keyid ) } // get usable Module - hsmModuleinfo = hsmWorld->modules[0]; - ret_code = NFKM_getusablemodule( hsmWorld, HSM_MODULE_ID, &hsmModuleinfo ); + moduleinfo = hsmWorld->modules[0]; + ret_code = NFKM_getusablemodule( hsmWorld, HSM_MODULE_ID, &moduleinfo ); if ( ret_code != CR_GENID_SUCCESS ) { SetErrorInfo( ret_code, __FILE__, __LINE__ ); @@ -338,7 +338,7 @@ int hsm_aes_load_key( NFKM_KeyIdent keyident, M_KeyID *keyid ) // load key blob blobPtr = &keyinfo->privblob; ret_code = NFKM_cmd_loadblob( hsmHandle, hsmConnection, - hsmModuleinfo->module, blobPtr, + moduleinfo->module, blobPtr, 0, keyid, "loading aes key blob", NULL ); if ( ret_code != CR_GENID_SUCCESS ) { @@ -464,6 +464,7 @@ int hsm_rsa_load_keypair( NFKM_KeyIdent keyident, M_KeyID *privKeyid, M_KeyID *p { int ret_code = CR_GENID_SUCCESS; NFKM_Key *keyinfo = NULL; + NFKM_ModuleInfo *moduleinfo = NULL; M_ByteBlock *blobPtr = NULL; // find key @@ -475,8 +476,8 @@ int hsm_rsa_load_keypair( NFKM_KeyIdent keyident, M_KeyID *privKeyid, M_KeyID *p } // get usable Module - hsmModuleinfo = hsmWorld->modules[0]; - ret_code = NFKM_getusablemodule( hsmWorld, HSM_MODULE_ID, &hsmModuleinfo ); + moduleinfo = hsmWorld->modules[0]; + ret_code = NFKM_getusablemodule( hsmWorld, HSM_MODULE_ID, &moduleinfo ); if ( ret_code != CR_GENID_SUCCESS ) { SetErrorInfo( ret_code, __FILE__, __LINE__ ); @@ -486,7 +487,7 @@ int hsm_rsa_load_keypair( NFKM_KeyIdent keyident, M_KeyID *privKeyid, M_KeyID *p // load private key blob blobPtr = &keyinfo->privblob; ret_code = NFKM_cmd_loadblob( hsmHandle, hsmConnection, - hsmModuleinfo->module, blobPtr, + moduleinfo->module, blobPtr, 0, privKeyid, "loading priv key blob", NULL ); if ( ret_code != CR_GENID_SUCCESS ) @@ -498,7 +499,7 @@ int hsm_rsa_load_keypair( NFKM_KeyIdent keyident, M_KeyID *privKeyid, M_KeyID *p // load public key blob blobPtr = &keyinfo->pubblob; ret_code = NFKM_cmd_loadblob( hsmHandle, hsmConnection, - hsmModuleinfo->module, blobPtr, + moduleinfo->module, blobPtr, 0, pubKeyid, "loading pub key blob", NULL ); if ( ret_code != CR_GENID_SUCCESS )