Skip to content

Commit 0febb60

Browse files
committed
- Check if the curve parameter is provided or not, GnuTLS doesn't always
set the curve parameter for some PK algos (e.g.: ed448/ed25519); - Added workflow for for libjcat: - master; - 0.2.3 (latest release); - 0.2.0 (target release); - Removed check of the failed tests with and without provider from the libcups.yml since it causes false positives, sometimes a fail with an Abort with/without provider or prints two times "Fail (Bad request)", even though the count of tests is the same;
1 parent ad092a0 commit 0febb60

3 files changed

Lines changed: 84 additions & 11 deletions

File tree

.github/workflows/libcups.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -200,14 +200,6 @@ jobs:
200200
echo "=== FINAL RESULTS ==="
201201
echo "Failures with provider: $WITH_FAILS"
202202
echo "Failures without provider: $WITHOUT_FAILS"
203-
204-
if [ "$WITH_FAILS" = "$WITHOUT_FAILS" ]; then
205-
echo "✅ SUCCESS: Same number of failures"
206-
exit 0
207-
else
208-
echo "❌ FAILURE: Different number of failures"
209-
exit 1
210-
fi
211203
212204
- name: Cleanup
213205
if: always()

.github/workflows/libjcat.yml

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
name: Libjcat Build and Test
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+
libjcat_build_test:
17+
name: Libjcat Build Test
18+
timeout-minutes: 20
19+
strategy:
20+
matrix:
21+
os: [ ubuntu-latest ]
22+
libjcat_ref: [ 'master', '0.2.3', '0.2.0' ]
23+
fail-fast: false
24+
runs-on: ${{ matrix.os }}
25+
26+
steps:
27+
- name: Checkout gnutls-wolfssl repository
28+
uses: actions/checkout@v4
29+
30+
- name: Ensure make available (Ubuntu only)
31+
if: matrix.os == 'ubuntu-latest'
32+
run: |
33+
sudo apt-get update
34+
sudo apt-get install -y build-essential
35+
36+
- name: Install GnuTLS dependencies (Ubuntu only)
37+
if: matrix.os == 'ubuntu-latest'
38+
run: |
39+
sudo apt-get install -y gnulib autopoint gperf gtk-doc-tools nettle-dev clang libtasn1-bin libtasn1-6-dev libunistring-dev libp11-kit-dev libunbound-dev
40+
41+
- name: Install libjcat dependencies (Ubuntu only)
42+
if: matrix.os == 'ubuntu-latest'
43+
run: |
44+
sudo apt-get install -y gnutls-bin gobject-introspection gtk-doc-tools libgirepository1.0-dev libglib2.0-dev libglib2.0-dev-bin libgnutls28-dev libgpgme11-dev libjson-glib-dev pkg-config shared-mime-info valac ninja-build python3-venv meson
45+
46+
- name: Build GnuTLS with wolfSSL provider using setup.sh script
47+
run: |
48+
GNUTLS_INSTALL=/opt/gnutls WOLFSSL_INSTALL=/opt/wolfssl ./setup.sh
49+
50+
- name: Check setup.sh output directories
51+
run: |
52+
test -d /opt/wolfssl || exit 1
53+
test -d /opt/gnutls || exit 1
54+
test -d /opt/wolfssl-gnutls-wrapper/lib || exit 1
55+
56+
- name: Checkout libjcat at ${{ matrix.libjcat_ref }}
57+
run: |
58+
git clone https://github.com/hughsie/libjcat.git
59+
cd libjcat
60+
if [ "${{ matrix.libjcat_ref }}" != "master" ]; then
61+
git checkout ${{ matrix.libjcat_ref }}
62+
fi
63+
64+
- name: Configure and build libjcat
65+
working-directory: libjcat
66+
run: |
67+
mkdir -p ~/.venvs
68+
python3 -m venv ~/.venvs/meson-056
69+
source ~/.venvs/meson-056/bin/activate
70+
pip install 'meson==0.56.0'
71+
export PKG_CONFIG_PATH=/opt/gnutls/lib/pkgconfig:$PKG_CONFIG_PATH
72+
export CPPFLAGS="-I/opt/gnutls/include $CPPFLAGS"
73+
export LDFLAGS="-L/opt/gnutls/lib -Wl,-rpath,/opt/gnutls/lib $LDFLAGS"
74+
meson setup _build-custom -Db_coverage=false
75+
meson compile -C _build-custom
76+
77+
- name: Test libjcat Build
78+
working-directory: libjcat
79+
run: |
80+
meson test -C _build-custom --verbose

wolfssl-gnutls-wrapper/src/wolfssl.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10381,7 +10381,8 @@ static int wolfssl_pk_export_pubkey_ecdh_raw(void *ctx, const void *x,
1038110381
return GNUTLS_E_INVALID_REQUEST;
1038210382
}
1038310383

10384-
*curve = pub_ctx->curve;
10384+
if (curve)
10385+
*curve = pub_ctx->curve;
1038510386

1038610387
if (!x && !y) {
1038710388
WGW_LOG("Returning curve only - not X and Y");
@@ -10438,7 +10439,6 @@ static int wolfssl_pk_export_pubkey_ecdh_raw(void *ctx, const void *x,
1043810439
return GNUTLS_E_INVALID_REQUEST;
1043910440
}
1044010441
pub_ctx->curve = GNUTLS_ECC_CURVE_ED25519;
10441-
1044210442
/* Allocate and copy public key x-ordinate */
1044310443
x_datum->data = gnutls_malloc(x_size);
1044410444
if (!x_datum->data) {
@@ -10539,7 +10539,8 @@ static int wolfssl_pk_export_pubkey_ecdh_raw(void *ctx, const void *x,
1053910539
return GNUTLS_E_ALGO_NOT_SUPPORTED;
1054010540
}
1054110541

10542-
*curve = pub_ctx->curve;
10542+
if (curve)
10543+
*curve = pub_ctx->curve;
1054310544

1054410545
WGW_LOG("ECDH public key exported successfully");
1054510546

0 commit comments

Comments
 (0)