From 21e449db2f56b30246f2b92e3d64b7e13eaa8aaf Mon Sep 17 00:00:00 2001 From: Unknown Date: Thu, 8 Feb 2018 08:12:58 -0500 Subject: [PATCH] PK: Remove reduntant type check for RSA_ALT --- library/pk_wrap.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/library/pk_wrap.c b/library/pk_wrap.c index d90228c9e..238881e61 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -489,11 +489,9 @@ static int rsa_alt_check_pair( const mbedtls_pk_context *pub, unsigned char hash[32]; size_t sig_len = 0; int ret; - if( prv->pk_info->type == MBEDTLS_PK_RSA_ALT ) - { - if( pub->pk_info->type != MBEDTLS_PK_RSA ) - return( MBEDTLS_ERR_PK_TYPE_MISMATCH ); - } + + if( pub->pk_info->type != MBEDTLS_PK_RSA ) + return( MBEDTLS_ERR_PK_TYPE_MISMATCH ); if( rsa_alt_get_bitlen( prv->pk_ctx ) != rsa_get_bitlen( pub->pk_ctx ) ) return( MBEDTLS_ERR_RSA_KEY_CHECK_FAILED );