mirror of
https://github.com/allankoechke/jwt-cpp.git
synced 2026-11-30 10:18:40 +00:00
⬆️ Update LibreSSL version up to 4.2.1 (#410)
* Update LibreSSL version to 4.2.1 in CI configuration and documentation * update OpenSSLErrorTest for LibreSSL 4.2.0+ Add Linux LibreSSL support in CMake presets * add debug output to failure for all ssl libraries * fix type in libressl version check * chore: lint
This commit is contained in:
2
.github/actions/install/libressl/action.yml
vendored
2
.github/actions/install/libressl/action.yml
vendored
@@ -4,7 +4,7 @@ inputs:
|
|||||||
version:
|
version:
|
||||||
description: The desired LibreSSL version to install
|
description: The desired LibreSSL version to install
|
||||||
required: false
|
required: false
|
||||||
default: "3.3.0"
|
default: "4.2.1"
|
||||||
runs:
|
runs:
|
||||||
using: composite
|
using: composite
|
||||||
steps:
|
steps:
|
||||||
|
|||||||
8
.github/workflows/ssl.yml
vendored
8
.github/workflows/ssl.yml
vendored
@@ -55,14 +55,14 @@ jobs:
|
|||||||
run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1"
|
run: cmake --preset unit-tests -DOPENSSL_ROOT_DIR=/tmp -DCMAKE_CXX_FLAGS="-DOPENSSL_NO_DEPRECATED=1" -DCMAKE_C_FLAGS="-DOPENSSL_NO_DEPRECATED=1"
|
||||||
- run: cmake --build --preset unit-tests
|
- run: cmake --build --preset unit-tests
|
||||||
- name: test
|
- name: test
|
||||||
run: ctest --preset unit-tests
|
run: ctest --preset unit-tests --output-on-failure
|
||||||
|
|
||||||
libressl:
|
libressl:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
libressl: ["3.5.3", "3.4.3", "3.3.6"]
|
libressl: ["4.2.1", "4.1.2", "3.9.2"]
|
||||||
name: LibreSSL ${{ matrix.libressl }}
|
name: LibreSSL ${{ matrix.libressl }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=LibreSSL
|
run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=LibreSSL
|
||||||
- run: cmake --build --preset unit-tests
|
- run: cmake --build --preset unit-tests
|
||||||
- name: test
|
- name: test
|
||||||
run: ctest --preset unit-tests
|
run: ctest --preset unit-tests --output-on-failure
|
||||||
|
|
||||||
- if: github.event_name == 'push' && always()
|
- if: github.event_name == 'push' && always()
|
||||||
uses: ./.github/actions/badge
|
uses: ./.github/actions/badge
|
||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=wolfSSL
|
run: cmake --preset unit-tests -DJWT_SSL_LIBRARY:STRING=wolfSSL
|
||||||
- run: cmake --build --preset unit-tests
|
- run: cmake --build --preset unit-tests
|
||||||
- name: test
|
- name: test
|
||||||
run: ctest --preset unit-tests
|
run: ctest --preset unit-tests --output-on-failure
|
||||||
|
|
||||||
- if: github.event_name == 'push' && always()
|
- if: github.event_name == 'push' && always()
|
||||||
uses: ./.github/actions/badge
|
uses: ./.github/actions/badge
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -318,3 +318,4 @@ build/*
|
|||||||
package-lock.json
|
package-lock.json
|
||||||
|
|
||||||
CMakeUserPresets.json
|
CMakeUserPresets.json
|
||||||
|
cmake/FindLibreSSL.cmake
|
||||||
|
|||||||
12
docs/ssl.md
12
docs/ssl.md
@@ -18,9 +18,9 @@ These are the versions which are currently being tested:
|
|||||||
|
|
||||||
| OpenSSL | LibreSSL | wolfSSL |
|
| OpenSSL | LibreSSL | wolfSSL |
|
||||||
| ----------------- | -------------- | -------------- |
|
| ----------------- | -------------- | -------------- |
|
||||||
| ![3.0.19][o3.0] | ![3.3.6][l3.3] | ![5.1.1][w5.1] |
|
| ![3.0.19][o3.0] | ![4.2.1][l4.2] | ![5.1.1][w5.1] |
|
||||||
| ![3.5.5][o3.5] :star: | ![3.4.3][l3.4] | ![5.2.0][w5.2] |
|
| ![3.5.5][o3.5] :star: | ![4.1.2][l4.1] | ![5.2.0][w5.2] |
|
||||||
| ![3.6.1][o3.6] | ![3.5.3][l3.5] | ![5.3.0][w5.3] |
|
| ![3.6.1][o3.6] | ![3.9.2][l3.9] | ![5.3.0][w5.3] |
|
||||||
|
|
||||||
> [!NOTE]
|
> [!NOTE]
|
||||||
> :star: Indicates LTS (Long-Term Support) versions. [OpenSSL versions](https://openssl-library.org/policies/releasestrat/index.html) are supported as follows:
|
> :star: Indicates LTS (Long-Term Support) versions. [OpenSSL versions](https://openssl-library.org/policies/releasestrat/index.html) are supported as follows:
|
||||||
@@ -36,9 +36,9 @@ These are the versions which are currently being tested:
|
|||||||
[o3.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.0.19/shields.json
|
[o3.0]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.0.19/shields.json
|
||||||
[o3.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.5.5/shields.json
|
[o3.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.5.5/shields.json
|
||||||
[o3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.6.1/shields.json
|
[o3.6]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/openssl/3.6.1/shields.json
|
||||||
[l3.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.3.6/shields.json
|
[l4.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/4.2.1/shields.json
|
||||||
[l3.4]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.4.3/shields.json
|
[l4.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/4.1.2/shields.json
|
||||||
[l3.5]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.5.3/shields.json
|
[l3.9]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/libressl/3.9.2/shields.json
|
||||||
[w5.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.1.1/shields.json
|
[w5.1]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.1.1/shields.json
|
||||||
[w5.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.2.0/shields.json
|
[w5.2]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.2.0/shields.json
|
||||||
[w5.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.3.0/shields.json
|
[w5.3]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/Thalhammer/jwt-cpp/badges/wolfssl/5.3.0/shields.json
|
||||||
|
|||||||
@@ -37,6 +37,30 @@
|
|||||||
"JWT_BUILD_TESTS": "ON"
|
"JWT_BUILD_TESTS": "ON"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mac-libressl",
|
||||||
|
"inherits": ["unit-tests"],
|
||||||
|
"displayName": "macOS Unit Tests (LibreSSL)",
|
||||||
|
"description": "This is only available on macOS and requires LibreSSL to be installed via Homebrew. You can install it with `brew install libressl`. You need to manually download the FindLibreSSL.cmake file from the LibreSSL repository and place it in the cmake/ directory of this project.",
|
||||||
|
"condition": {
|
||||||
|
"type": "equals",
|
||||||
|
"lhs": "${hostSystemName}",
|
||||||
|
"rhs": "Darwin"
|
||||||
|
},
|
||||||
|
"cacheVariables": {
|
||||||
|
"JWT_SSL_LIBRARY": "LibreSSL",
|
||||||
|
"LIBRESSL_ROOT_DIR": "$env{HOMEBREW_PREFIX}/opt/libressl"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-libressl",
|
||||||
|
"inherits": ["linux", "unit-tests"],
|
||||||
|
"displayName": "Linux Unit Tests (LibreSSL)",
|
||||||
|
"description": "This is only available on Linux and requires LibreSSL to be installed. You need to manually download the FindLibreSSL.cmake file from the LibreSSL repository and place it in the cmake/ directory of this project.",
|
||||||
|
"cacheVariables": {
|
||||||
|
"JWT_SSL_LIBRARY": "LibreSSL"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ci-fuzzing",
|
"name": "ci-fuzzing",
|
||||||
"inherits": ["debug", "linux"],
|
"inherits": ["debug", "linux"],
|
||||||
@@ -103,6 +127,22 @@
|
|||||||
"jwt-cpp-test"
|
"jwt-cpp-test"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mac-libressl",
|
||||||
|
"configurePreset": "mac-libressl",
|
||||||
|
"configuration": "Debug",
|
||||||
|
"targets": [
|
||||||
|
"jwt-cpp-test"
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "linux-libressl",
|
||||||
|
"configurePreset": "linux-libressl",
|
||||||
|
"configuration": "Debug",
|
||||||
|
"targets": [
|
||||||
|
"jwt-cpp-test"
|
||||||
|
]
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "ci-fuzzing",
|
"name": "ci-fuzzing",
|
||||||
"configurePreset": "ci-fuzzing",
|
"configurePreset": "ci-fuzzing",
|
||||||
|
|||||||
@@ -330,6 +330,20 @@ int EC_KEY_check_key(const EC_KEY* key) {
|
|||||||
return origMethod(key);
|
return origMethod(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER >= 0x4020000fL
|
||||||
|
// LibreSSL 4.2.0+ changed EVP_PKEY_get1_EC_KEY to take const EVP_PKEY*
|
||||||
|
EC_KEY* EVP_PKEY_get1_EC_KEY(const EVP_PKEY* pkey) {
|
||||||
|
static EC_KEY* (*origMethod)(const EVP_PKEY* pkey) = nullptr;
|
||||||
|
if (origMethod == nullptr) origMethod = (decltype(origMethod))dlsym(RTLD_NEXT, SYMBOL_NAME("EVP_PKEY_get1_EC_KEY"));
|
||||||
|
bool fail = fail_EVP_PKEY_get1_EC_KEY & 1;
|
||||||
|
fail_EVP_PKEY_get1_EC_KEY = fail_EVP_PKEY_get1_EC_KEY >> 1;
|
||||||
|
if (fail)
|
||||||
|
return nullptr;
|
||||||
|
else
|
||||||
|
return origMethod(pkey);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
// LibreSSL < 4.2.0 uses non-const EVP_PKEY*
|
||||||
EC_KEY* EVP_PKEY_get1_EC_KEY(EVP_PKEY* pkey) {
|
EC_KEY* EVP_PKEY_get1_EC_KEY(EVP_PKEY* pkey) {
|
||||||
static EC_KEY* (*origMethod)(EVP_PKEY * pkey) = nullptr;
|
static EC_KEY* (*origMethod)(EVP_PKEY * pkey) = nullptr;
|
||||||
if (origMethod == nullptr) origMethod = (decltype(origMethod))dlsym(RTLD_NEXT, SYMBOL_NAME("EVP_PKEY_get1_EC_KEY"));
|
if (origMethod == nullptr) origMethod = (decltype(origMethod))dlsym(RTLD_NEXT, SYMBOL_NAME("EVP_PKEY_get1_EC_KEY"));
|
||||||
@@ -341,6 +355,7 @@ EC_KEY* EVP_PKEY_get1_EC_KEY(EVP_PKEY* pkey) {
|
|||||||
return origMethod(pkey);
|
return origMethod(pkey);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
ECDSA_SIG* ECDSA_SIG_new(void) {
|
ECDSA_SIG* ECDSA_SIG_new(void) {
|
||||||
static ECDSA_SIG* (*origMethod)() = nullptr;
|
static ECDSA_SIG* (*origMethod)() = nullptr;
|
||||||
|
|||||||
Reference in New Issue
Block a user