Skip to content

Commit a968dfe

Browse files
Fix build and tests for wolfSSL (#352)
* Fix build and tests for wolfSSL Signed-off-by: Juliusz Sosinowicz <[email protected]> * Remove unnecessary symbols * Don't fail fast on wolfSSL actions * Include wolfssl/options.h explicitly * Fix old wolfSSL failures * remove unused EVP_PKEY_get1_RSA this is deprecated with 3.0 * code review comments * Apply suggestions from code review * rm extra headers? * fix cmake test use the new macro that was required * linter * fix unused warning fail_HMAC * reenable fail fast * fix spelling --------- Signed-off-by: Juliusz Sosinowicz <[email protected]> Co-authored-by: Chris Mc <[email protected]>
1 parent b36e8a9 commit a968dfe

File tree

5 files changed

+128
-72
lines changed

5 files changed

+128
-72
lines changed

.github/workflows/ssl.yml

+1
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ jobs:
9090
- { ref: "v5.1.1-stable", name: "5.1.1"}
9191
- { ref: "v5.2.0-stable", name: "5.2.0" }
9292
- { ref: "v5.3.0-stable", name: "5.3.0"}
93+
- { ref: "v5.7.0-stable", name: "5.7.0"}
9394
name: wolfSSL ${{ matrix.wolfssl.name }}
9495
steps:
9596
- uses: actions/checkout@v4

CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,10 @@ if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL")
125125
target_link_libraries(jwt-cpp INTERFACE PkgConfig::wolfssl)
126126
# This is required to access OpenSSL compatibility API
127127
target_include_directories(jwt-cpp INTERFACE ${wolfssl_INCLUDE_DIRS})
128-
target_compile_definitions(jwt-cpp INTERFACE OPENSSL_EXTRA OPENSSL_ALL)
128+
# This flag is required to have the mandatory header included automatically
129+
# https://github.com/Thalhammer/jwt-cpp/pull/352#discussion_r1627971786
130+
# https://github.com/wolfSSL/wolfssl/blob/3b74a6402998a8b8839e25e31ba8ac74749aa9b0/wolfssl/wolfcrypt/settings.h#L58
131+
target_compile_definitions(jwt-cpp INTERFACE EXTERNAL_OPTS_OPENVPN)
129132
endif()
130133

131134
if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)

tests/HelperTest.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ namespace {
113113
std::string google_cert =
114114
// This is to handle the different subject alternate name ordering
115115
// see https://github.com/wolfSSL/wolfssl/issues/4397
116-
#ifdef LIBWOLFSSL_VERSION_HEX
116+
#if defined(LIBWOLFSSL_VERSION_HEX) && LIBWOLFSSL_VERSION_HEX < 0x05007000
117117
R"(-----BEGIN CERTIFICATE-----
118118
MIIFfTCCBOagAwIBAgIKYFOB9QABAACIvTANBgkqhkiG9w0BAQUFADBGMQswCQYD
119119
VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu

0 commit comments

Comments
 (0)