mirror of
https://git.suyu.dev/suyu/mbedtls.git
synced 2025-12-23 15:55:10 +01:00
Restore P>Q in RSA key generation (#558)
The PKCS#1 standard says nothing about the relation between P and Q but many libraries guarantee P>Q and mbed TLS did so too in earlier versions. This commit restores this behaviour.
This commit is contained in:
parent
468a84c7df
commit
e5dc202469
4 changed files with 11 additions and 11 deletions
|
|
@ -361,7 +361,7 @@ RSA Generate Key - 2048 bit key
|
|||
mbedtls_rsa_gen_key:2048:3:0
|
||||
|
||||
RSA Generate Key - 1025 bit key
|
||||
mbedtls_rsa_gen_key:1025:3:0
|
||||
mbedtls_rsa_gen_key:1025:3:MBEDTLS_ERR_RSA_BAD_INPUT_DATA
|
||||
|
||||
RSA PKCS1 Encrypt Bad RNG
|
||||
depends_on:MBEDTLS_PKCS1_V15
|
||||
|
|
|
|||
|
|
@ -678,6 +678,7 @@ void mbedtls_rsa_gen_key( int nrbits, int exponent, int result)
|
|||
if( result == 0 )
|
||||
{
|
||||
TEST_ASSERT( mbedtls_rsa_check_privkey( &ctx ) == 0 );
|
||||
TEST_ASSERT( mbedtls_mpi_cmp_mpi( &ctx.P, &ctx.Q ) > 0 );
|
||||
}
|
||||
|
||||
exit:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue