From d1428568466976c26d0b1fc09185c30219984041 Mon Sep 17 00:00:00 2001 From: Andrzej Kurek Date: Tue, 5 Feb 2019 05:11:03 -0500 Subject: [PATCH] cipher: remove unnecessary precondition Already checked by parameter validation macros --- library/cipher.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/library/cipher.c b/library/cipher.c index 2636c090c..2465536c9 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -283,12 +283,6 @@ int mbedtls_cipher_setkey( mbedtls_cipher_context_t *ctx, if( ctx->cipher_info == NULL ) return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA ); - if( operation != MBEDTLS_DECRYPT && - operation != MBEDTLS_ENCRYPT ) - { - return( MBEDTLS_ERR_CIPHER_BAD_INPUT_DATA ); - } - #if defined(MBEDTLS_USE_PSA_CRYPTO) if( ctx->psa_enabled == 1 ) {