fix the self-check error in FIPS mode

(cherry picked from commit 138eaf80c73b040831a48623c96b6762a7edb144)
This commit is contained in:
hugel 2024-09-12 15:39:02 +08:00 committed by openeuler-sync-bot
parent b91aad889a
commit 44db5ca7be

View File

@ -4,7 +4,7 @@
Name: libgcrypt
Version: 1.10.2
Release: 1
Release: 2
Summary: A general-purpose cryptography library
License: LGPLv2+
URL: https://www.gnupg.org/
@ -47,15 +47,19 @@ sed -i -e '/^sys_lib_dlsearch_path_spec/s,/lib /usr/lib,/usr/lib /lib64 /usr/lib
%make_build
%check
src/hmac256 %{hmackey} src/.libs/%{gcrysoname} | cut -f1 -d ' ' >src/.libs/.%{gcrysoname}.hmac
make check
%define libpath $RPM_BUILD_ROOT%{gcrylibdir}/%{gcrysoname}.?.?
%define __spec_install_post \
%{?__debug_package:%{__debug_install_post}} \
%{__arch_install_post} \
%{__os_install_post} \
src/hmac256 %{hmackey} $RPM_BUILD_ROOT%{gcrylibdir}/%{gcrysoname} | cut -f1 -d ' ' >$RPM_BUILD_ROOT%{gcrylibdir}/.%{gcrysoname}.hmac \
cd src \
sed -i -e 's|FILE=.*|FILE=\\\$1|' gen-note-integrity.sh \
READELF=readelf AWK=awk ECHO_N="-n" bash gen-note-integrity.sh %{libpath} > %{libpath}.hmac \
objcopy --update-section .note.fdo.integrity=%{libpath}.hmac %{libpath} %{libpath}.new \
mv -f %{libpath}.new %{libpath} \
rm -f %{libpath}.hmac
%{nil}
%install
@ -102,7 +106,6 @@ install -m644 %{SOURCE7} $RPM_BUILD_ROOT/etc/gcrypt/random.conf
%dir /etc/gcrypt
%config(noreplace) /etc/gcrypt/random.conf
%{gcrylibdir}/*.so.*
%{gcrylibdir}/.*.so.*.hmac
%exclude %{_infodir}/dir
%files devel
@ -119,6 +122,12 @@ install -m644 %{SOURCE7} $RPM_BUILD_ROOT/etc/gcrypt/random.conf
%{_infodir}/gcrypt.info*
%changelog
* Thu Sep 12 2024 hugel <gengqihu2@h-partners.com> - 1.10.2-2
- Type:bugfix
- ID:NA
- SUG:NA
- DESC:fix the self-check error in FIPS mode
* Mon Jul 24 2023 zhengxiaoxiao <zhengxiaoxiao2@huawei.com> - 1.10.2-1
- Type:requirements
- ID:NA