Add missing guard around call to MD
PKCS#1 v1.5 mostly does not need hash operations. This is a first step
towards allowing builds with PKCS#1 v1.5 only (no v2.1) without MD.
Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
diff --git a/library/rsa.c b/library/rsa.c
index e95768f..20983c8 100644
--- a/library/rsa.c
+++ b/library/rsa.c
@@ -497,6 +497,7 @@
return( MBEDTLS_ERR_RSA_INVALID_PADDING );
}
+#if defined(MBEDTLS_PKCS1_V21)
if( ( padding == MBEDTLS_RSA_PKCS_V21 ) &&
( hash_id != MBEDTLS_MD_NONE ) )
{
@@ -506,6 +507,7 @@
if( md_info == NULL )
return( MBEDTLS_ERR_RSA_INVALID_PADDING );
}
+#endif /* MBEDTLS_PKCS1_V21 */
ctx->padding = padding;
ctx->hash_id = hash_id;