From ab8d58cb2d0653c84ca44a8d9e3486ed8b9de930 Mon Sep 17 00:00:00 2001 From: Ron Eldor Date: Sun, 17 Jun 2018 14:39:30 +0300 Subject: [PATCH] Move definition of MBEDTLS_CIPHER_MODE_STREAM Move definition of `MBEDTLS_CIPHER_MODE_STREAM` to header file (`mbedtls_cipher_internal.h`), because it is used by more than one file. Raised by TrinityTonic in #1719 --- include/mbedtls/cipher_internal.h | 4 ++++ library/cipher.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/include/mbedtls/cipher_internal.h b/include/mbedtls/cipher_internal.h index c6def0bef7..56107cfffc 100644 --- a/include/mbedtls/cipher_internal.h +++ b/include/mbedtls/cipher_internal.h @@ -34,6 +34,10 @@ #include "cipher.h" +#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) +#define MBEDTLS_CIPHER_MODE_STREAM +#endif + #ifdef __cplusplus extern "C" { #endif diff --git a/library/cipher.c b/library/cipher.c index a913913f04..7ae6c4ac5d 100644 --- a/library/cipher.c +++ b/library/cipher.c @@ -65,11 +65,6 @@ #define mbedtls_free free #endif -#if defined(MBEDTLS_ARC4_C) || defined(MBEDTLS_CIPHER_NULL_CIPHER) -#define MBEDTLS_CIPHER_MODE_STREAM -#endif - - #if defined(MBEDTLS_GCM_C) || defined(MBEDTLS_CHACHAPOLY_C) /* Compare the contents of two buffers in constant time. * Returns 0 if the contents are bitwise identical, otherwise returns