public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
To: git-commits@fedoraproject.org
Subject: [rpms/sbsigntools] f44: Fix intermediate certificate verification in sbverify (resolves rhbz#2578941)
Date: Mon, 23 Nov 2026 10:14:36 GMT	[thread overview]
Message-ID: <179542887695.1.8828944257293904004.rpms-sbsigntools-7aef062a1fab@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/sbsigntools
Branch : f44
Commit : 7aef062a1fab04187d6b989da0f0586212f60d71
Author : Dominik 'Rathann' Mierzejewski <dominik@greysector.net>
Date   : 2026-11-23T11:14:07+01:00
Stats  : +57/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/sbsigntools/c/7aef062a1fab04187d6b989da0f0586212f60d71?branch=f44

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 d135b88..fd07d29 100644
--- a/sbsigntools.spec
+++ b/sbsigntools.spec
@@ -3,7 +3,7 @@
 
 Name:          sbsigntools
 Version:       0.9.5
-Release:       14%{?dist}
+Release:       16%{?dist}
 Summary:       Signing utility for UEFI secure boot
 # Most source code is GPL-3.0-or-later, except:
 # LicenseRef-Fedora-Public-Domain:
@@ -45,6 +45,8 @@ Patch3:        %{name}-no-openssl-engines.patch
 Patch4:        %{name}-binutils.patch
 # remove unused variable
 Patch5:        %{name}-unused-var.patch
+# fix intermediate certificate verification
+Patch6:        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} riscv64
 BuildRequires: make
@@ -94,6 +96,7 @@ Tools to add signatures to EFI binaries and Drivers.
 %endif
 %patch -p 1 -P 4
 %patch -p 1 -P 5
+%patch -p 1 -P 6
 
 %build
 ./autogen.sh
@@ -125,6 +128,9 @@ make check
 %{_mandir}/man1/sbverify.1.*
 
 %changelog
+* Sat Nov 21 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.9.5-16
+- Fix intermediate certificate verification in sbverify (resolves rhbz#2578941)
+
 * Fri Feb 20 2026 Dominik Mierzejewski <dominik@greysector.net> - 0.9.5-15
 - fix build with GCC16 (resolves rhbz#2435092)
 

                 reply	other threads:[~2026-11-23 10:14 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179542887695.1.8828944257293904004.rpms-sbsigntools-7aef062a1fab@fedoraproject.org \
    --to=dominik@greysector.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox