From 769ff26a6c62a3801e271311f4e06a105580f096 Mon Sep 17 00:00:00 2001 From: Huaxin Lu Date: Fri, 16 Aug 2024 12:32:56 +0800 Subject: [PATCH] Fix the wrong IMA signature header check --- Add-digest-list-plugin.patch | 2 +- rpm.spec | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Add-digest-list-plugin.patch b/Add-digest-list-plugin.patch index dc129ea..9298343 100644 --- a/Add-digest-list-plugin.patch +++ b/Add-digest-list-plugin.patch @@ -424,7 +424,7 @@ index 0000000..c1864c7 + return -EACCES; + + /* Check if the signature has already included a header */ -+ hdr_exist = (sig_size - sizeof(sig_hdr) % 128) == 0 ? 0 : 1; ++ hdr_exist = (st.st_size - sizeof(sig_hdr)) % 128 == 0 ? 1 : 0; + if (!hdr_exist) { + ret = fill_pgp_signature_header(te, sig_hdr); + if (ret < 0) diff --git a/rpm.spec b/rpm.spec index 83716c9..498d914 100644 --- a/rpm.spec +++ b/rpm.spec @@ -1,6 +1,6 @@ Name: rpm Version: 4.17.0 -Release: 41 +Release: 42 Summary: RPM Package Manager License: GPLv2+ URL: http://www.rpm.org/ @@ -415,6 +415,9 @@ make check || (cat tests/rpmtests.log; exit 0) %{_mandir}/man1/gendiff.1* %changelog +* Tue Aug 20 2024 luhuaxin - 4.17.0-42 +- Fix the wrong IMA signature header check + * Mon Aug 19 2024 luhuaxin - 4.17.0-41 - Fix the judgement of digests count