mirror of
https://github.com/rvtr/ctr_eFuse.git
synced 2025-11-02 00:11:04 -04:00
ECDSA-SHA256のOpenSSL署名検証に成功(crypto/ecdsa/ecs_ossl.c の改変が必要)
git-svn-id: file:///Volumes/Transfer/gigaleak_20231201/2020-09-30%20-%20paladin.7z/paladin/ctr_eFuse@184 ff987cc8-cf2f-4642-8568-d52cce064691
This commit is contained in:
parent
0e78820d58
commit
0affc65359
@ -389,26 +389,17 @@ int GenerateCTRDeviceCert( EC_KEY *pECkey, u32 device_id, u8 bonding_option, u8
|
||||
memcpy( &signBuf[0x24], &deviceCert.eccSignature[30], 0x1E );
|
||||
DEBUG_PRINT_ARRAY( (char*)"sign(HSM)", (const char *)signBuf, signLen );
|
||||
|
||||
#ifdef ECDSA_SHA256
|
||||
// TODO : ECDSA-SHA256 での検証を通す
|
||||
#if 0
|
||||
// 署名ベリファイ
|
||||
ret_code = ECDSA_verify( 0, verifyHash, 30, signBuf, signLen, NCT2 );
|
||||
#ifdef ECDSA_SHA256
|
||||
ret_code = ECDSA_verify( 0, sha256Buf, 32, signBuf, signLen, NCT2 );
|
||||
#else // !ECDSA_SHA256
|
||||
ret_code = ECDSA_verify( 0, sha1Buf, 20, signBuf, signLen, NCT2 );
|
||||
#endif // ECDSA_SHA256
|
||||
if( ret_code != 1) {
|
||||
ret_code = CR_GENID_ERROR_ECDSA_VERIFY;
|
||||
SetErrorInfo( __FUNCTION__, __LINE__ );
|
||||
goto end;
|
||||
}
|
||||
#endif
|
||||
#else // !ECDSA_SHA256
|
||||
// 署名ベリファイ
|
||||
ret_code = ECDSA_verify( 0, sha1Buf, 20, signBuf, signLen, NCT2 );
|
||||
if( ret_code != 1) {
|
||||
ret_code = CR_GENID_ERROR_ECDSA_VERIFY;
|
||||
SetErrorInfo( __FUNCTION__, __LINE__ );
|
||||
goto end;
|
||||
}
|
||||
#endif // ECDSA_SHA256
|
||||
}
|
||||
|
||||
ret_code = CR_GENID_SUCCESS;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user