From 6f0ea40870bed5f7e7735e1b126512ad663cca1d Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Mon, 9 Dec 2024 14:49:53 -0600 Subject: [PATCH] move !defined(EXTERNAL_OPTS_OPENVPN) assert from src/internal.c to wolfssl/wolfcrypt/types.h; refine logic+message of assert in wolfssl/wolfcrypt/settings.h re "wolfssl/options.h included in compiled wolfssl library object..". --- src/internal.c | 6 ------ wolfssl/wolfcrypt/settings.h | 6 ++++-- wolfssl/wolfcrypt/types.h | 4 ++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/internal.c b/src/internal.c index f8d014b30d..8f5babacfb 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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 diff --git a/wolfssl/wolfcrypt/settings.h b/wolfssl/wolfcrypt/settings.h index 40c76a19a7..9316a92a27 100644 --- a/wolfssl/wolfcrypt/settings.h +++ b/wolfssl/wolfcrypt/settings.h @@ -319,8 +319,10 @@ #endif #endif -#if defined(BUILDING_WOLFSSL) && defined(WOLFSSL_OPTIONS_H) - #error wolfssl/options.h included in build of library object. +#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 diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index 5fb14b88a3..e77ba2adb8 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -34,6 +34,10 @@ decouple library dependencies with standard string, memory and so on. #include #include + #ifdef EXTERNAL_OPTS_OPENVPN + #error EXTERNAL_OPTS_OPENVPN should not be defined in compiled files. + #endif + #ifdef __APPLE__ #include #endif