Skip to content

Commit

Permalink
Add option to disable explicit EC keys tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Mulling committed Dec 26, 2024
1 parent d7b1339 commit 617d7a6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
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('disable_explicit_EC_test',
type: 'boolean',
value: false,
description: 'Disable 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('disable_explicit_EC_test')
conf_env.set('DISABLE_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('disable_explicit_EC_test')
test_env.set('DISABLE_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 [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then
title PARA "explicit EC unsupported"
elif [ "${TOKENTYPE}" == "softokn" ]; then
title PARA "explicit EC unsupported with softokn"
else
Expand Down
2 changes: 1 addition & 1 deletion tests/tecxc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# On Fedora/EL completely removed support for explicit EC from libcrypto,
# so skip the test completely
if [ -f /etc/redhat-release ]; then
if [ -n "${DISABLE_EXPLICIT_EC_TEST}" ]; then
exit 0
fi

Expand Down

0 comments on commit 617d7a6

Please sign in to comment.