mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 04:45:35 +00:00
pk_wrap: check if curve conversion is successful
This commit is contained in:
parent
ea84233e02
commit
b3d1b12177
|
@ -677,6 +677,9 @@ static int ecdsa_verify_wrap( void *ctx, mbedtls_md_type_t md_alg,
|
||||||
psa_algorithm_t psa_sig_md = PSA_ALG_ECDSA( translate_md_to_psa( md_alg ) );
|
psa_algorithm_t psa_sig_md = PSA_ALG_ECDSA( translate_md_to_psa( md_alg ) );
|
||||||
psa_ecc_curve_t curve = mbedtls_ecc_group_to_psa ( ( (mbedtls_ecdsa_context *) ctx )->grp.id );
|
psa_ecc_curve_t curve = mbedtls_ecc_group_to_psa ( ( (mbedtls_ecdsa_context *) ctx )->grp.id );
|
||||||
|
|
||||||
|
if( curve == 0 )
|
||||||
|
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
|
||||||
|
|
||||||
memset( &signature, 0, sizeof( mbedtls_asn1_buf ) );
|
memset( &signature, 0, sizeof( mbedtls_asn1_buf ) );
|
||||||
key.pk_info = &pk_info;
|
key.pk_info = &pk_info;
|
||||||
key.pk_ctx = ctx;
|
key.pk_ctx = ctx;
|
||||||
|
|
Loading…
Reference in a new issue