public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/sbsigntools] epel9: Fix intermediate certificate verification in sbverify (resolves rhbz#2578941)
@ 2026-11-30 22:23 Dominik 'Rathann' Mierzejewski
  0 siblings, 0 replies; only message in thread
From: Dominik 'Rathann' Mierzejewski @ 2026-11-30 22:23 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/sbsigntools
Branch : epel9
Commit : 4fc333b2c404c6f65fa01564bed6023aeca3242a
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date   : 2026-11-30T23:18:35+01:00
Stats  : +56/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/sbsigntools/c/4fc333b2c404c6f65fa01564bed6023aeca3242a?branch=epel9

Log:
Fix intermediate certificate verification in sbverify (resolves rhbz#2578941)

---
diff --git a/sbsigntools-intermediate-cert-verify.patch b/sbsigntools-intermediate-cert-verify.patch
new file mode 100644
index 0000000..479b4b2
--- /dev/null
+++ b/sbsigntools-intermediate-cert-verify.patch
@@ -0,0 +1,50 @@
+From db731f0c4dd75e112e2abdfbe9443065742e58c3 Mon Sep 17 00:00:00 2001
+From: James Bottomley <James.Bottomley@HansenPartnership.com>
+Date: Wed, 15 Apr 2026 10:06:02 -0400
+Subject: sbverify: fix intermediate certificate verification
+
+Openssl verification of partial chains cannot be fixed by checking
+error codes in the verify callback (because the errors for
+intermediate verified OK and failed are identical).  Instead they must
+be fixed by setting the verification flag X509_V_FLAG_PARTIAL_CHAIN
+which treats any intermediate cert found as a CA.
+
+Fixes: df27a41 ("sbverify: fix verification with intermediate certificates")
+Tested-by: evilteq@anddroptable.net
+Tested-by: Steve McIntyre <steve@einval.com>
+Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
+---
+ src/sbverify.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/sbverify.c b/src/sbverify.c
+index 8f14f35..422b3e0 100644
+--- a/src/sbverify.c
++++ b/src/sbverify.c
+@@ -212,6 +212,7 @@ static int x509_verify_cb(int status, X509_STORE_CTX *ctx)
+ 
+ 	else if (err == X509_V_ERR_CERT_UNTRUSTED ||
+ 		 err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT ||
++		 err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY ||
+ 		 err == X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE) {
+ 		/* all certs given with the --cert argument are trusted */
+ 
+@@ -220,7 +221,6 @@ static int x509_verify_cb(int status, X509_STORE_CTX *ctx)
+ 	} else if (err == X509_V_ERR_CERT_HAS_EXPIRED ||
+ 		   err == X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD ||
+ 		   err == X509_V_ERR_CERT_NOT_YET_VALID ||
+-		   err == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY ||
+ 		   err == X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD)
+ 		/* UEFI explicitly allows expired certificates */
+ 		status = 1;
+@@ -246,6 +246,7 @@ int main(int argc, char **argv)
+ 
+ 	status = VERIFY_FAIL;
+ 	certs = X509_STORE_new();
++	X509_STORE_set_flags(certs, X509_V_FLAG_PARTIAL_CHAIN);
+ 	list = 0;
+ 	verbose = 0;
+ 	detached_sig_filename = NULL;
+-- 
+cgit 1.3.1-korg
+

diff --git a/sbsigntools.spec b/sbsigntools.spec
index ff1b5bc..06d542e 100644
--- a/sbsigntools.spec
+++ b/sbsigntools.spec
@@ -3,7 +3,7 @@
 
 Name:          sbsigntools
 Version:       0.9.5
-Release:       3%{?dist}
+Release:       4%{?dist}
 Summary:       Signing utility for UEFI secure boot
 License:       GPLv3+
 URL:           https://build.opensuse.org/package/show/home:jejb1:UEFI/sbsigntools
@@ -15,6 +15,8 @@ Source1:       %{name}-mktarball.sh
 Patch0:        %{name}-no-git.patch
 # add Fedora gnu-efi path and link statically against libefi.a/libgnuefi.a
 Patch1:        %{name}-gnuefi.patch
+# fix intermediate certificate verification
+Patch2:        https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git/patch/?id=db731f0c4dd75e112e2abdfbe9443065742e58c3#/%{name}-intermediate-cert-verify.patch
 # same as gnu-efi
 ExclusiveArch: x86_64 aarch64 %{arm} %{ix86}
 BuildRequires: make
@@ -82,6 +84,9 @@ make check
 %{_mandir}/man1/sbverify.1.*
 
 %changelog
+* Sat Nov 21 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.9.5-4
+- Fix intermediate certificate verification in sbverify (resolves rhbz#2578941)
+
 * Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.9.5-3
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-30 22:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-30 22:23 [rpms/sbsigntools] epel9: Fix intermediate certificate verification in sbverify (resolves rhbz#2578941) Dominik 'Rathann' Mierzejewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox