Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package pesign-obs-integration for 
openSUSE:Factory checked in at 2026-11-21 21:44:46
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/pesign-obs-integration (Old)
 and      /work/SRC/openSUSE:Factory/.pesign-obs-integration.new.1340718 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "pesign-obs-integration"

Sat Nov 21 21:44:46 2026 rev:68 rq:1398654 version:10.2+git20261118.9b25f14

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/pesign-obs-integration/pesign-obs-integration.changes
    2026-08-13 13:15:26.272323129 +0200
+++ 
/work/SRC/openSUSE:Factory/.pesign-obs-integration.new.1340718/pesign-obs-integration.changes
       2026-11-21 21:44:56.975446864 +0100
@@ -1,0 +2,9 @@
+Wed Nov 18 06:32:50 UTC 2026 - [email protected]
+
+- Update to version 10.2+git20261118.9b25f14:
+  * README.md: Add note for BRP_PESIGN_PCRSIG_FILES does not support 
RemovePathPostFixes
+  * Sign the TPM2 PCR policies of Unified Kernel Images
+  * modsign-repackage: fix PIPESTATUS scoping when verifying detached signature
+  * fix: correct RemovePathPostFixes typo in brp-99-pesign
+
+-------------------------------------------------------------------

Old:
----
  pesign-obs-integration-10.2+git20260731.2d86941.obscpio

New:
----
  pesign-obs-integration-10.2+git20261118.9b25f14.obscpio

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ pesign-obs-integration.spec ++++++
--- /var/tmp/diff_new_pack.LvASx5/_old  2026-11-21 21:44:58.360505175 +0100
+++ /var/tmp/diff_new_pack.LvASx5/_new  2026-11-21 21:44:58.362505259 +0100
@@ -22,7 +22,7 @@
 %endif
 
 Name:           pesign-obs-integration
-Version:        10.2+git20260731.2d86941
+Version:        10.2+git20261118.9b25f14
 Release:        0
 Summary:        Macros and scripts to sign the kernel and bootloader
 License:        GPL-2.0-or-later
@@ -37,6 +37,8 @@
 Requires:       nss-tools
 %endif
 Requires:       openssl
+# For pesign-pcrsig
+Requires:       perl
 # suse-module-tools <= 15.0.10 contains modsign-verify
 %if 0%{?suse_version}
 Requires:       suse-module-tools >= 15.0.10
@@ -44,9 +46,6 @@
 %ifarch %{ix86} x86_64 ia64 aarch64 %{arm} riscv64 loongarch64
 Requires:       pesign
 %endif
-%ifarch x86_64 aarch64
-Requires:       efitools
-%endif
 
 %description
 This package provides scripts and rpm macros to automate signing of the
@@ -60,7 +59,7 @@
 %install
 
 mkdir -p %{buildroot}%{_prefix}/lib/rpm/brp-suse.d 
%{buildroot}%{_prefix}/lib/rpm/pesign
-install pesign-gen-repackage-spec kernel-sign-file gen-hmac 
%{buildroot}%{_prefix}/lib/rpm/pesign
+install pesign-gen-repackage-spec pesign-pcrsig kernel-sign-file gen-hmac 
%{buildroot}%{_prefix}/lib/rpm/pesign
 install brp-99-pesign %{buildroot}%{_prefix}/lib/rpm/brp-suse.d
 # brp-99-compress-vmlinux has nothing to do with signing. It is packaged in
 # pesign-obs-integration because this package is already used by the kernel

++++++ _servicedata ++++++
--- /var/tmp/diff_new_pack.LvASx5/_old  2026-11-21 21:44:58.405507069 +0100
+++ /var/tmp/diff_new_pack.LvASx5/_new  2026-11-21 21:44:58.408507196 +0100
@@ -1,6 +1,6 @@
 <servicedata>
 <service name="tar_scm">
                 <param 
name="url">https://github.com/openSUSE/pesign-obs-integration.git</param>
-              <param 
name="changesrevision">2d86941ad1a5d530fc53a689c3c8cc20b117a481</param></service></servicedata>
+              <param 
name="changesrevision">9b25f147e6140af3632854c86a3149b1e17069c2</param></service></servicedata>
 (No newline at EOF)
 

++++++ pesign-obs-integration-10.2+git20260731.2d86941.obscpio -> 
pesign-obs-integration-10.2+git20261118.9b25f14.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/README.md 
new/pesign-obs-integration-10.2+git20261118.9b25f14/README.md
--- old/pesign-obs-integration-10.2+git20260731.2d86941/README.md       
2026-07-31 09:57:07.000000000 +0200
+++ new/pesign-obs-integration-10.2+git20261118.9b25f14/README.md       
2026-11-18 07:20:56.000000000 +0100
@@ -12,6 +12,16 @@
 BRP_PESIGN_PACKAGES can optionally be defined to restrict repacking to a subset
 of packages of choice.
 
+BRP_PESIGN_PCRSIG_FILES can list Unified Kernel Images built with
+`ukify build --policy-digest --pcr-certificate=%_sourcedir/_projectcert.crt`.
+The TPM2 PCR policies in their .pcrsig section are signed and stored back in
+the section. As the Authenticode signature covers the .pcrsig section, these
+files cannot be also listed in BRP_PESIGN_FILES: a second package has to sign
+them for Secure Boot after this one. Only RSA keys are supported, and the TPM
+must support the key size (usually RSA 2048).
+Note: BRP_PESIGN_PCRSIG_FILES does not support RemovePathPostFixes.
+(https://github.com/openSUSE/pesign-obs-integration/pull/90)
+
 Debian packages need to add the following line to the Source stanza in the
 debian/control file, which will add "Obs: needssslcertforbuild" to the 
generated
 .dsc file:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/brp-99-pesign 
new/pesign-obs-integration-10.2+git20261118.9b25f14/brp-99-pesign
--- old/pesign-obs-integration-10.2+git20260731.2d86941/brp-99-pesign   
2026-07-31 09:57:07.000000000 +0200
+++ new/pesign-obs-integration-10.2+git20261118.9b25f14/brp-99-pesign   
2026-11-18 07:20:56.000000000 +0100
@@ -30,6 +30,10 @@
 if test -n "${BRP_PESIGN_PACKAGES+x}"; then
        packages=${BRP_PESIGN_PACKAGES}
 fi
+pcrsig_files=
+if test -n "${BRP_PESIGN_PCRSIG_FILES+x}"; then
+       pcrsig_files=${BRP_PESIGN_PCRSIG_FILES}
+fi
 output=
 while test $# -gt 0; do
        case "$1" in
@@ -41,6 +45,10 @@
                packages=$2
                shift 2
                ;;
+       --pcrsig-files)
+               pcrsig_files=$2
+               shift 2
+               ;;
        --output)
                output=$2
                shift 2
@@ -50,7 +58,7 @@
                exit 1
        esac
 done
-if test -z "$files"; then
+if test -z "$files" -a -z "$pcrsig_files"; then
        exit 0
 fi
 if test -z "$output"; then
@@ -78,7 +86,7 @@
 # pkg_name:rpp_suffix mapping string: "pkg-A:.suffixA pkg-B:.suffixB"
 POSTFIX_MAP_STR=""
 if [ -z "$SPEC_LIST" ]; then
-    echo "No spec files found. RemovePaathPostFixes mapping failed."
+    echo "No spec files found. RemovePathPostFixes mapping failed."
 else
     for spec in $SPEC_LIST; do
        # Using awk for parsing spec file
@@ -231,7 +239,11 @@
 certutil -N -d "$nss_db" -f "$nss_db/passwd"
 
 echo "Creating $archive"
-files=($(find . -type f \( "${args[@]}" \)))
+if test ${#args[@]} -gt 0; then
+       files=($(find . -type f \( "${args[@]}" \)))
+else
+       files=()
+fi
 for f in "${files[@]}"; do
        dest="$archive_dir/$f"
        mkdir -p "${dest%/*}"
@@ -248,6 +260,17 @@
                cp "$f" "$dest"
        esac
 done
+# Unified Kernel Images built with "ukify --policy-digest" carry in the .pcrsig
+# section the TPM2 PCR policies to sign. Export the data to sign of each one as
+# <file>.pcrsig.<bank>.<index>
+for pattern in $pcrsig_files; do
+       pattern=${pattern#/}
+       for f in $(find . -type f -path "./$pattern"); do
+               dest="$archive_dir/$f"
+               mkdir -p "${dest%/*}"
+               /usr/lib/rpm/pesign/pesign-pcrsig export "$f" "$dest.pcrsig"
+       done
+done
 cd "$archive_dir"
 nfiles="$(find . -type f | wc -l)"
 if [ "$nfiles" != 0 ] ; then
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/modsign-repackage 
new/pesign-obs-integration-10.2+git20261118.9b25f14/modsign-repackage
--- old/pesign-obs-integration-10.2+git20260731.2d86941/modsign-repackage       
2026-07-31 09:57:07.000000000 +0200
+++ new/pesign-obs-integration-10.2+git20261118.9b25f14/modsign-repackage       
2026-11-18 07:20:56.000000000 +0100
@@ -152,9 +152,9 @@
                        exit 1
                fi
                status=0
-               output=$(openssl rsautl -verify -inkey "$cert.pub" -pubin -in 
"$raw_sig" 2>/dev/null | xxd -p -c 256)
-               status=${PIPESTATUS[0]}
+               output=$(openssl rsautl -verify -inkey "$cert.pub" -pubin -in 
"$raw_sig" 2>/dev/null | xxd -p -c 256; exit ${PIPESTATUS[0]}) || status=$?
                if [ "$status" -ne 0 ]; then
+                       output=$(openssl rsautl -verify -inkey "$cert.pub" 
-pubin -in "$raw_sig" 2>&1 >/dev/null | grep -v 'deprecated' || true)
                        echo "$raw_sig signature can not be decrypted by $cert, 
exit code: $status, output: $output" >&2
                        exit 1
                fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-obs-integration.spec 
new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-obs-integration.spec
--- 
old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-obs-integration.spec 
    2026-07-31 09:57:07.000000000 +0200
+++ 
new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-obs-integration.spec 
    2026-11-18 07:20:56.000000000 +0100
@@ -37,6 +37,8 @@
 Requires:       nss-tools
 %endif
 Requires:       openssl
+# For pesign-pcrsig
+Requires:       perl
 # suse-module-tools <= 15.0.10 contains modsign-verify
 %if 0%{?suse_version}
 Requires:       suse-module-tools >= 15.0.10
@@ -57,7 +59,7 @@
 %install
 
 mkdir -p %{buildroot}%{_prefix}/lib/rpm/brp-suse.d 
%{buildroot}%{_prefix}/lib/rpm/pesign
-install pesign-gen-repackage-spec kernel-sign-file gen-hmac 
%{buildroot}%{_prefix}/lib/rpm/pesign
+install pesign-gen-repackage-spec pesign-pcrsig kernel-sign-file gen-hmac 
%{buildroot}%{_prefix}/lib/rpm/pesign
 install brp-99-pesign %{buildroot}%{_prefix}/lib/rpm/brp-suse.d
 # brp-99-compress-vmlinux has nothing to do with signing. It is packaged in
 # pesign-obs-integration because this package is already used by the kernel
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-pcrsig 
new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-pcrsig
--- old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-pcrsig   
1970-01-01 01:00:00.000000000 +0100
+++ new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-pcrsig   
2026-11-18 07:20:56.000000000 +0100
@@ -0,0 +1,152 @@
+#!/usr/bin/perl
+# Sign the TPM2 PCR policies of a Unified Kernel Image in the Open Build 
Service
+#
+# A UKI built with "ukify build --policy-digest --pcr-certificate=CERT" carries
+# in its .pcrsig section a JSON document with, for each PCR bank, a list of
+# policies.  Each policy has the data to sign ("tbs", hex) instead of the
+# signature ("sig", base64).  The signature the TPM verifies is RSA PKCS#1 v1.5
+# over SHA-256 of "tbs", the same one the signing server makes for any file.
+#
+#   pesign-pcrsig export UKI PREFIX
+#       Write the data to sign of each policy to PREFIX.<bank>.<index>
+#
+#   pesign-pcrsig import UKI PREFIX PUBKEY
+#       Read the signatures from PREFIX.<bank>.<index>.sig, check that the
+#       policies were made for PUBKEY (PEM, RSA), and store the signatures in
+#       the .pcrsig section.  The section is overwritten in place, padded with
+#       spaces to its size, so nothing else in the PE file changes (layout,
+#       headers, the other sections measured in PCR 11)
+
+use strict;
+use warnings;
+
+use Digest::SHA qw(sha256_hex);
+use JSON::PP;
+use MIME::Base64;
+
+sub usage {
+       print STDERR "Usage: $0 export UKI PREFIX\n";
+       print STDERR "       $0 import UKI PREFIX PUBKEY\n";
+       exit 1;
+}
+
+sub slurp {
+       my ($file) = @_;
+       local $/;
+       open(my $fh, "<:raw", $file) or die "$file: $!\n";
+       my $data = <$fh>;
+       close($fh);
+       return $data;
+}
+
+sub read_at {
+       my ($fh, $file, $offset, $size) = @_;
+       my $data;
+       seek($fh, $offset, 0) or die "$file: $!\n";
+       read($fh, $data, $size) == $size or die "$file: truncated PE file\n";
+       return $data;
+}
+
+# Find the .pcrsig section in the section table of the PE file, and return its
+# offset in the file and its size
+sub find_pcrsig {
+       my ($fh, $uki) = @_;
+       my $pe = unpack("V", read_at($fh, $uki, 0x3c, 4));
+       my ($magic, $nsections, $optsize) =
+               unpack("a4 x2 v x12 v", read_at($fh, $uki, $pe, 22));
+       $magic eq "PE\0\0" or die "$uki: not a PE file\n";
+       my $table = $pe + 24 + $optsize;
+       for my $i (0 .. $nsections - 1) {
+               my ($name, $vsize, $rawsize, $rawptr) =
+                       unpack("Z8 V x4 V V", read_at($fh, $uki, $table + 40 * 
$i, 24));
+               next unless $name eq ".pcrsig";
+               # The stub reads VirtualSize bytes; the file may have more 
padding
+               my $size = $vsize && $vsize < $rawsize ? $vsize : $rawsize;
+               return ($rawptr, $size);
+       }
+       die "$uki: no .pcrsig section\n";
+}
+
+sub read_pcrsig {
+       my ($uki) = @_;
+       open(my $fh, "<:raw", $uki) or die "$uki: $!\n";
+       my ($offset, $size) = find_pcrsig($fh, $uki);
+       my $data = read_at($fh, $uki, $offset, $size);
+       close($fh);
+       return $data;
+}
+
+sub write_pcrsig {
+       my ($uki, $data) = @_;
+       open(my $fh, "+<:raw", $uki) or die "$uki: $!\n";
+       my ($offset, $size) = find_pcrsig($fh, $uki);
+       length($data) <= $size
+               or die "$uki: the signatures do not fit in the .pcrsig 
section\n";
+       seek($fh, $offset, 0) or die "$uki: $!\n";
+       print $fh $data, " " x ($size - length($data));
+       close($fh) or die "$uki: $!\n";
+}
+
+# Call $code for each policy, with its bank and its index in the bank
+sub for_each_policy {
+       my ($json, $code) = @_;
+       for my $bank (sort keys %$json) {
+               my $i = 0;
+               for my $policy (@{$json->{$bank}}) {
+                       $code->($policy, $bank, $i++);
+               }
+       }
+}
+
+sub export_tbs {
+       my ($uki, $prefix) = @_;
+       my $json = decode_json(read_pcrsig($uki));
+       for_each_policy($json, sub {
+               my ($policy, $bank, $i) = @_;
+               defined $policy->{tbs} or die "$uki: no data to sign in $bank 
(not built with --policy-digest?)\n";
+               open(my $out, ">:raw", "$prefix.$bank.$i") or die 
"$prefix.$bank.$i: $!\n";
+               print $out pack("H*", $policy->{tbs});
+               close($out);
+       });
+}
+
+# systemd identifies the key by the SHA-256 of its RSAPublicKey (PKCS#1)
+# structure
+sub fingerprint {
+       my ($pubkey) = @_;
+       # openssl reports "writing RSA key" on stderr
+       open(my $stderr, ">&", \*STDERR) or die "stderr: $!\n";
+       open(STDERR, ">", "/dev/null") or die "/dev/null: $!\n";
+       open(my $fh, "-|", "openssl", "rsa", "-pubin", "-in", $pubkey,
+            "-RSAPublicKey_out", "-outform", "DER")
+               or die "openssl: $!\n";
+       open(STDERR, ">&", $stderr) or die "stderr: $!\n";
+       binmode($fh);
+       local $/;
+       my $der = <$fh>;
+       close($fh) or die "$pubkey: not an RSA public key\n";
+       return sha256_hex($der);
+}
+
+sub import_sig {
+       my ($uki, $prefix, $pubkey) = @_;
+       my $json = decode_json(read_pcrsig($uki));
+       my $pkfp = fingerprint($pubkey);
+       for_each_policy($json, sub {
+               my ($policy, $bank, $i) = @_;
+               ($policy->{pkfp} // "") eq $pkfp
+                       or die "$uki: the PCR public key does not match the 
certificate\n";
+               $policy->{sig} = encode_base64(slurp("$prefix.$bank.$i.sig"), 
"");
+               delete $policy->{tbs};
+       });
+       write_pcrsig($uki, JSON::PP->new->canonical->encode($json));
+}
+
+my $cmd = shift @ARGV // usage();
+if ($cmd eq "export" && @ARGV == 2) {
+       export_tbs(@ARGV);
+} elsif ($cmd eq "import" && @ARGV == 3) {
+       import_sig(@ARGV);
+} else {
+       usage();
+}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-repackage.spec.in 
new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-repackage.spec.in
--- 
old/pesign-obs-integration-10.2+git20260731.2d86941/pesign-repackage.spec.in    
    2026-07-31 09:57:07.000000000 +0200
+++ 
new/pesign-obs-integration-10.2+git20261118.9b25f14/pesign-repackage.spec.in    
    2026-11-18 07:20:56.000000000 +0100
@@ -189,6 +189,7 @@
 # Extract the public key of the certificate
 openssl x509 -in "$cert" -inform DER -pubkey -noout > "$cert.pub"
 
+pcrsig_files=()
 sigs=($(find -type f -name '*.sig' -printf '%%P\n'))
 for sig in "${sigs[@]}"; do
        # Verify the signature with the public key of the certificate
@@ -284,11 +285,24 @@
                        exit 1
                fi
                ;;
+       *.pcrsig.*.sig)
+               # Collected below, once all the signatures of the policies are 
here
+               uki=${sig%%.pcrsig.*}
+               if [[ " ${pcrsig_files[*]} " != *" $uki "* ]]; then
+                       pcrsig_files=("${pcrsig_files[@]}" "$uki")
+               fi
+               ;;
        *)
                echo "Warning: unhandled signature: $sig" >&2
        esac
 done
 
+# Store the signatures of the TPM2 PCR policies in the .pcrsig section of the
+# Unified Kernel Images
+for uki in "${pcrsig_files[@]}"; do
+       /usr/lib/rpm/pesign/pesign-pcrsig import "%buildroot/$uki" 
"$uki.pcrsig" "$cert.pub"
+done
+
 # Remove the public key file
 rm "$cert.pub"
 

++++++ pesign-obs-integration.obsinfo ++++++
--- /var/tmp/diff_new_pack.LvASx5/_old  2026-11-21 21:44:58.518511827 +0100
+++ /var/tmp/diff_new_pack.LvASx5/_new  2026-11-21 21:44:58.521511953 +0100
@@ -1,5 +1,5 @@
 name: pesign-obs-integration
-version: 10.2+git20260731.2d86941
-mtime: 1785484627
-commit: 2d86941ad1a5d530fc53a689c3c8cc20b117a481
+version: 10.2+git20261118.9b25f14
+mtime: 1794982856
+commit: 9b25f147e6140af3632854c86a3149b1e17069c2
 

Reply via email to