diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ae7fb8a4..e6ae3cc1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,9 @@ on: pull_request: jobs: - linux: + linux_ubuntu_20: name: Linux (${{ matrix.backend }}) - runs-on: ubuntu-20.04 # for OpenSSL 1.1.1 + runs-on: ubuntu-20.04 # for OpenSSL 1.1.1 and Botan 2.12 strategy: fail-fast: false matrix: @@ -34,6 +34,32 @@ jobs: run: | make check || (find . -name test-suite.log -exec cat {} \; && false) + linux_ubuntu_24: + name: Linux (${{ matrix.backend }}) + runs-on: ubuntu-24.04 # for OpenSSL 3.0 and Botan 2.19 + strategy: + fail-fast: false + matrix: + include: + - backend: openssl + - backend: botan + steps: + - uses: actions/checkout@v4 + - name: Prepare + run: | + sudo apt update -qq + sudo apt install libcppunit-dev libbotan-2-dev p11-kit + - name: Build + env: + CXXFLAGS: -DBOTAN_NO_DEPRECATED_WARNINGS + run: | + ./autogen.sh + ./configure --with-crypto-backend=${{ matrix.backend }} + make + - name: Test + run: | + make check || (find . -name test-suite.log -exec cat {} \; && false) + macos: name: macOS (${{ matrix.backend }}) runs-on: macos-14 diff --git a/src/lib/crypto/test/cryptotest.cpp b/src/lib/crypto/test/cryptotest.cpp index d9dc72e0..5a4e000a 100644 --- a/src/lib/crypto/test/cryptotest.cpp +++ b/src/lib/crypto/test/cryptotest.cpp @@ -44,8 +44,11 @@ #include "MutexFactory.h" #include "SecureMemoryRegistry.h" -#if defined(WITH_OPENSSL) +#ifdef WITH_OPENSSL #include "OSSLCryptoFactory.h" +#if OPENSSL_VERSION_NUMBER >= 0x3000000fL +#include +#endif #else #include "BotanCryptoFactory.h" #endif @@ -75,6 +78,11 @@ std::auto_ptr BotanCryptoFactory::instance(NULL); int main(int /*argc*/, char** /*argv*/) { +#if defined(WITH_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x3000000fL + OSSL_PROVIDER_load(NULL, "legacy"); + OSSL_PROVIDER_load(NULL, "default"); +#endif + CppUnit::TestResult controller; CppUnit::TestResultCollector result; CppUnit::TextUi::TestRunner runner; diff --git a/src/lib/test/Makefile.am b/src/lib/test/Makefile.am index a22ce668..50d507c8 100644 --- a/src/lib/test/Makefile.am +++ b/src/lib/test/Makefile.am @@ -1,9 +1,11 @@ MAINTAINERCLEANFILES = $(srcdir)/Makefile.in -AM_CPPFLAGS = -I$(srcdir)/.. \ +AM_CPPFLAGS = -I$(srcdir)/../.. \ + -I$(srcdir)/.. \ -I$(srcdir)/../common \ -I$(srcdir)/../pkcs11 \ - @CPPUNIT_CFLAGS@ + @CPPUNIT_CFLAGS@ \ + @CRYPTO_INCLUDES@ check_PROGRAMS = p11test diff --git a/src/lib/test/p11test.cpp b/src/lib/test/p11test.cpp index bf9fb1f6..7af3d4d3 100644 --- a/src/lib/test/p11test.cpp +++ b/src/lib/test/p11test.cpp @@ -45,9 +45,16 @@ #include #include #include +#include "config.h" #ifdef _WIN32 #include "setenv.h" #endif +#ifdef WITH_OPENSSL +#include +#if OPENSSL_VERSION_NUMBER >= 0x3000000fL +#include +#endif +#endif class MyListener : public CPPUNIT_NS::TestListener { virtual void startTest( CPPUNIT_NS::Test* pTest ) { @@ -71,6 +78,11 @@ int main(int /*argc*/, char**const /*argv*/) #endif #endif +#if defined(WITH_OPENSSL) && OPENSSL_VERSION_NUMBER >= 0x3000000fL + OSSL_PROVIDER_load(NULL, "legacy"); + OSSL_PROVIDER_load(NULL, "default"); +#endif + CPPUNIT_NS::TestFactoryRegistry ®istry( CPPUNIT_NS::TestFactoryRegistry::getRegistry() ); CPPUNIT_NS::TextTestRunner runner;