Skip to content

Commit

Permalink
Fix build and tests for wolfSSL (#352)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
julek-wolfssl and prince-chrismc authored Jul 29, 2024
1 parent b36e8a9 commit a968dfe
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 72 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ssl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ jobs:
- { ref: "v5.1.1-stable", name: "5.1.1"}
- { ref: "v5.2.0-stable", name: "5.2.0" }
- { ref: "v5.3.0-stable", name: "5.3.0"}
- { ref: "v5.7.0-stable", name: "5.7.0"}
name: wolfSSL ${{ matrix.wolfssl.name }}
steps:
- uses: actions/checkout@v4
Expand Down
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,10 @@ if(${JWT_SSL_LIBRARY} MATCHES "wolfSSL")
target_link_libraries(jwt-cpp INTERFACE PkgConfig::wolfssl)
# This is required to access OpenSSL compatibility API
target_include_directories(jwt-cpp INTERFACE ${wolfssl_INCLUDE_DIRS})
target_compile_definitions(jwt-cpp INTERFACE OPENSSL_EXTRA OPENSSL_ALL)
# This flag is required to have the mandatory header included automatically
# https://github.com/Thalhammer/jwt-cpp/pull/352#discussion_r1627971786
# https://github.com/wolfSSL/wolfssl/blob/3b74a6402998a8b8839e25e31ba8ac74749aa9b0/wolfssl/wolfcrypt/settings.h#L58
target_compile_definitions(jwt-cpp INTERFACE EXTERNAL_OPTS_OPENVPN)
endif()

if(NOT JWT_DISABLE_PICOJSON AND JWT_EXTERNAL_PICOJSON)
Expand Down
2 changes: 1 addition & 1 deletion tests/HelperTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ namespace {
std::string google_cert =
// This is to handle the different subject alternate name ordering
// see https://github.com/wolfSSL/wolfssl/issues/4397
#ifdef LIBWOLFSSL_VERSION_HEX
#if defined(LIBWOLFSSL_VERSION_HEX) && LIBWOLFSSL_VERSION_HEX < 0x05007000
R"(-----BEGIN CERTIFICATE-----
MIIFfTCCBOagAwIBAgIKYFOB9QABAACIvTANBgkqhkiG9w0BAQUFADBGMQswCQYD
VQQGEwJVUzETMBEGA1UEChMKR29vZ2xlIEluYzEiMCAGA1UEAxMZR29vZ2xlIElu
Expand Down
Loading

0 comments on commit a968dfe

Please sign in to comment.