openssl-pkcs11/openssl-pkcs11.spec
Wang Jinchao 0927874b47 Fix memory handling in slot refresh
On refreshing slots, there were two issues:
- When reusing a PKCS11_SLOT_PRIVATE structure instance, the instance to
  be reused was accidentally freed
- Looking for an instance in the list of slots had bugs in pointer
  usage.

Signed-off-by: Wang Jinchao <wangjinchao@xfusion.com>
(cherry picked from commit a3210031d7e7cee882d02d68194e94018bd5ab6e)
2024-11-01 16:02:11 +08:00

111 lines
2.9 KiB
RPMSpec

Name: openssl-pkcs11
Version: 0.4.12
Release: 3
Summary: A PKCS#11 engine for use with OpenSSL
License: LGPLv2+ and BSD
URL: https://github.com/OpenSC/libp11
Source0: https://github.com/OpenSC/libp11/releases/download/libp11-%{version}/libp11-%{version}.tar.gz
PATCH6000: backport-fix-memory-handling-in-slot-refresh.patch
BuildRequires: openssl-devel autoconf automake libtool
BuildRequires: softhsm opensc procps-ng p11-kit openssl chrpath
Provides: libp11 = %{version}-%{release}
Obsoletes: libp11 < 0.4.7-4
Provides: engine_pkcs11 = %{version}-%{release}
Obsoletes: engine_pkcs11 < 0.4.7-4
Requires: p11-kit-trust openssl >= 3.0.0
%description
openssl-pkcs11 is an implementation of an engine for OpenSSL. It can be loaded
using code, config file or command line and will pass any function call by
OpenSSL to a PKCS#11 module. openssl-pkcs11 is meant to be used with smart
cards and software for using smart cards in PKCS#11 format, such as OpenSC.
%package devel
Summary: Development headers and libraries for %{name}
Requires:%{name} = %{version}-%{release}
Provides:libp11-devel = %{version}-%{release}
%description devel
Development headers and libraries for %{name}
%prep
%autosetup -n libp11-%{version} -p1
%build
autoreconf -fvi
export CFLAGS="%{optflags}"
%configure --with-enginesdir=%{_libdir}/engines-3
make %{?_smp_mflags} V=1
%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{_libdir}/engines-3
%make_install
%delete_la
#strip binary files
pushd %{_builddir}/libp11-%{version}
find src/.libs -type f -name '*.so*' -exec strip '{}' ';'
strip examples/.libs/*
popd
%check
make check ||:
# strip %{_builddir}/libp11-%{version}/examples/.libs/lt-*
#remove rpath files
# chrpath -d %{_builddir}/libp11-%{version}/examples/.libs/lt-*
%pre
%preun
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc NEWS
%license COPYING
%{_libdir}/*.so.*
%{_libdir}/engines-3/*.so
%files devel
%defattr(-,root,root)
%doc examples/
%{_libdir}/libp11.so
%{_libdir}/libp11.a
%{_libdir}/pkgconfig/libp11.pc
%{_includedir}/*.h
%exclude %{_defaultdocdir}/libp11/*
%changelog
* Fri Nov 1 Wang Jinchao <wangjinchao@xfusion.com> - 0.4.12-3
- Fix memory handling in slot refresh
* Mon Feb 13 2023 zhouchenchen123 <zhouchenchen@huawei.com> - 0.4.12-2
- fix obs build issue
* Thu Feb 2 2023 zhouchenchen123 <zhouchenchen@huawei.com> - 0.4.12-1
- update version to 1.20.1
* Mon Jun 13 2022 fuanan <fuanan3@h-partners.com> - 0.4.11-4
- remove rpath files of lt-auth and lt-listkeys
- add openssl to BuildRequires for make check
* Tue Mar 30 2021 lirui <lirui130@huawei.com> - 0.4.11-3
- strip binary files
* Tue Mar 30 2021 panxiaohe <panxiaohe@huawei.com> - 0.4.11-2
- strip binary files
* Sat Jan 23 2021 zoulin <zoulin13@huawei.com> - 0.4.11-1
- update version to 0.4.11
* Mon Sep 9 2019 openEuler Buildteam <buildteam@openeuler.org> - 0.4.10-1
- Package init