Skip to contentSkip to conversation

Enable and disable OpenSSL provider tests

PATCH New Stefan Berger 1 participant 5 messages Jun 24, 2024 Keys-trusted

lore
Share & tools
lore
#0 lore raw

v2 cover Enable and disable OpenSSL provider tests

This series enables tests with OpenSSL providers on Ubuntu for testing with pkcs11 and SoftHSM. At the same time it disables testing with OpenSSL providers on AltLinux and Debian due to an issue that most likely stems from a bug in a dependency (OpenSSL, p11-kit-modules, SoftHSM, or others).

Thanks to Jonathan McDowell for the backtrace on Debian. It seemms to be the same problem as on AltLinux - a locking issue in the C_Login -> C_OpenSession callpath that blocks forever in a pthread_mutex_lock().

https://lore.kernel.org/linux-integrity/[email protected]/T/#meb2e76c337fe8d140cdbcc699c0606d31d7749a2

v2:
- dropped ci/cd changes from 3/4 in favor of 4/4

Regards,
Stefan

Stefan Berger (4):
Call OPENSSL_Cleanup before main exit to avoid crashes when engine was
used
CI/CD: Disable pkcs11 providers for Debian and AltLinux CI/CD: Prepare Ubuntu 24.04 (Noble) to run provider tests Replace Ubuntu mantic with noble

 .github/workflows/ci.yml |  5 ++--
 .travis.yml              |  4 +--
 ci/alt.sh                |  2 +-
 ci/debian.sh             |  2 +-
 ci/ubuntu.sh             | 63 +++++++++++++++++++++++++++++++++++++++-
 src/evmctl.c             |  3 ++
 6 files changed, 71 insertions(+), 8 deletions(-)
 mode change 120000 => 100755 ci/ubuntu.sh
Signature · 1 line
2.45.2
#1 lore raw

PATCH v2 1/4 Call OPENSSL_Cleanup before main exit to avoid crashes when engine was used

From: Stefan Berger <[email protected]>

When OPENSSL_Cleanup is called via destructor after main() was left then evmctl crashes on Ubuntu 24.04 (Noble). This can be avoided by calling OpenSSL_Cleanup explicitly before leaving main().

---
 src/evmctl.c | 3 +++
 1 file changed, 3 insertions(+)
src/evmctl.c +3 -0
index 3ebda6f..ad75853 100644
@@ -3347,5 +3347,8 @@ error:
 	ERR_free_strings();
 	EVP_cleanup();
 	BIO_free(NULL);
+#if OPENSSL_VERSION_NUMBER >= 0x30000000
+	OPENSSL_cleanup();
+#endif
 	return err;
 }
Signature · 1 line
2.45.2
#2 lore raw

PATCH v2 2/4 CI/CD: Disable pkcs11 providers for Debian and AltLinux

In reply to Stefan Berger

From: Stefan Berger <[email protected]>

Disable testing provider support on Debian:latest and AltLinux:sisyphus since both now get stuck while running OpenSSL provider-related tests. This is most likely due to an update in a dependency (OpenSSL, p11-kit-modules, softhsm, or others).

On AltLinux the issues is related to a pthread_mutex_lock() down the C_Login -> C_OpenSession callpath that blocks forever.

---
 ci/alt.sh    | 2 +-
 ci/debian.sh | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
ci/alt.sh +1 -1
index f86dcec..f1eefbf 100755
@@ -28,4 +28,4 @@ apt-get install -y \
 		xxd \
 	&& control openssl-gost enabled
 
-apt-get install -y pkcs11-provider || true
+# apt-get install -y pkcs11-provider || true
ci/debian.sh +1 -1
index e1bae43..34125d4 100755
@@ -59,4 +59,4 @@ $apt \
 $apt xxd || $apt vim-common
 $apt libengine-gost-openssl || true
 $apt softhsm2 gnutls-bin libengine-pkcs11-openssl || true
-$apt softhsm2 gnutls-bin pkcs11-provider || true
+# $apt softhsm2 gnutls-bin pkcs11-provider || true
Signature · 1 line
2.45.2
#3 lore raw

PATCH v2 3/4 CI/CD: Prepare Ubuntu 24.04 (Noble) to run provider tests

In reply to Stefan Berger

From: Stefan Berger <[email protected]>

With provider support fixed for Ubuntu 24.04 (Noble), prepare for enabling testing with it. To test provider support on Ubuntu, make a copy of the debian.sh install file and enable the installation of provider support there.

---
 ci/ubuntu.sh | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 62 insertions(+), 1 deletion(-)
 mode change 120000 => 100755 ci/ubuntu.sh
ci/ubuntu.sh deleted +0 -1
deleted file mode 120000
index 0edcb8b..0000000
@@ -1 +0,0 @@
-debian.sh
\ No newline at end of file
ci/ubuntu.sh new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
2.45.2
#4 lore raw

PATCH v2 4/4 Replace Ubuntu mantic with noble

In reply to Stefan Berger

As Ubuntu noble contains a pkcs11-provider package, use it for testing. Also use the distro provided openssl version.

---
 .github/workflows/ci.yml | 5 ++---
 .travis.yml              | 4 ++--
 2 files changed, 4 insertions(+), 5 deletions(-)
.github/workflows/ci.yml +2 -3
index 8471096..71fcaae 100644
@@ -132,13 +132,12 @@ jobs:
               CC: gcc
               TSS: tpm2-tss
 
-          - container: "ubuntu:jammy"
+          - container: "ubuntu:noble"
             env:
               CC: gcc
               TSS: ibmtss
-              COMPILE_SSL: openssl-3.0.5
 
-          - container: "ubuntu:mantic"
+          - container: "ubuntu:jammy"
             env:
               CC: gcc
               TSS: ibmtss
.travis.yml +2 -2
index adaf095..b8876f4 100644
@@ -40,11 +40,11 @@ matrix:
           compiler: gcc
 
         - os: linux
-          env: DISTRO=ubuntu:mantic TSS=ibmtss
+          env: DISTRO=ubuntu:noble TSS=ibmtss
           compiler: gcc
 
         - os: linux
-          env: DISTRO=ubuntu:jammy TSS=ibmtss COMPILE_SSL=openssl-3.0.5
+          env: DISTRO=ubuntu:jammy TSS=ibmtss
           compiler: gcc
 
         - os: linux
Signature · 1 line
2.45.2