From 44f6390c32f2f6208a10734cfbcd2fe0e38f2173 Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Thu, 8 Jul 2021 12:46:26 +0100 Subject: [PATCH] Remove redundant hash len check Remove a check in rsa_rsassa_pkcs1_v15_encode() that is not needed because the same check is performed earlier. This check was added in #4707. Signed-off-by: David Horstmann --- library/rsa.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/rsa.c b/library/rsa.c index ed1632a35..e818e6dae 100644 --- a/library/rsa.c +++ b/library/rsa.c @@ -2023,8 +2023,6 @@ static int rsa_rsassa_pkcs1_v15_encode( mbedtls_md_type_t md_alg, * TAG-NULL + LEN [ NULL ] ] * TAG-OCTET + LEN [ HASH ] ] */ - if( 0x08 + oid_size + hashlen >= 0x80 ) - return( MBEDTLS_ERR_RSA_BAD_INPUT_DATA ); *p++ = MBEDTLS_ASN1_SEQUENCE | MBEDTLS_ASN1_CONSTRUCTED; *p++ = (unsigned char)( 0x08 + oid_size + hashlen ); *p++ = MBEDTLS_ASN1_SEQUENCE | MBEDTLS_ASN1_CONSTRUCTED;