Skip to content

Commit 7ce9ebd

Browse files
Merge pull request #7618 from julek-wolfssl/jwt-cpp
Fixes for jwt-cpp
2 parents 5132a17 + b3e795c commit 7ce9ebd

4 files changed

Lines changed: 89 additions & 3 deletions

File tree

.github/workflows/jwt-cpp.yml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: jwt-cpp Tests
2+
3+
# START OF COMMON SECTION
4+
on:
5+
push:
6+
branches: [ 'master', 'main', 'release/**' ]
7+
pull_request:
8+
branches: [ '*' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
# END OF COMMON SECTION
14+
15+
jobs:
16+
build_wolfssl:
17+
name: Build wolfSSL
18+
# Just to keep it the same as the testing target
19+
runs-on: ubuntu-latest
20+
# This should be a safe limit for the tests to run.
21+
timeout-minutes: 4
22+
steps:
23+
- name: Build wolfSSL
24+
uses: wolfSSL/actions-build-autotools-project@v1
25+
with:
26+
path: wolfssl
27+
configure: --enable-all
28+
install: true
29+
# Don't run tests as this config is tested in many other places
30+
check: false
31+
32+
- name: Upload built lib
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: wolf-install-jwt-cpp
36+
path: build-dir
37+
retention-days: 5
38+
39+
build_pam-ipmi:
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
ref: [ 0.6.0 ]
44+
name: ${{ matrix.ref }}
45+
runs-on: ubuntu-latest
46+
needs: build_wolfssl
47+
steps:
48+
- name: Install dependencies
49+
run: |
50+
# Don't prompt for anything
51+
export DEBIAN_FRONTEND=noninteractive
52+
sudo apt-get update
53+
sudo apt-get install libgtest-dev
54+
55+
- name: Download lib
56+
uses: actions/download-artifact@v4
57+
with:
58+
name: wolf-install-jwt-cpp
59+
path: build-dir
60+
61+
- name: Checkout OSP
62+
uses: actions/checkout@v4
63+
with:
64+
repository: wolfssl/osp
65+
path: osp
66+
67+
- name: Checkout jwt-cpp
68+
uses: actions/checkout@v4
69+
with:
70+
repository: Thalhammer/jwt-cpp
71+
path: jwt-cpp
72+
ref: v${{ matrix.ref }}
73+
74+
- name: Build pam-ipmi
75+
working-directory: jwt-cpp
76+
run: |
77+
patch -p1 < ../osp/jwt-cpp/${{ matrix.ref }}.patch
78+
PKG_CONFIG_PATH=$GITHUB_WORKSPACE/build-dir/lib/pkgconfig \
79+
cmake -B build -DJWT_SSL_LIBRARY:STRING=wolfSSL -DJWT_BUILD_TESTS=ON .
80+
make -j -C build
81+
ldd ./build/tests/jwt-cpp-test | grep wolfssl
82+
83+
- name: Run jwt-cpp tests
84+
working-directory: jwt-cpp
85+
run: ./build/tests/jwt-cpp-test

src/ssl_crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1966,7 +1966,7 @@ int wolfSSL_HMAC_cleanup(WOLFSSL_HMAC_CTX* ctx)
19661966
* @return NULL on failure.
19671967
*/
19681968
unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md, const void* key,
1969-
int key_len, const unsigned char* data, int len, unsigned char* md,
1969+
int key_len, const unsigned char* data, size_t len, unsigned char* md,
19701970
unsigned int* md_len)
19711971
{
19721972
unsigned char* ret = NULL;

wolfssl/openssl/hmac.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
WOLFSSL_API unsigned char* wolfSSL_HMAC(const WOLFSSL_EVP_MD* evp_md,
4747
const void* key, int key_len,
48-
const unsigned char* d, int n, unsigned char* md,
48+
const unsigned char* d, size_t n, unsigned char* md,
4949
unsigned int* md_len);
5050

5151
WOLFSSL_API WOLFSSL_HMAC_CTX* wolfSSL_HMAC_CTX_new(void);
@@ -69,7 +69,7 @@ WOLFSSL_API const WOLFSSL_EVP_MD *wolfSSL_HMAC_CTX_get_md(const WOLFSSL_HMAC_CTX
6969

7070
typedef struct WOLFSSL_HMAC_CTX HMAC_CTX;
7171

72-
#define HMAC(a,b,c,d,e,f,g) wolfSSL_HMAC((a),(b),(c),(d),(e),(f),(g))
72+
#define HMAC wolfSSL_HMAC
7373

7474
#define HMAC_CTX_new wolfSSL_HMAC_CTX_new
7575
#define HMAC_CTX_init wolfSSL_HMAC_CTX_Init

wolfssl/openssl/opensslv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#define WOLFSSL_OPENSSLV_H_
2626

2727
#include <wolfssl/wolfcrypt/settings.h>
28+
#include <wolfssl/version.h>
2829

2930
#if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
3031

0 commit comments

Comments
 (0)