Added build option checks to tls.c and tls13.c

Set tls.c and tls13.c to abort if the library is built with TLS 1.3 and not
HAVE_TLS_EXTENSIONS
This commit is contained in:
abrahamsonn
2019-04-26 15:32:38 -06:00
parent bbb72946b7
commit ef29aa94ea
2 changed files with 18 additions and 2 deletions

View File

@ -63,12 +63,13 @@
static int TLSX_KeyShare_IsSupported(int namedGroup);
#endif
#if (!defined(NO_WOLFSSL_SERVER) && defined(WOLFSSL_TLS13) && \
#if ((!defined(NO_WOLFSSL_SERVER) && defined(WOLFSSL_TLS13) && \
!defined(WOLFSSL_NO_SERVER_GROUPS_EXT)) || \
(defined(WOLFSSL_TLS13) && !defined(HAVE_ECC) && \
!defined(HAVE_CURVE25519) && defined(HAVE_SUPPORTED_CURVES)) || \
((defined(HAVE_ECC) || defined(HAVE_CURVE25519)) && \
defined(HAVE_SUPPORTED_CURVES))
defined(HAVE_SUPPORTED_CURVES))) && \
defined(HAVE_TLS_EXTENSIONS)
static int TLSX_PopulateSupportedGroups(WOLFSSL* ssl, TLSX** extensions);
#endif
@ -97,6 +98,13 @@ static int TLSX_PopulateSupportedGroups(WOLFSSL* ssl, TLSX** extensions);
#if !defined(NO_RSA) && !defined(WC_RSA_PSS)
#error The build option WC_RSA_PSS is required for TLS 1.3 with RSA
#endif
#ifndef HAVE_TLS_EXTENSIONS
#ifndef _MSC_VER
#error "The build option HAVE_TLS_EXTENSIONS is required for TLS 1.3"
#else
#pragma message("Error: The build option HAVE_TLS_EXTENSIONS is required for TLS 1.3")
#endif
#endif
#endif
/* Warn if secrets logging is enabled */

View File

@ -134,6 +134,14 @@
#error The build option HAVE_HKDF is required for TLS 1.3
#endif
#ifndef HAVE_TLS_EXTENSIONS
#ifndef _MSC_VER
#error "The build option HAVE_TLS_EXTENSIONS is required for TLS 1.3"
#else
#pragma message("error: The build option HAVE_TLS_EXTENSIONS is required for TLS 1.3")
#endif
#endif
/* Set ret to error value and jump to label.
*