mirror of
https://github.com/rvtr/ctr_eFuse.git
synced 2025-11-02 00:11:04 -04:00
Moduleinfoもローカル化
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@71 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
parent
274e96d275
commit
3c0a8ea9d7
@ -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;
|
||||
|
||||
@ -134,7 +134,6 @@
|
||||
NFast_AppHandle hsmHandle;
|
||||
NFastApp_Connection hsmConnection;
|
||||
NFKM_WorldInfo *hsmWorld = NULL; // allocate
|
||||
NFKM_ModuleInfo *hsmModuleinfo = NULL;
|
||||
|
||||
// TODO: <20>Å<EFBFBD>IŒ®‚É•Ï<E280A2>X‚·‚é
|
||||
#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 )
|
||||
|
||||
Loading…
Reference in New Issue
Block a user