diff mbox series

[ima-evm-utils,1/2] evmctl: Replace OSS_PROVIDER_load with OSSL_PROVIDER_try_load (Ubuntu)

Message ID 20240514182300.92440-2-stefanb@linux.ibm.com (mailing list archive)
State New, archived
Headers show
Series Fix issue with tests and provider on Ubuntu 24.04 | expand

Commit Message

Stefan Berger May 14, 2024, 6:22 p.m. UTC
To avoid the following type of issue replace OSSL_PROVIDER_load with
OSSL_PROVIDER_try_load():

+ evmctl  --engine gost ima_sign --keyid=aabbccdd --provider pkcs11 \
  --sigfile --hashalgo sha256 \
  --key pkcs11:model=SoftHSM%20v2;manufacturer=SoftHSM%20project;... \
  --xattr-user pkcs11test

evmctl ima_sign failed with (1)
  EVP_DigestInit() failed
  openssl: error:0308010C:digital envelope routines::unsupported
  openssl: error:03000086:digital envelope routines::initialization error

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
---
 src/evmctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/src/evmctl.c b/src/evmctl.c
index ffe2fc9..3ebda6f 100644
--- a/src/evmctl.c
+++ b/src/evmctl.c
@@ -3049,7 +3049,7 @@  static char *get_password(void)
 #if CONFIG_IMA_EVM_PROVIDER
 static OSSL_PROVIDER *setup_provider(const char *name)
 {
-	OSSL_PROVIDER *p = OSSL_PROVIDER_load(NULL, name);
+	OSSL_PROVIDER *p = OSSL_PROVIDER_try_load(NULL, name, 1);
 
 	if (!p) {
 		log_err("provider %s isn't available\n", optarg);