Merge remote-tracking branch 'origin/pr/2346' into mbedtls-2.16

This commit is contained in:
Jaeden Amero 2019-01-30 17:35:02 +00:00
commit 6f76795bf5
2 changed files with 8 additions and 2 deletions

View File

@ -23,6 +23,7 @@ Bugfix
* Remove a duplicate #include in a sample program. Fixed by Masashi Honma #2326. * Remove a duplicate #include in a sample program. Fixed by Masashi Honma #2326.
* Remove the mbedtls namespacing from the header file, to fix a "file not found" * Remove the mbedtls namespacing from the header file, to fix a "file not found"
build error. Fixed by Haijun Gu #2319. build error. Fixed by Haijun Gu #2319.
* Fix returning the value 1 when mbedtls_ecdsa_genkey failed.
Changes Changes
* Include configuration file in all header files that use configuration, * Include configuration file in all header files that use configuration,

View File

@ -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 */