Skip to content

Commit

Permalink
Add enable_explicit_EC_test meson option
Browse files Browse the repository at this point in the history
* Disable explicit EC keys tests by default

Signed-off-by: Lucas Mulling <[email protected]>
  • Loading branch information
Mulling committed Jan 6, 2025
1 parent d7b1339 commit 3636429
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,11 @@ jobs:
git config --global --add safe.directory \
/__w/pkcs11-provider/pkcs11-provider
git submodule update --init
CC=${{ matrix.compiler }} meson setup builddir
if [ -f /etc/redhat-release ]; then
CC=${{ matrix.compiler }} meson setup builddir
else
CC=${{ matrix.compiler }} meson setup builddir -Denable_explicit_EC_test=true
fi
- name: Build and Test
if : ( steps.nss-version-check.outputs.skiptest != 'true' )
run: |
Expand Down
5 changes: 5 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ option('preload_libasan',
type: 'string',
value: 'no',
description: 'Path to libasan.so to preload')

option('enable_explicit_EC_test',
type: 'boolean',
value: false,
description: 'Enable explicit EC tests')
9 changes: 9 additions & 0 deletions tests/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ if nss_softokn.found()
endif
endif

if get_option('enable_explicit_EC_test')
conf_env.set('ENABLE_EXPLICIT_EC_TEST', '1')
endif

setup_script=find_program('setup.sh')
foreach suite : ['softokn', 'softhsm', 'kryoptic', 'kryoptic.nss']
test(
Expand All @@ -47,6 +51,10 @@ test_env = environment({
'TESTBLDDIR': meson.current_build_dir(),
})

if get_option('enable_explicit_EC_test')
test_env.set('ENABLE_EXPLICIT_EC_TEST', '1')
endif

valgrind = find_program('valgrind', required: false)
if valgrind.found()
add_test_setup('valgrind',
Expand Down Expand Up @@ -96,6 +104,7 @@ if get_option('b_sanitize') == 'address'
endif
endif


test_programs = {
'tsession': ['tsession.c'],
'tgenkey': ['tgenkey.c'],
Expand Down
4 changes: 2 additions & 2 deletions tests/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -305,8 +305,8 @@ echo "${ECPRI2URI}"
echo "${ECCRT2URI}"
echo ""

if [ -f /etc/redhat-release ]; then
title PARA "explicit EC unsupported on Fedora/EL"
if [ -z "${ENABLE_EXPLICIT_EC_TEST}" ]; then
title PARA "explicit EC unsupported"
elif [ "${TOKENTYPE}" == "softokn" ]; then
title PARA "explicit EC unsupported with softokn"
else
Expand Down
8 changes: 4 additions & 4 deletions tests/tecxc
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Copyright (C) 2023 Simo Sorce <[email protected]>
# SPDX-License-Identifier: Apache-2.0

# On Fedora/EL completely removed support for explicit EC from libcrypto,
# so skip the test completely
if [ -f /etc/redhat-release ]; then
exit 0
# Some distributions completely removed support for explicit EC from libcrypto.
# If `-Denable_explicit_EC_test=true` is not set, skip the test.
if [ -z "${ENABLE_EXPLICIT_EC_TEST}" ]; then
exit 77
fi

source "${TESTSSRCDIR}/helpers.sh"
Expand Down

0 comments on commit 3636429

Please sign in to comment.