libnvme: Fix compilation failure

Fix compilation failure due to
"fatal error: openssl/engine.h: No such file or directory"

Resolves: RHEL-46699

Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
This commit is contained in:
Maurizio Lombardi 2024-07-25 10:12:08 +02:00
parent 56e865673b
commit 68d1d8f285
2 changed files with 44 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 849cea06f88790eca5b0407aa4bf9ed94ac6403e Mon Sep 17 00:00:00 2001
From: Tomas Bzatek <tbzatek@redhat.com>
Date: Thu, 18 Jul 2024 17:23:50 +0200
Subject: [PATCH] linux: Remove the use of OpenSSL Engine API
OpenSSL engines are not FIPS compatible and corresponding API
is deprecated since OpenSSL 3.0. It appears this API is not
actually used in the code, so remove it.
Signed-off-by: Tomas Bzatek <tbzatek@redhat.com>
---
src/nvme/linux.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/nvme/linux.c b/src/nvme/linux.c
index 9d472e408b5d..7785416727ed 100644
--- a/src/nvme/linux.c
+++ b/src/nvme/linux.c
@@ -18,7 +18,6 @@
#include <unistd.h>
#ifdef CONFIG_OPENSSL
-#include <openssl/engine.h>
#include <openssl/evp.h>
#include <openssl/hmac.h>
#include <openssl/kdf.h>
@@ -739,9 +738,6 @@ int nvme_gen_dhchap_key(char *hostnqn, enum nvme_hmac_alg hmac,
_cleanup_hmac_ctx_ HMAC_CTX *hmac_ctx = NULL;
const EVP_MD *md;
- ENGINE_load_builtin_engines();
- ENGINE_register_all_complete();
-
hmac_ctx = HMAC_CTX_new();
if (!hmac_ctx) {
errno = ENOMEM;
--
2.43.0

View File

@ -4,13 +4,14 @@
Name: libnvme
Summary: Linux-native nvme device management library
Version: 1.9
Release: 2%{?dist}
Release: 3%{?dist}
License: LGPL-2.1-or-later
URL: https://github.com/linux-nvme/libnvme
Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
# https://github.com/linux-nvme/libnvme/pull/833
Patch0: libnvme-1.10-linux-Fix-uninitialized-variables.patch
Patch1: 0002-linux-Remove-the-use-of-OpenSSL-Engine-API.patch
BuildRequires: gcc gcc-c++
BuildRequires: swig
@ -101,6 +102,9 @@ rm -r %{buildroot}%{_pkgdocdir}/html/{.buildinfo,.doctrees/}
%{python3_sitearch}/libnvme/*
%changelog
* Thu Jul 25 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.9-3
- Fix RHEL-46699
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.9-2
- Bump release for June 2024 mass rebuild