diff --git a/src/internal.c b/src/internal.c index 42e8ac540..cbea8d139 100644 --- a/src/internal.c +++ b/src/internal.c @@ -14887,7 +14887,7 @@ int ProcessReply(WOLFSSL* ssl) return ssl->error; } -#ifdef WOLFSSL_ASYNC_CRYPT +#if defined(WOLFSSL_DTLS) && defined(WOLFSSL_ASYNC_CRYPT) /* process any pending DTLS messages - this flow can happen with async */ if (ssl->dtls_rx_msg_list != NULL) { ret = DtlsMsgDrain(ssl); diff --git a/wolfssl/wolfcrypt/wc_encrypt.h b/wolfssl/wolfcrypt/wc_encrypt.h index 6d26e2cba..a5c33807d 100644 --- a/wolfssl/wolfcrypt/wc_encrypt.h +++ b/wolfssl/wolfcrypt/wc_encrypt.h @@ -28,24 +28,33 @@ #define WOLF_CRYPT_ENCRYPT_H #include -#include -#include -#include -#include +#ifndef NO_AES + #include +#endif +#ifdef HAVE_CHACHA + #include +#endif +#ifndef NO_DES3 + #include +#endif +#ifndef NO_RC4 + #include +#endif #ifdef __cplusplus extern "C" { #endif -/* determine max cipher key size */ +/* determine max cipher key size - cannot use enum values here, must be define, + * since WC_MAX_SYM_KEY_SIZE is used in if macro logic. */ #ifndef NO_AES #define WC_MAX_SYM_KEY_SIZE (AES_MAX_KEY_SIZE/8) #elif defined(HAVE_CHACHA) - #define WC_MAX_SYM_KEY_SIZE CHACHA_MAX_KEY_SZ + #define WC_MAX_SYM_KEY_SIZE 32 /* CHACHA_MAX_KEY_SZ */ #elif !defined(NO_DES3) - #define WC_MAX_SYM_KEY_SIZE DES3_KEY_SIZE + #define WC_MAX_SYM_KEY_SIZE 24 /* DES3_KEY_SIZE */ #elif !defined(NO_RC4) - #define WC_MAX_SYM_KEY_SIZE RC4_KEY_SIZE + #define WC_MAX_SYM_KEY_SIZE 16 /* RC4_KEY_SIZE */ #else #define WC_MAX_SYM_KEY_SIZE 32 #endif