mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-03-29 22:20:30 +00:00
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>
This commit is contained in:
parent
b86279fc63
commit
3356b89b64
@ -497,6 +497,7 @@ int mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding,
|
||||
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 @@ int mbedtls_rsa_set_padding( mbedtls_rsa_context *ctx, int padding,
|
||||
if( md_info == NULL )
|
||||
return( MBEDTLS_ERR_RSA_INVALID_PADDING );
|
||||
}
|
||||
#endif /* MBEDTLS_PKCS1_V21 */
|
||||
|
||||
ctx->padding = padding;
|
||||
ctx->hash_id = hash_id;
|
||||
|
Loading…
x
Reference in New Issue
Block a user