mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-30 10:44:20 +01:00
Fix null pointer dereference in the RSA module.
Introduced null pointer checks in mbedtls_rsa_rsaes_pkcs1_v15_encrypt
This commit is contained in:
parent
e9f842782b
commit
7ddc2cdfce
@ -8,6 +8,8 @@ Bugfix
|
|||||||
Follath. #309
|
Follath. #309
|
||||||
* Fix issue in Makefile that prevented building using armar. #386
|
* Fix issue in Makefile that prevented building using armar. #386
|
||||||
* Fix issue that caused a hang up when generating RSA keys of odd bitlength
|
* Fix issue that caused a hang up when generating RSA keys of odd bitlength
|
||||||
|
* Fix bug in mbedtls_rsa_rsaes_pkcs1_v15_encrypt that made null pointer
|
||||||
|
dereference possible.
|
||||||
|
|
||||||
Changes
|
Changes
|
||||||
* On ARM platforms, when compiling with -O0 with GCC, Clang or armcc5,
|
* On ARM platforms, when compiling with -O0 with GCC, Clang or armcc5,
|
||||||
|
@ -586,7 +586,8 @@ int rsa_rsaes_pkcs1_v15_encrypt( rsa_context *ctx,
|
|||||||
if( mode == RSA_PRIVATE && ctx->padding != RSA_PKCS_V15 )
|
if( mode == RSA_PRIVATE && ctx->padding != RSA_PKCS_V15 )
|
||||||
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
||||||
|
|
||||||
if( f_rng == NULL )
|
// We don't check p_rng because it won't be dereferenced here
|
||||||
|
if( f_rng == NULL || input == NULL || output == NULL )
|
||||||
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
return( POLARSSL_ERR_RSA_BAD_INPUT_DATA );
|
||||||
|
|
||||||
olen = ctx->len;
|
olen = ctx->len;
|
||||||
|
Loading…
Reference in New Issue
Block a user