mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-10 22:25:28 +00:00
Return error code of underlying function.
Return the error code if failed, instead of returning value `1`. If not failed, return the call of the underlying function, in `mbedtls_ecdsa_genkey()`.
This commit is contained in:
parent
fb1972db23
commit
adb5234aa9
|
@ -800,11 +800,16 @@ cleanup:
|
||||||
int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid,
|
int mbedtls_ecdsa_genkey( mbedtls_ecdsa_context *ctx, mbedtls_ecp_group_id gid,
|
||||||
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
|
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
|
||||||
{
|
{
|
||||||
|
int ret = 0;
|
||||||
ECDSA_VALIDATE_RET( ctx != NULL );
|
ECDSA_VALIDATE_RET( ctx != NULL );
|
||||||
ECDSA_VALIDATE_RET( f_rng != NULL );
|
ECDSA_VALIDATE_RET( f_rng != NULL );
|
||||||
|
|
||||||
return( mbedtls_ecp_group_load( &ctx->grp, gid ) ||
|
ret = mbedtls_ecp_group_load( &ctx->grp, gid );
|
||||||
mbedtls_ecp_gen_keypair( &ctx->grp, &ctx->d, &ctx->Q, f_rng, p_rng ) );
|
if( ret != 0 )
|
||||||
|
return( ret );
|
||||||
|
|
||||||
|
return( mbedtls_ecp_gen_keypair( &ctx->grp, &ctx->d,
|
||||||
|
&ctx->Q, f_rng, p_rng ) );
|
||||||
}
|
}
|
||||||
#endif /* !MBEDTLS_ECDSA_GENKEY_ALT */
|
#endif /* !MBEDTLS_ECDSA_GENKEY_ALT */
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue