mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-25 13:43:31 +00: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 ecdsa_from_keypair( ecdsa_context *ctx, const ecp_keypair *key )
|
||||||
{
|
{
|
||||||
int ret = ecp_group_copy( &ctx->grp, &key->grp ) ||
|
int ret;
|
||||||
mpi_copy( &ctx->d, &key->d ) ||
|
|
||||||
ecp_copy( &ctx->Q, &key->Q );
|
|
||||||
|
|
||||||
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 );
|
ecdsa_free( ctx );
|
||||||
|
}
|
||||||
|
|
||||||
return( ret );
|
return( ret );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user