diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6525b33d..177cd897 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: | diff --git a/meson_options.txt b/meson_options.txt index 7e7b9bee..20ce4bdf 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') diff --git a/tests/meson.build b/tests/meson.build index abbdaa62..52280dbc 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -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( @@ -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', @@ -96,6 +104,7 @@ if get_option('b_sanitize') == 'address' endif endif + test_programs = { 'tsession': ['tsession.c'], 'tgenkey': ['tgenkey.c'], diff --git a/tests/setup.sh b/tests/setup.sh index c11d6628..c6f27e50 100755 --- a/tests/setup.sh +++ b/tests/setup.sh @@ -309,8 +309,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 diff --git a/tests/tecxc b/tests/tecxc index f0b2e708..202e0cd9 100755 --- a/tests/tecxc +++ b/tests/tecxc @@ -2,10 +2,10 @@ # Copyright (C) 2023 Simo Sorce # 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"