mirror of
				https://github.com/cuberite/polarssl.git
				synced 2025-11-04 04:32:24 -05: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
							
								
									8ca7bc42d0
								
							
						
					
					
						commit
						1ed9f99ef3
					
				@ -17,6 +17,8 @@ Bugfix
 | 
				
			|||||||
   * Fix bug in mbedtls_x509_crt_parse that caused trailing extra data in the 
 | 
					   * Fix bug in mbedtls_x509_crt_parse that caused trailing extra data in the 
 | 
				
			||||||
     buffer after DER certificates to be included in the raw representation.
 | 
					     buffer after DER certificates to be included in the raw representation.
 | 
				
			||||||
   * Fix issue that caused a hang when generating RSA keys of odd bitlength
 | 
					   * Fix issue that caused a hang 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,
 | 
				
			||||||
 | 
				
			|||||||
@ -596,7 +596,8 @@ int mbedtls_rsa_rsaes_pkcs1_v15_encrypt( mbedtls_rsa_context *ctx,
 | 
				
			|||||||
    if( mode == MBEDTLS_RSA_PRIVATE && ctx->padding != MBEDTLS_RSA_PKCS_V15 )
 | 
					    if( mode == MBEDTLS_RSA_PRIVATE && ctx->padding != MBEDTLS_RSA_PKCS_V15 )
 | 
				
			||||||
        return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
 | 
					        return( MBEDTLS_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( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
 | 
					        return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    olen = ctx->len;
 | 
					    olen = ctx->len;
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user