r52のビルドを通す

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@53 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2009-12-23 06:23:54 +00:00
parent 7b30aa63d7
commit 66a4e33f1e
2 changed files with 10 additions and 8 deletions

View File

@ -146,7 +146,7 @@ M_KeyID hsmAesKeyidDev, hsmAesKeyidProd;
const NFKM_KeyIdent hsmAesKeyidentDev = { (char*)"simple", (char*)"aes-dummykey-dev" };
const NFKM_KeyIdent hsmAesKeyidentProd = { (char*)"simple", (char*)"aes-dummykey-prod" };
static int hsm_aes_load_key( NFKM_KeyIdent keyident, NFKM_Key *keyinfo, M_KeyID *keyid );
static int hsm_aes_load_key( NFKM_KeyIdent keyident, M_KeyID *keyid );
#else // !ENCRYPT_AES
M_KeyID hsmRsaPrivkeyid, hsmRsaPubkeyid;
const NFKM_KeyIdent hsmRsakeyident = { (char*)"simple", (char*)"rsa-dummy-keypair" };
@ -230,14 +230,14 @@ int hsm_initialize( void )
// TODO: 開発実機鍵/製品実機鍵の両方をロードするようにする。
#ifdef ENCRYPT_AES
// load aes dev key
ret_code = hsm_aes_load_key( hsmAesKeyidentDev, hsmAesKeyinfoDev, &hsmAesKeyidDev );
ret_code = hsm_aes_load_key( hsmAesKeyidentDev, &hsmAesKeyidDev );
if ( ret_code != CR_GENID_SUCCESS )
{
return ret_code;
}
// load aes prod key
ret_code = hsm_aes_load_key( hsmAesKeyidentProd, hsmAesKeyinfoProd, &hsmAesKeyidProd );
ret_code = hsm_aes_load_key( hsmAesKeyidentProd, &hsmAesKeyidProd );
if ( ret_code != CR_GENID_SUCCESS )
{
return ret_code;
@ -261,8 +261,7 @@ void hsm_finalize( void )
// TODO: 開発実機鍵/製品実機鍵の両方を処理するようにする。
#ifdef ENCRYPT_AES
NFKM_freekey( hsmHandle, hsmAesKeyinfoDev, NULL );
NFKM_freekey( hsmHandle, hsmAesKeyinfoProd, NULL );
#else // !ENCRYPT_AES
NFKM_freekey( hsmHandle, hsmRsakeyinfo, NULL );
#endif // ENCRYPT_AES
@ -341,6 +340,7 @@ int hsm_get_rtc( time_t *time )
int hsm_aes_load_key( NFKM_KeyIdent keyident, NFKM_KEY *keyinfo, M_KeyID *keyid )
{
int ret_code = CR_GENID_SUCCESS;
NFKM_Key keyinfo = NULL;
// find key
ret_code = NFKM_findkey( hsmHandle, keyident, &keyinfo, NULL );
@ -358,7 +358,7 @@ int hsm_aes_load_key( NFKM_KeyIdent keyident, NFKM_KEY *keyinfo, M_KeyID *keyid
}
// load key blob
hsmBlobptr = &hsmAeskeyinfo->privblob;
hsmBlobptr = &keyinfo->privblob;
ret_code = NFKM_cmd_loadblob( hsmHandle, hsmConnection,
hsmModuleinfo->module, hsmBlobptr,
hsmLtid, keyid, "loading aes key blob", NULL );
@ -367,6 +367,8 @@ int hsm_aes_load_key( NFKM_KeyIdent keyident, NFKM_KEY *keyinfo, M_KeyID *keyid
return ret_code;
}
NFKM_freekey( hsmHandle, keyinfo, NULL );
return CR_GENID_SUCCESS;
} // hsm_aes_load_key

View File

@ -123,8 +123,8 @@ int hsm_initialize( void );
void hsm_finalize( void );
int hsm_generate_random( unsigned char *buf, int bytes );
int hsm_get_rtc( time_t *time );
int hsm_aes_encrypt( unsigned char *dst_buf, unsigned char *org_buf, int size, u8 bondingOption );
int hsm_aes_decrypt( unsigned char *dst_buf, unsigned char *org_buf, int size, u8 bondingOption );
int hsm_aes_encrypt( unsigned char *dst_buf, unsigned char *org_buf, int size, unsigned char bondingOption );
int hsm_aes_decrypt( unsigned char *dst_buf, unsigned char *org_buf, int size, unsigned char bondingOption );
int hsm_rsa_encrypt( unsigned char *dst_buf, unsigned char *org_buf, int size );
int hsm_rsa_decrypt( unsigned char *dst_buf, unsigned char *org_buf, int size );