From 63ca260827c6ab0c6706a97ed22f0135d37032f1 Mon Sep 17 00:00:00 2001 From: David Brown Date: Tue, 26 Jan 2021 11:51:12 -0700 Subject: [PATCH] Change psa_crypto.c ifdefs for cipher modes Change to use the MBEDTLS_PSA_BUILTIN... macros defined by the cipher modes. Signed-off-by: David Brown --- library/psa_crypto.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 40d28d9d6..c48b2f928 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -3896,7 +3896,8 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation, if( ret != 0 ) goto exit; -#if defined(MBEDTLS_CIPHER_MODE_WITH_PADDING) +#if defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING) || \ + defined(MBEDTLS_PSA_BUILTIN_ALG_CBC_PKCS7) switch( alg ) { case PSA_ALG_CBC_NO_PADDING: @@ -3914,7 +3915,7 @@ static psa_status_t psa_cipher_setup( psa_cipher_operation_t *operation, } if( ret != 0 ) goto exit; -#endif //MBEDTLS_CIPHER_MODE_WITH_PADDING +#endif /* MBEDTLS_PSA_BUILTIN_ALG_CBC_NO_PADDING || MBEDTLS_PADDING_PKCS7 */ operation->block_size = ( PSA_ALG_IS_STREAM_CIPHER( alg ) ? 1 : PSA_BLOCK_CIPHER_BLOCK_LENGTH( slot->attr.type ) );