Merge pull request #8262 from embhorn/zd18968

Add sanity check for configuration method
This commit is contained in:
JacobBarthelmeh
2024-12-09 21:22:54 -07:00
committed by GitHub
11 changed files with 34 additions and 9 deletions

View File

@ -599,6 +599,7 @@ WOLFSSL_CLANG_TIDY
WOLFSSL_COMMERCIAL_LICENSE
WOLFSSL_CONTIKI
WOLFSSL_CRL_ALLOW_MISSING_CDP
WOLFSSL_CUSTOM_CONFIG
WOLFSSL_DILITHIUM_ASSIGN_KEY
WOLFSSL_DILITHIUM_MAKE_KEY_SMALL_MEM
WOLFSSL_DILITHIUM_NO_ASN1

View File

@ -24,10 +24,10 @@
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
/* Force enable the compatibility macros for this example */
#undef TEST_OPENSSL_COEXIST

View File

@ -24,6 +24,9 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifdef MICROCHIP_MPLAB_HARMONY

View File

@ -27,9 +27,12 @@
#include <config.h>
#endif
/* mc api header */
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
/* mc api header */
#include "crypto.h"
/* sanity test against our default implementation, wolfssl headers */

View File

@ -92,12 +92,6 @@
* pair
*/
#ifdef EXTERNAL_OPTS_OPENVPN
#error EXTERNAL_OPTS_OPENVPN should not be defined\
when building wolfSSL
#endif
#ifndef WOLFCRYPT_ONLY
#include <wolfssl/internal.h>

View File

@ -24,6 +24,9 @@
#include <config.h>
#endif
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/types.h>
#include <wolfssl/wolfcrypt/logging.h>

View File

@ -24,6 +24,9 @@
#include <config.h>
#endif
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#include <tests/unit.h>

View File

@ -24,10 +24,10 @@
#include <config.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#ifndef WOLFSSL_USER_SETTINGS
#include <wolfssl/options.h>
#endif
#include <wolfssl/wolfcrypt/settings.h>
#undef TEST_OPENSSL_COEXIST /* can't use this option with this example */
#undef OPENSSL_COEXIST /* can't use this option with this example */

View File

@ -28,6 +28,8 @@
*
* ./configure CFLAGS="-DFEATURE_FLAG_TO_DEFINE -UFEATURE_FLAG_TO_CLEAR [...]"
*
* To build using a custom configuration method, define WOLFSSL_CUSTOM_CONFIG
*
* For more information see:
*
* https://www.wolfssl.com/how-do-i-manage-the-build-configuration-of-wolfssl/
@ -317,6 +319,12 @@
#endif
#endif
#if (defined(BUILDING_WOLFSSL) && defined(WOLFSSL_USE_OPTIONS_H)) || \
(defined(BUILDING_WOLFSSL) && defined(WOLFSSL_OPTIONS_H) && \
!defined(EXTERNAL_OPTS_OPENVPN))
#error wolfssl/options.h included in compiled wolfssl library object.
#endif
#ifdef WOLFSSL_USER_SETTINGS
#include "user_settings.h"
#elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H)
@ -326,6 +334,12 @@
/* NOTE: cyassl_nucleus_defs.h is akin to user_settings.h */
#include "nucleus.h"
#include "os/networking/ssl/lite/cyassl_nucleus_defs.h"
#elif !defined(BUILDING_WOLFSSL) && !defined(WOLFSSL_OPTIONS_H) && \
!defined(WOLFSSL_CUSTOM_CONFIG)
/* This warning indicates that the settings header may not be included before
* other wolfSSL headers. If you are using a custom configuration method,
* define WOLFSSL_CUSTOM_CONFIG to override this error. */
#warning "No configuration for wolfSSL detected, check header order"
#endif
#include <wolfssl/wolfcrypt/visibility.h>

View File

@ -34,6 +34,10 @@ decouple library dependencies with standard string, memory and so on.
#include <wolfssl/wolfcrypt/settings.h>
#include <wolfssl/wolfcrypt/wc_port.h>
#if defined(EXTERNAL_OPTS_OPENVPN) && defined(BUILDING_WOLFSSL)
#error EXTERNAL_OPTS_OPENVPN should not be defined in compiled wolfssl library files.
#endif
#ifdef __APPLE__
#include <AvailabilityMacros.h>
#endif