アロケータの設定前にOPENSSL_mallocが呼び出されると以後、設定不可になる不具合を修正

git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@167 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
kubodera_yuichi 2010-01-08 14:43:54 +00:00
parent b15633a4e4
commit 4c033494c2
2 changed files with 8 additions and 7 deletions

View File

@ -210,9 +210,6 @@ int cr_generate_id( u32 device_id[CR_NUM_OF_DEVICEID], u8 id_buf[CR_ID_BUF_SIZE]
}
#endif
// ダイジェストアルゴリズムを追加する
OpenSSL_add_all_digests();
//--------------------------------------------------------------
// 暗号処理初期化
//--------------------------------------------------------------
@ -225,6 +222,9 @@ int cr_generate_id( u32 device_id[CR_NUM_OF_DEVICEID], u8 id_buf[CR_ID_BUF_SIZE]
ERR_load_crypto_strings();
#endif /* MY_CRYPTO_DEBUG */
// ダイジェストアルゴリズムを追加する
OpenSSL_add_all_digests();
//--------------------------------------------------------------
// FuseIDバッファに固定データセット
//--------------------------------------------------------------

View File

@ -944,7 +944,7 @@ int hsm_ecdsa_sign( unsigned char *sign_buf, unsigned char *data_buf, unsigned c
my_bignumCopy( &rBn, reply.reply.sign.sig.data.ecdsa.r, hsmHandle );
my_bignumCopy( &sBn, reply.reply.sign.sig.data.ecdsa.s, hsmHandle );
//NFastApp_Free_Command( handle, NULL, NULL, &cmd );
NFastApp_Free_Command( hsmHandle, NULL, NULL, &cmd );
NFastApp_Free_Reply( hsmHandle, NULL, NULL, &reply );
memset( &cmd, 0, sizeof( cmd ) );
memset( &reply, 0, sizeof( reply ) );
@ -979,7 +979,10 @@ int hsm_ecdsa_sign( unsigned char *sign_buf, unsigned char *data_buf, unsigned c
NFastApp_Free( hsmHandle, rBn, NULL, NULL );
NFastApp_Free( hsmHandle, sBn, NULL, NULL );
#else // !verify
NFastApp_Free_Command( hsmHandle, NULL, NULL, &cmd );
#endif // verify
NFastApp_Free_Reply( hsmHandle, NULL, NULL, &reply );
// copy sign
int i;
@ -1000,8 +1003,6 @@ int hsm_ecdsa_sign( unsigned char *sign_buf, unsigned char *data_buf, unsigned c
sign_buf[ 60 - i - 1 ] = sPtr[ sLen - i - 1 ];
}
//NFastApp_Free_Command( hsmHandle, NULL, NULL, &cmd ); // 何故かアボートする
NFastApp_Free_Reply( hsmHandle, NULL, NULL, &reply );
cr_mem_free( rPtr );
cr_mem_free( sPtr );