mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 00:05:36 +01:00
Fix return value of ecdsa_from_keypair()
This commit is contained in:
parent
21ef42f257
commit
1001e32d6f
@ -291,12 +291,14 @@ int ecdsa_genkey( ecdsa_context *ctx, ecp_group_id gid,
|
||||
*/
|
||||
int ecdsa_from_keypair( ecdsa_context *ctx, const ecp_keypair *key )
|
||||
{
|
||||
int ret = ecp_group_copy( &ctx->grp, &key->grp ) ||
|
||||
mpi_copy( &ctx->d, &key->d ) ||
|
||||
ecp_copy( &ctx->Q, &key->Q );
|
||||
int ret;
|
||||
|
||||
if( ret != 0 )
|
||||
if( ( ret = ecp_group_copy( &ctx->grp, &key->grp ) ) != 0 ||
|
||||
( ret = mpi_copy( &ctx->d, &key->d ) ) != 0 ||
|
||||
( ret = ecp_copy( &ctx->Q, &key->Q ) ) != 0 )
|
||||
{
|
||||
ecdsa_free( ctx );
|
||||
}
|
||||
|
||||
return( ret );
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user