Avoid uninitialized variables in mechanism info

Related: RHEL-24824
This commit is contained in:
Jakub Jelen 2023-11-09 12:50:59 +01:00 committed by Alexander Bokovoy
parent 49b58fdc38
commit a62367119d
2 changed files with 15 additions and 0 deletions

View File

@ -0,0 +1,12 @@
diff --git a/src/lib/SoftHSM.cpp b/src/lib/SoftHSM.cpp
index d2bf4037a..6eeac6103 100644
--- a/src/lib/SoftHSM.cpp
+++ b/src/lib/SoftHSM.cpp
@@ -972,6 +972,7 @@ CK_RV SoftHSM::C_GetMechanismInfo(CK_SLOT_ID slotID, CK_MECHANISM_TYPE type, CK_
}
CryptoFactory::i()->recycleAsymmetricAlgorithm(eddsa);
#endif
+ pInfo->flags = 0; // initialize flags
switch (type)
{
#ifndef WITH_FIPS

View File

@ -12,6 +12,8 @@ Source1: http://dist.opendnssec.org/source/%{?prever:testing/}%{name}-%{version}
Patch1: softhsm-2.6.1-rh1831086-exit.patch
Patch2: softhsm-openssl3-tests.patch
# based on https://github.com/opendnssec/SoftHSMv2/commit/f94aaffc879ade97a51b8e1308af42f86be1885f
Patch3: softhsm-2.6.1-uninitialized.patch
BuildRequires: make
BuildRequires: openssl-devel >= 1.0.1k-6, sqlite-devel >= 3.4.2, cppunit-devel
@ -45,6 +47,7 @@ The devel package contains the libsofthsm include files
%setup -q -n %{name}-%{version}%{?prever}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%if 0%{?prever:1} || 0%{?prerelease:1}
# pre-release or post-release snapshots fixup