From 327a5c6dc2f1fdc9fe7ecf2c1ac0374600abb3e2 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Wed, 1 Apr 2015 19:38:03 -0700 Subject: [PATCH] added compile time check for Max Strength that all the requirements aren't disabled --- wolfssl/internal.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wolfssl/internal.h b/wolfssl/internal.h index 9dbf02c6c..55af1d1b9 100644 --- a/wolfssl/internal.h +++ b/wolfssl/internal.h @@ -188,6 +188,19 @@ typedef byte word24[3]; need to be switched off. Allowed suites use (EC)DHE, AES-GCM|CCM, or CHACHA-POLY. */ + +/* Check that if WOLFSSL_MAX_STRENGTH is set that all the required options are + * not turned off. */ +#if defined(WOLFSSL_MAX_STRENGTH) && \ + ((!defined(HAVE_ECC) && (defined(NO_DH) || defined(NO_RSA))) || \ + (!defined(HAVE_AESGCM) && !defined(HAVE_AESCCM) && \ + (!defined(HAVE_POLY1305) || !defined(HAVE_CHACHA))) || \ + (defined(NO_SHA256) && !defined(WOLFSSL_SHA384)) || \ + !defined(NO_OLD_TLS)) + + #error "You are trying to build max strength with requirements disabled." +#endif + #ifndef WOLFSSL_MAX_STRENGTH #if !defined(NO_RSA) && !defined(NO_RC4)