From 256c6708e0121f71aa9846e7f82cbb6b20d95d12 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 6 Nov 2024 15:23:49 +1000 Subject: [PATCH] Testing fixes Fix header inclusion: settings.h after options.h. pkcs8_encode(): dh is not available if NO_DH is defined. --- src/pk.c | 2 ++ tests/quic.c | 4 +++- tests/unit.h | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pk.c b/src/pk.c index dfc5b680c7..2510c32a02 100644 --- a/src/pk.c +++ b/src/pk.c @@ -16526,6 +16526,7 @@ int pkcs8_encode(WOLFSSL_EVP_PKEY* pkey, byte* key, word32* keySz) curveOid = NULL; oidSz = 0; } +#ifndef NO_DH else if (pkey->type == WC_EVP_PKEY_DH) { if (pkey->dh == NULL) return BAD_FUNC_ARG; @@ -16548,6 +16549,7 @@ int pkcs8_encode(WOLFSSL_EVP_PKEY* pkey, byte* key, word32* keySz) curveOid = NULL; oidSz = 0; } +#endif else { ret = NOT_COMPILED_IN; } diff --git a/tests/quic.c b/tests/quic.c index 77533c87a5..f5fd2cefd1 100644 --- a/tests/quic.c +++ b/tests/quic.c @@ -19,11 +19,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA */ - #ifdef HAVE_CONFIG_H #include #endif +#ifndef WOLFSSL_USER_SETTINGS + #include +#endif #include #include diff --git a/tests/unit.h b/tests/unit.h index e93ef60374..0668ac7f2f 100644 --- a/tests/unit.h +++ b/tests/unit.h @@ -27,11 +27,10 @@ #include #endif -#include - #ifndef WOLFSSL_USER_SETTINGS #include #endif +#include #undef TEST_OPENSSL_COEXIST /* can't use this option with unit tests */ #undef OPENSSL_COEXIST /* can't use this option with unit tests */