2019-09-30 10:56:50 -04:00
|
|
|
%global sysctl_prio 50
|
|
|
|
|
%global sysctl_optmem_max 81920
|
|
|
|
|
%global distroname_ext %{_vendor}
|
|
|
|
|
|
2024-01-18 14:50:19 +08:00
|
|
|
# Define enable_docbook_pdf to 0,
|
|
|
|
|
# if you don't need pdf and ps document.
|
|
|
|
|
%global enable_docbook_pdf 1
|
2022-07-13 14:43:55 +08:00
|
|
|
|
2023-04-28 12:38:02 +08:00
|
|
|
# Calculate hmac file after installing for binary
|
|
|
|
|
%define __spec_install_post \
|
|
|
|
|
%{?__debug_package:%{__debug_install_post}} \
|
|
|
|
|
%{__arch_install_post} \
|
|
|
|
|
%{__os_install_post} \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha1hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha1hmac.hmac \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha224hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha224hmac.hmac \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha256hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha256hmac.hmac \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha384hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha384hmac.hmac \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sha512hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sha512hmac.hmac \
|
|
|
|
|
bin/kcapi-hasher -n sha512hmac %{buildroot}%{_bindir}/sm3hmac | cut -f 1 -d ' ' > %{buildroot}/%{_lib}/hmaccalc/sm3hmac.hmac \
|
|
|
|
|
hardlink -cfv %{buildroot}%{_bindir} \
|
|
|
|
|
bin/kcapi-hasher -n fipshmac -d %{buildroot}/%{_lib}/fipscheck %{buildroot}/%{_lib}/libkcapi.so.%{version} || exit 1 \
|
|
|
|
|
ln -s libkcapi.so.%{version}.hmac %{buildroot}/%{_lib}/fipscheck/libkcapi.so.1.hmac \
|
|
|
|
|
%{nil}
|
|
|
|
|
|
2019-09-30 10:56:50 -04:00
|
|
|
Name: libkcapi
|
2022-11-16 11:54:12 +08:00
|
|
|
Version: 1.4.0
|
2024-01-18 14:50:19 +08:00
|
|
|
Release: 6
|
2019-09-30 10:56:50 -04:00
|
|
|
Summary: libkcapi - Linux Kernel Crypto API User Space Interface Library
|
|
|
|
|
|
|
|
|
|
License: BSD or GPLv2
|
|
|
|
|
URL: http://www.chronox.de/%{name}.html
|
|
|
|
|
Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz
|
|
|
|
|
Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc
|
|
|
|
|
|
|
|
|
|
Patch0: libkcapi-1.1.1-lib_Fix_kcapi_handle_destroy_closing_FD_0.patch
|
2023-08-15 16:14:14 +08:00
|
|
|
Patch1: backport-Append-newline-to-stdout.patch
|
2023-08-16 16:19:05 +08:00
|
|
|
Patch2: backport-Prevent-cppcheck-from-defining-CHECK_DIR.patch
|
2019-09-30 10:56:50 -04:00
|
|
|
|
2022-07-13 14:43:55 +08:00
|
|
|
BuildRequires: clang coreutils cppcheck gcc hardlink
|
2019-09-30 10:56:50 -04:00
|
|
|
BuildRequires: libtool openssl perl systemd xmlto kernel-headers >= 4.10.0
|
2022-07-13 14:43:55 +08:00
|
|
|
%if 0%{?enable_docbook_pdf}
|
|
|
|
|
BuildRequires: docbook-utils-pdf
|
|
|
|
|
%endif
|
2019-09-30 10:56:50 -04:00
|
|
|
|
2020-10-16 19:50:28 +08:00
|
|
|
Requires: systemd
|
2019-09-30 10:56:50 -04:00
|
|
|
|
2019-12-13 15:37:32 +08:00
|
|
|
Provides: %{name}-tools
|
|
|
|
|
Provides: hmaccalc == 0.9.14-10.1
|
|
|
|
|
Provides: hmaccalc%{?_isa} == 0.9.14-10.1
|
|
|
|
|
Provides: %{name}-hmaccalc
|
2019-09-30 10:56:50 -04:00
|
|
|
|
2019-12-13 15:37:32 +08:00
|
|
|
Obsoletes: %{name}-replacements <= %{version}-%{release}
|
2019-09-30 10:56:50 -04:00
|
|
|
Obsoletes: %{name}-tools
|
2019-12-13 15:37:32 +08:00
|
|
|
Obsoletes: hmaccalc <= 0.9.14-10
|
|
|
|
|
Obsoletes: %{name}-hmaccalc
|
2019-09-30 10:56:50 -04:00
|
|
|
|
|
|
|
|
%description
|
|
|
|
|
The Linux kernel exports a Netlink interface of type AF_ALG to allow user space to utilize the kernel crypto API.
|
|
|
|
|
libkcapi uses this Netlink interface and exports easy to use APIs so that a developer does not need to consider the low-level Netlink interface handling.
|
|
|
|
|
The library does not implement any cipher algorithms. All consumer requests are sent to the kernel for processing.
|
|
|
|
|
Results from the kernel crypto API are returned to the consumer via the library API.
|
|
|
|
|
|
|
|
|
|
%package devel
|
|
|
|
|
Summary: Development files for the %{name} package
|
|
|
|
|
Requires: %{name} == %{version}-%{release}
|
|
|
|
|
|
|
|
|
|
Obsoletes: %{name}-static
|
|
|
|
|
Provides: %{name}-static
|
|
|
|
|
|
|
|
|
|
%description devel
|
|
|
|
|
Header files for applications that use %{name}.
|
|
|
|
|
|
2020-10-16 19:50:28 +08:00
|
|
|
%package tests
|
|
|
|
|
Summary: Testing scripts for the %{name} package
|
|
|
|
|
Requires: %{name}%{?_isa} == %{version}-%{release}
|
|
|
|
|
Requires: %{name}-tools
|
|
|
|
|
Requires: %{name}-hmaccalc
|
|
|
|
|
Requires: coreutils
|
|
|
|
|
Requires: openssl
|
|
|
|
|
Requires: perl
|
|
|
|
|
|
|
|
|
|
%description tests
|
|
|
|
|
Auxiliary scripts for testing %{name}.
|
|
|
|
|
|
2019-09-30 10:56:50 -04:00
|
|
|
%package_help
|
|
|
|
|
|
|
|
|
|
%prep
|
2021-07-30 23:00:09 +08:00
|
|
|
%autosetup -p 1
|
2019-09-30 10:56:50 -04:00
|
|
|
|
|
|
|
|
cat << EOF > README.%{distroname_ext}
|
|
|
|
|
This package increases the default limit of the ancillary buffer size
|
|
|
|
|
per kernel socket defined in \`net.core.optmem_max\` to %{sysctl_optmem_max} bytes.
|
|
|
|
|
|
|
|
|
|
For this preset to become active it requires a reboot after the
|
|
|
|
|
installation of this package. You can also manually increase this
|
|
|
|
|
limit by invocing \`sysctl net.core.optmem_max=%{sysctl_optmem_max}\` as the
|
|
|
|
|
super-user, e.g. using \`su\` or \`sudo\` on the terminal.
|
|
|
|
|
|
|
|
|
|
This is done to provide consumers of the new Linux Kernel Crypto API
|
|
|
|
|
User Space Interface a well sufficient and reasonable maximum limit
|
|
|
|
|
by default, especially when using AIO with a larger amount of IOVECs.
|
|
|
|
|
|
|
|
|
|
For further information about the AF_ALG kernel socket and AIO, see
|
|
|
|
|
the discussion at the kernel-crypto mailing-list:
|
|
|
|
|
https://www.mail-archive.com/linux-crypto@vger.kernel.org/msg30417.html
|
|
|
|
|
|
|
|
|
|
See the instructions given in '%{_sysctldir}/50-default.conf',
|
|
|
|
|
if you need or want to override the preset made by this package.
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
cat << EOF > %{sysctl_prio}-%{name}-optmem_max.conf
|
|
|
|
|
# See the 'README.%{distroname_ext}' file shipped in %%doc
|
|
|
|
|
# with the %{name} package.
|
|
|
|
|
#
|
|
|
|
|
# See '%{_sysctldir}/50-default.conf',
|
|
|
|
|
# if you need or want to override this preset.
|
|
|
|
|
|
|
|
|
|
# Increase the ancillary buffer size per socket.
|
|
|
|
|
net.core.optmem_max = %{sysctl_optmem_max}
|
|
|
|
|
EOF
|
|
|
|
|
|
|
|
|
|
%{_bindir}/autoreconf -fiv
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
%configure \
|
|
|
|
|
--libdir=/%{_lib} \
|
|
|
|
|
--disable-silent-rules \
|
|
|
|
|
--enable-kcapi-encapp \
|
|
|
|
|
--enable-kcapi-dgstapp \
|
|
|
|
|
--enable-kcapi-hasher \
|
|
|
|
|
--enable-kcapi-rngapp \
|
|
|
|
|
--enable-kcapi-speed \
|
|
|
|
|
--enable-kcapi-test \
|
|
|
|
|
--enable-shared \
|
|
|
|
|
--enable-static \
|
|
|
|
|
--enable-sum-prefix= \
|
|
|
|
|
--enable-sum-dir=/%{_lib} \
|
|
|
|
|
--with-pkgconfigdir=%{_libdir}/pkgconfig
|
|
|
|
|
%make_build all doc
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%make_install
|
|
|
|
|
|
|
|
|
|
# Install sysctl.d preset.
|
|
|
|
|
mkdir -p %{buildroot}%{_sysctldir}
|
|
|
|
|
install -Dpm 0644 -t %{buildroot}%{_sysctldir} %{sysctl_prio}-%{name}-optmem_max.conf
|
|
|
|
|
|
|
|
|
|
# Install into proper location for inclusion by %%doc.
|
|
|
|
|
mkdir -p %{buildroot}%{_pkgdocdir}
|
2022-07-13 14:43:55 +08:00
|
|
|
install -Dpm 0644 -t %{buildroot}%{_pkgdocdir} README.%{distroname_ext} README.md CHANGES.md TODO
|
|
|
|
|
%if 0%{?enable_docbook_pdf}
|
|
|
|
|
install -Dpm 0644 -t %{buildroot}%{_pkgdocdir} doc/%{name}.p{df,s}
|
|
|
|
|
%endif
|
2019-09-30 10:56:50 -04:00
|
|
|
cp -pr lib/doc/html %{buildroot}%{_pkgdocdir}
|
|
|
|
|
|
|
|
|
|
# Install replacement tools, if enabled.
|
|
|
|
|
rm -f %{buildroot}%{_bindir}/md5sum \
|
|
|
|
|
%{buildroot}%{_bindir}/sha*sum \
|
2022-11-16 11:54:12 +08:00
|
|
|
%{buildroot}%{_bindir}/fips* \
|
|
|
|
|
%{buildroot}%{_bindir}/sm*sum
|
2019-09-30 10:56:50 -04:00
|
|
|
|
|
|
|
|
find %{buildroot} -type f -name '*.la' -print -delete
|
|
|
|
|
find %{buildroot} -type f -name '*.hmac' -print -delete
|
|
|
|
|
find %{buildroot} -type f -size 0 -print -delete
|
|
|
|
|
find %{buildroot}%{_pkgdocdir} -type f -print | xargs %{__chmod} -c 0644
|
|
|
|
|
find %{buildroot}%{_pkgdocdir} -type d -print | xargs %{__chmod} -c 0755
|
|
|
|
|
|
|
|
|
|
for d in %{_mandir} %{_pkgdocdir}; do
|
2020-07-16 22:02:54 +08:00
|
|
|
hardlink -cfv %{buildroot}$d
|
2019-09-30 10:56:50 -04:00
|
|
|
done
|
|
|
|
|
|
|
|
|
|
%ldconfig_scriptlets
|
|
|
|
|
|
|
|
|
|
%check
|
2021-12-30 11:07:46 +08:00
|
|
|
for t in cppcheck scan;do
|
|
|
|
|
%make_build $t
|
|
|
|
|
done
|
2019-09-30 10:56:50 -04:00
|
|
|
|
2022-01-26 14:56:10 +08:00
|
|
|
pushd test
|
|
|
|
|
ENABLE_FUZZ_TEST=1 \
|
|
|
|
|
NO_32BIT_TEST=1 \
|
|
|
|
|
./test-invocation.sh ||:
|
|
|
|
|
popd
|
|
|
|
|
|
2019-09-30 10:56:50 -04:00
|
|
|
%files
|
|
|
|
|
%doc %dir %{_pkgdocdir}
|
|
|
|
|
%doc %{_pkgdocdir}/README.md
|
|
|
|
|
%license COPYING*
|
|
|
|
|
/%{_lib}/%{name}.so.*
|
|
|
|
|
/%{_lib}/fipscheck/%{name}.so.*
|
|
|
|
|
%doc %{_pkgdocdir}/README.%{distroname_ext}
|
|
|
|
|
%{_sysctldir}/%{sysctl_prio}-%{name}-optmem_max.conf
|
|
|
|
|
%{_bindir}/kcapi*
|
2019-12-13 15:37:32 +08:00
|
|
|
%{_bindir}/sha*hmac
|
2022-11-16 11:54:12 +08:00
|
|
|
%{_bindir}/sm*hmac
|
2019-12-13 15:37:32 +08:00
|
|
|
/%{_lib}/hmaccalc/sha*hmac.hmac
|
2022-11-16 11:54:12 +08:00
|
|
|
/%{_lib}/hmaccalc/sm*hmac.hmac
|
2019-09-30 10:56:50 -04:00
|
|
|
|
|
|
|
|
%files devel
|
|
|
|
|
%doc %{_pkgdocdir}/CHANGES.md
|
|
|
|
|
%doc %{_pkgdocdir}/TODO
|
|
|
|
|
%{_includedir}/kcapi.h
|
|
|
|
|
/%{_lib}/%{name}.so
|
|
|
|
|
%{_libdir}/pkgconfig/%{name}.pc
|
|
|
|
|
/%{_lib}/%{name}.a
|
|
|
|
|
|
2020-10-16 19:50:28 +08:00
|
|
|
%files tests
|
|
|
|
|
%{_libexecdir}/%{name}/*
|
|
|
|
|
|
2019-09-30 10:56:50 -04:00
|
|
|
%files help
|
|
|
|
|
%doc %{_pkgdocdir}
|
2022-04-29 14:55:58 +08:00
|
|
|
%exclude %{_pkgdocdir}/README.md
|
|
|
|
|
%exclude %{_pkgdocdir}/README.%{distroname_ext}
|
|
|
|
|
%exclude %{_pkgdocdir}/CHANGES.md
|
|
|
|
|
%exclude %{_pkgdocdir}/TODO
|
2019-09-30 10:56:50 -04:00
|
|
|
%{_mandir}/man1/kcapi*.1.*
|
|
|
|
|
%{_mandir}/man3/kcapi_*.3.*
|
|
|
|
|
|
|
|
|
|
%changelog
|
2024-01-18 14:50:19 +08:00
|
|
|
* Thu Jan 18 2024 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-6
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:simplified control macro
|
|
|
|
|
|
2023-08-16 16:19:05 +08:00
|
|
|
* Wed Aug 16 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-5
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:refix the failure of building with cppcheck>=2.11 by using upstream patch
|
|
|
|
|
|
2023-08-15 16:14:14 +08:00
|
|
|
* Tue Aug 15 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-4
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:append newline to command /usr/bin/sha*hmac
|
|
|
|
|
|
2023-07-25 16:41:21 +08:00
|
|
|
* Tue Jul 25 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-3
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:fix the failure of building with cppcheck >= 2.11
|
|
|
|
|
|
2023-04-28 12:38:02 +08:00
|
|
|
* Fri Apr 28 2023 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-2
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:calculate hmac file after installing for binary
|
|
|
|
|
|
2022-11-16 11:54:12 +08:00
|
|
|
* Wed Nov 16 2022 yixiangzhike <yixiangzhike007@163.com> - 1.4.0-1
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Update to 1.4.0
|
|
|
|
|
|
2022-07-13 14:43:55 +08:00
|
|
|
* Wed Jul 13 2022 yixiangzhike <yixiangzhike007@163.com> - 1.3.1-5
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:add macro to control docbook-utils-pdf dependency
|
|
|
|
|
|
2022-04-29 14:55:58 +08:00
|
|
|
* Fri Apr 29 2022 yixiangzhike <yixiangzhike007@163.com> - 1.3.1-4
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:delete duplicate files from libkcapi-help
|
|
|
|
|
|
2022-04-15 09:23:12 +08:00
|
|
|
* Fri Apr 15 2022 yixiangzhike <yixiangzhike007@163.com> - 1.3.1-3
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:fix printf usage errors highlighted by covscan
|
|
|
|
|
|
2022-01-26 14:56:10 +08:00
|
|
|
* Wed Jan 26 2022 yixiangzhike <yixiangzhike007@163.com> - 1.3.1-2
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:enable test suite in check
|
|
|
|
|
|
2021-12-30 11:07:46 +08:00
|
|
|
* Thu Dec 30 2021 yixiangzhike <yixiangzhike007@163.com> - 1.3.1-1
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Update to 1.3.1
|
|
|
|
|
|
2021-07-30 23:00:09 +08:00
|
|
|
* Fri Jul 30 2021 chenyanpanHW <chenyanpan@huawei.com> - 1.2.0-5
|
|
|
|
|
- DESC: delete -S git from %autosetup, and delete BuildRequires git
|
|
|
|
|
|
2020-11-20 10:45:11 +08:00
|
|
|
* Fri Nov 20 2020 panxiaohe <panxiaohe@huawei.com> - 1.2.0-4
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Solve the failure when installing libkcapi-devel
|
|
|
|
|
|
2020-10-22 14:37:40 +08:00
|
|
|
* Thu Oct 22 2020 zhangxingliang <zhangxingliang3@huawei.com> - 1.2.0-3
|
|
|
|
|
- Type:bugfix
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Solve the failure when installing libkcapi-tests
|
|
|
|
|
|
2020-10-16 19:50:28 +08:00
|
|
|
* Fri Oct 16 2020 zhangxingliang <zhangxingliang3@huawei.com> - 1.2.0-2
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:Detach the sub package libkcapi-tests from libkcapi
|
|
|
|
|
|
2020-07-16 22:02:54 +08:00
|
|
|
* Fri Jul 17 2020 yang_zhuang_zhuang<yangzhuangzhuang1@huawei.com> - 1.2.0-1
|
|
|
|
|
- Type:enhancement
|
|
|
|
|
- ID:NA
|
|
|
|
|
- SUG:NA
|
|
|
|
|
- DESC:update to 1.2.0
|
|
|
|
|
|
2019-12-13 15:37:32 +08:00
|
|
|
* Thu Nov 14 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.1.5-2
|
|
|
|
|
- Correct provides of hmaccalc
|
|
|
|
|
|
2019-09-30 10:56:50 -04:00
|
|
|
* Tue Sep 3 2019 openEuler Buildteam <buildteam@openeuler.org> - 1.1.5-1
|
|
|
|
|
- Package init
|