rsa_check_pubkey() now allows an E up to N

This commit is contained in:
Paul Bakker 2014-04-30 13:33:35 +02:00
parent 0f90d7d2b5
commit 24f37ccaed
3 changed files with 9 additions and 2 deletions

View file

@ -168,7 +168,7 @@ int rsa_check_pubkey( const rsa_context *ctx )
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
if( mpi_msb( &ctx->E ) < 2 ||
mpi_msb( &ctx->E ) > 64 )
mpi_cmp_mpi( &ctx->E, &ctx->N ) >= 0 )
return( POLARSSL_ERR_RSA_KEY_CHECK_FAILED );
return( 0 );