Bring compat layer logic from configure.ac into settings.h

This commit is contained in:
Anthony Hu 2023-08-10 22:07:26 -04:00
parent 65401cfd35
commit 507ec9f7d2
4 changed files with 41 additions and 15 deletions

View File

@ -411,12 +411,7 @@ endif()
if (WOLFSSL_OPENSSLEXTRA AND NOT WOLFSSL_OPENSSLCOEXIST)
list(APPEND WOLFSSL_DEFINITIONS
"-DOPENSSL_EXTRA"
"-DWOLFSSL_ALWAYS_VERIFY_CB"
"-DWOLFSSL_VERIFY_CB_ALL_CERTS"
"-DWOLFSSL_EXTRA_ALERTS"
"-DHAVE_EXT_CACHE"
"-DWOLFSSL_FORCE_CACHE_ON_TICKET")
"-DOPENSSL_EXTRA")
endif()
if (WOLFSSL_OPENSSLALL)

View File

@ -8411,18 +8411,13 @@ fi
if test "$ENABLED_OPENSSLEXTRA" = "yes" && test "x$ENABLED_OPENSSLCOEXIST" = "xno"
then
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA -DWOLFSSL_ALWAYS_VERIFY_CB"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_VERIFY_CB_ALL_CERTS -DWOLFSSL_EXTRA_ALERTS"
AM_CFLAGS="$AM_CFLAGS -DHAVE_EXT_CACHE -DWOLFSSL_FORCE_CACHE_ON_TICKET"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_AKID_NAME -DHAVE_CTS"
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA"
fi
if test "$ENABLED_OPENSSLEXTRA" = "x509small"
then
AC_MSG_NOTICE([Enabling only a subset of X509 opensslextra])
AM_CFLAGS="$AM_CFLAGS -DOPENSSL_EXTRA_X509_SMALL"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_EKU_OID -DWOLFSSL_MULTI_ATTRIB"
AM_CFLAGS="$AM_CFLAGS -DWOLFSSL_NO_OPENSSL_RAND_CB"
fi
if test "$ENABLED_WOLFSCEP" = "yes"

View File

@ -392,7 +392,9 @@ typedef struct CertExtension {
} CertExtension;
#endif
#if defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
#if defined(WOLFSSL_CERT_GEN) || defined(OPENSSL_EXTRA) || \
defined(OPENSSL_EXTRA_X509_SMALL) || defined(WOLFSSL_CERT_EXT) || \
defined(WOLFSSL_CERT_REQ)
typedef struct CertName {
char country[CTC_NAME_SIZE];
char countryEnc;

View File

@ -312,6 +312,42 @@
#endif
#endif
/* OpenSSL compat layer */
#if defined(OPENSSL_EXTRA) && !defined(OPENSSL_COEXIST)
#undef WOLFSSL_ALWAYS_VERIFY_CB
#define WOLFSSL_ALWAYS_VERIFY_CB
#undef WOLFSSL_VERIFY_CB_ALL_CERTS
#define WOLFSSL_VERIFY_CB_ALL_CERTS
#undef WOLFSSL_EXTRA_ALERTS
#define WOLFSSL_EXTRA_ALERTS
#undef HAVE_EXT_CACHE
#define HAVE_EXT_CACHE
#undef WOLFSSL_FORCE_CACHE_ON_TICKET
#define WOLFSSL_FORCE_CACHE_ON_TICKET
#undef WOLFSSL_AKID_NAME
#define WOLFSSL_AKID_NAME
#undef HAVE_CTS
#define HAVE_CTS
#endif /* OPENSSL_EXTRA && !OPENSSL_COEXIST */
/* Special small OpenSSL compat layer for certs */
#ifdef OPENSSL_EXTRA_X509_SMALL
#undef WOLFSSL_EKU_OID
#define WOLFSSL_EKU_OID
#undef WOLFSSL_MULTI_ATTRIB
#define WOLFSSL_MULTI_ATTRIB
#undef WOLFSSL_NO_OPENSSL_RAND_CB
#define WOLFSSL_NO_OPENSSL_RAND_CB
#endif /* OPENSSL_EXTRA_X509_SMALL */
#if defined(_WIN32) && !defined(_M_X64) && \
defined(HAVE_AESGCM) && defined(WOLFSSL_AESNI)
@ -2020,8 +2056,6 @@ extern void uITRON4_free(void *p) ;
#pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
#endif
/* ---------------------------------------------------------------------------
* Math Library Selection (in order of preference)
* ---------------------------------------------------------------------------