328 Commits

Author SHA256 Message Date
23696729d5 shim.changes: Update change log for Fixed some issues in RPM Macro
and pretrans lus script with the old  rpm-4.14.3 on SLE-15-SP3
2025-11-28 16:35:03 +08:00
9ba7595340 shim.spec: Use io.open instead of pcall rpm.open in pretrans lua script
With the rpm-4.14.3 on SLE-15-SP3, using rpm.open through pcall can
not access the db and SecureBoot efi variable files. We got the
following message when the pretrans lua script is running:

WARNING: Attempt to open db EFI variable file failed. Error message:
attempt to call a nil value

Using io.open instead of pcall(rpm.open can workaround this issue.
2025-11-28 14:33:01 +08:00
2a0ca4d82b shim.spec: Workaround the string comparison issue in elif directive
With the rpm-4.14.3 on SLE-15-SP3, the string comparison in elif
directive has problem. It causes that the certificate block in the
elif-endif to disappear permanently, regardless of whether the
comparison succeeds or fails.

This change can also workaround the issue that elif can not handle
special issue_hash/subject_hash from 'openSUSE Secure Boot Signkey':

shim> openssl x509 -in factory-secure-boot.crt -inform PEM -noout -subject_hash
babd5674
shim> openssl x509 -in factory-secure-boot.crt -inform PEM -noout -issuer_hash
d29860c3

Directlly put to global define in shim.spec can reproduce issue:
global prjissuer_hash d29860c3
global prjsubjec_hash babd5674

This patch changed codes by using if-endif instead of elif-endif to
workaround the above two problems
2025-11-28 11:18:47 +08:00
d33006b0e0 shim.spec: Specify the certificate format in openssl commands
The old openssl in SLE-15-SP3 assumes the format of input
certificate is PEM. In d279b0c453 patch, we converted the SUSE
certificates from PEM to DER format for using by Lua in pretrans
script. It causes the openssl command to fail with old openssl.
So we specify the certificate format in openssl commands.
2025-11-27 18:56:46 +08:00
aa888406ee shim.changes: Update change log for adding Microsoft-signed 16.1 shim 2025-11-26 15:51:58 +08:00
afcba83ba7 shim.spec: Temporarily disable nx-shim
We still need time to test nx (non-executable) shim and develop
the script for delivery. We will not support nx-shim on all Leap
and SLE distros because the function should also be supported by
grub2 and kernel.

A shim_nx macro flag be added to shim.spec to block all sections
for building shim-nx package.
2025-11-26 15:29:34 +08:00
204009db90 Add Microsoft-signed 16.1 shim
Add Microsoft-signed 16.1 shim for openSUSE and SLE which includes
x86_64 and aarch64 versions
2025-11-26 14:15:45 +08:00
bca01ceeb2 shim.spec: directly package Microsoft-signed shim
Directly package Microsoft-signed shim when the version of shim
equals with the version of devel shim. The Microsoft-signed shim
can be directly deliveied because we build the binary before and
have the log (shim-review) to prove it.

When the version of build service built shim (aka. devel shim)
does NOT equal to the version of Microsoft-signed shim, it means
we are developing a new shim. We package devel shim instead of
Microsoft-signed shim. The devel shim binary will also be the
candidate for next shim-review.
2025-11-26 14:04:42 +08:00
b9bbafe2c8 shim.spec: Remove the reproducibility check for the shim binary
Remove the reproducibility check for the shim binary before attacing
Microsoft signature. The binutils on Leap 15.6 and SLE-15-SP3 has been
upgraded to 2.45 when we are waiting shim-review and Microsoft signing.
It causes that the shim binary is NOT reproducible on build services.
Which means that the signature of shim from Microsoft can not be
attached on rebuilt shim.

The original design is extract signature from the Microsoft signed back
shim, rebuild shim binary, check the pesign hash of rebuilt shim and
attach Microsoft signature. But in past years, we got at least two times
the bulid service environment be changed when waiting shim-review.
Microsoft doesn't resign shim binary because SUSE build environment be
changed.

In the discussion with Johannes Segitz, he raised the idea from Ludwig
Nussel that we just direct use the Microsoft signed-back shim binaries
because we build this binary before and have the logs to prove it.

Before we find a good approach to save/restore the build service
environment, let’s directly use the Microsoft signed-back shim for
delivery.

This patch removes the reproducibility check logic and all *.asc
signature files.
2025-11-26 00:41:23 +08:00
be10e5ccf5 shim.spec: Improve the target certificates array in pretrans script
For checking Microsoft CA keys in UEFI db, let's add
Microsoft_Corporation_UEFI_CA_2011.crt and Microsoft_UEFI_CA_2023.crt
to the target certificates array (TARGET_CERT_HEXES) in pretrans script.
Because shim 16.1 will be signed by them. This is a transitional period
from MS 2011 key to MS 2023 key. We will receive two MS signatures.

On the other hand, in order to pass the QA test on the devel/staging
project. We also add _projectcert.crt key to TARGET_CERT_HEXES. It's
useful for testing our pretrans lua script on staging project.
2025-11-18 00:21:22 +08:00
a8afdafbaf Certificates: Add Microsoft UEFI CA files
Add Microsoft UEFI

The download links are from Microsoft document:

Windows Secure Boot Key Creation and Management Guidance, 05/19/2022
https://learn.microsoft.com/en-us/windows-hardware/manufacture/desktop/windows-secure-boot-key-creation-and-management-guidance?view=windows-11

------------------------------------------------------------------------
1. Microsoft Corporation UEFI CA 2011
    SHA-1 cert hash: 46DEF63B5CE61CF8BA0DE2E6639C1019D0ED14F3.
    SignatureOwner GUID: {77fa9abd-0359-4d32-bd60-28f4e78f784b}.
    Microsoft will provide the certificate to partners and it can be
added either as an EFI_CERT_X509_GUID or an EFI_CERT_RSA2048_GUID type
signature.
    The Microsoft Corporation UEFI CA 2011 can be downloaded from here:
https://go.microsoft.com/fwlink/p/?linkid=321194.

2. Microsoft UEFI CA 2023
    SHA-1 cert hash: B5EEB4A6706048073F0ED296E7F580A790B59EAA.
    SignatureOwner GUID: {77fa9abd-0359-4d32-bd60-28f4e78f784b}.
    Microsoft will provide the certificate to partners and it can be
added either as an EFI_CERT_X509_GUID or an EFI_CERT_RSA2048_GUID type
signature.
    The Microsoft UEFI CA 2023 can be downloaded from here:
https://go.microsoft.com/fwlink/?linkid=2239872.
------------------------------------------------------------------------

Those two Microsoft certificates will be used in TARGET_CERT_HEXES array
in pretrans script for checking UEFI db has necessary public key before
shim installation is started.
2025-11-17 23:32:10 +08:00
d279b0c453 Certificates: Convert the SUSE certificates from PEM to DER format
OVMF and shim only support DER the format. We will also use pretrans script
to check necessary certificates in the UEFI db to verify shim.
2025-11-17 19:53:45 +08:00
a6485e1d93 shim.changes: Fix typo 2025-11-17 18:52:13 +08:00
7378d6ad88 shim.spec: Reorder the source files
We will put more certificates for checking in installation stage. And
We will also include more signature asc files from Microsoft UEFI CA
2023 key. Therefore, the source files were reordered to facilitate
subsequent development. No functional updates.
2025-11-17 18:33:04 +08:00
44b75cefd8 timestamp.pl: fix the size of checksum in PE Optional Header
Base on Microsoft Portable Executable and Common Object File
Format Specification (Revision 10 – June 15, 2016), the size
of CheckSum in Optional Header is 4 bytes. But temstamp.pl
read and write the CheckSum by 2 bytes. This patch fixes this
size issue.

For a long time, the incorrect size of CheckSum in SUSE shim
did not cause any errors in shim/shim-review. This fact implicitly
confirms that CheckSum is useless for shim boot loader. We didn't
see any Windows loader attempting to load shim.

But I still keep CheckSum in timestamp in case there are any use
case haven't discovered yet.
2025-11-17 17:03:51 +08:00
31c000ebae Add a pretrans script to verify that the necessary certificate is in the UEFI db
Signed-off-by: Chun-Yi Lee <jlee@suse.com>
2025-10-14 00:47:16 +08:00
aa93d6da2e Accepting request 1300222 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1300222
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=133
2025-08-20 11:25:09 +00:00
8a094dabf9 Removed two patches because they are merged to shim 16.1
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=230
2025-08-19 07:50:35 +00:00
6dc4e55076 Update to 16.1
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=229
2025-08-19 06:47:04 +00:00
b26ab35e2e Accepting request 1298953 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1298953
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=132
2025-08-13 14:23:00 +00:00
eb1ced8475 SLE shim should includes vendor-dbx-sles.esl instead of vendor-dbx-opensuse.esl
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=228
2025-08-12 03:09:17 +00:00
c4f6186bec Accepting request 1297873 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1297873
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=131
2025-08-07 14:48:24 +00:00
ec10240d7d Building with the latest version of gcc in the codebase (bsc#1247432)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=227
2025-08-06 06:39:11 +00:00
a21b86b1b9 Add revoked-openSUSE-UEFI-SIGN-Certificate-2022-06.crt
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=226
2025-08-03 15:23:10 +00:00
9df054b2af Accepting request 1296812 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1296812
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=130
2025-08-01 20:40:03 +00:00
2e9102bfde Add shim-disable-dxe-get-mem-attrs.patch (bsc#1247432)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=225
2025-07-31 13:00:46 +00:00
4746dbe081 Removed pre script in shim package for checking UEFI db has valid key for shim because it will interrupt group update of RPMs
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=224
2025-07-28 16:41:26 +00:00
d29b2b2cc6 Add pre script to shim package for checking UEFI db has valid key for shim.
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=223
2025-07-27 05:23:54 +00:00
c999685b44 Accepting request 1295680 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1295680
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=129
2025-07-26 11:39:46 +00:00
b7c7f7042a Building out shim.nx.efi for supporting non-executable (bsc#1205588)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=222
2025-07-25 06:37:09 +00:00
5c02720025 Accepting request 1291309 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1291309
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=128
2025-07-09 15:26:23 +00:00
b078c5cf79 Replace shim-16.0.tar.bz2 by upstream tarball
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=221
2025-07-08 14:45:51 +00:00
3f64394ee8 Accepting request 1285933 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1285933
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=127
2025-06-17 16:20:14 +00:00
cca66ed8c7 bugowner: dtseng\nSubmitting for upgrading shim to v16.0 (bsc#1240871)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=220
2025-06-16 03:45:08 +00:00
8da6aa4679 Accepting request 1281737 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1281737
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=126
2025-06-03 15:50:11 +00:00
05905a4760 bugowner: dtseng\nSubmitting for upgrading shim to v16.0 (bsc#1240871)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=219
2025-06-02 05:53:58 +00:00
6ff4187e10 Accepting request 1276758 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1276758
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=125
2025-05-13 18:12:10 +00:00
23fef8ea41 bugowner: dtseng\nSubmitting for upgrading shim to v16.0 (bsc#1240871)
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=218
2025-05-12 07:55:45 +00:00
2c76119d92 Accepting request 1232808 from devel:openSUSE:Factory
undefine %_enable_debug_packages to fix building with rpm-4.20

OBS-URL: https://build.opensuse.org/request/show/1232808
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=124
2025-01-31 15:01:53 +00:00
cb2d0c2d89 - undefine %_enable_debug_packages to fix building with rpm-4.20
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=217
2024-12-20 10:36:18 +00:00
cbf49f2693 Accepting request 1219481 from devel:openSUSE:Factory
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/1219481
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=123
2024-10-31 15:09:15 +00:00
f78b88d606 Accepting request 1201941 from home:gary_lin:branches:devel:openSUSE:Factory
- Update shim-install to limit the scope of the 'removable'
  SL-Micro to the image booting with TPM2 unsealing (bsc#1210382)
  * 769e41d Limit the removable option to encrypted SL-Micro

OBS-URL: https://build.opensuse.org/request/show/1201941
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=216
2024-10-15 02:08:00 +00:00
fb4f6ece94 Accepting request 1201684 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1201684
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=122
2024-09-18 13:26:07 +00:00
e246151428 Accepting request 1201364 from home:gary_lin:branches:devel:openSUSE:Factory
- Update shim-install to apply the missing fix for openSUSE Leap
  (bsc#1210382)
  * 86b73d1 Fix that bootx64.efi is not updated on Leap
- Update shim-install to use the 'removable' way for SL-Micro
  (bsc#1230316)
  * 433cc4e Always use the removable way for SL-Micro

OBS-URL: https://build.opensuse.org/request/show/1201364
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=215
2024-09-18 04:26:12 +00:00
2a80121e13 Accepting request 1184771 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1184771
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=121
2024-07-02 16:15:29 +00:00
Tseng
e6086c9560 Accepting request 1184770 from home:dtseng:branches:devel:openSUSE:Factory
bugowner: dtseng
Submitting for updating asc files after being signed back from Microsoft

OBS-URL: https://build.opensuse.org/request/show/1184770
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=214
2024-07-02 05:35:57 +00:00
Tseng
fe5c6d29be Accepting request 1183124 from home:dtseng:branches:devel:openSUSE:Factory
bugowner: dtseng
Submitting for updating asc files after being signed back from Microsoft

OBS-URL: https://build.opensuse.org/request/show/1183124
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=213
2024-06-25 09:12:15 +00:00
2d8ebccca8 Accepting request 1164003 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1164003
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=120
2024-04-02 14:38:25 +00:00
4af5b3f4d4 Accepting request 1164001 from home:gary_lin:branches:devel:openSUSE:Factory
- Introduce %shim_use_fde_tpm_helper macro so that the project
  can include the fde-tpm-helper-macros for the build targets
  other than Tumbleweed

OBS-URL: https://build.opensuse.org/request/show/1164001
OBS-URL: https://build.opensuse.org/package/show/devel:openSUSE:Factory/shim?expand=0&rev=212
2024-04-02 04:26:58 +00:00
0a0bbf3847 Accepting request 1155012 from devel:openSUSE:Factory
OBS-URL: https://build.opensuse.org/request/show/1155012
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/shim?expand=0&rev=119
2024-03-06 22:03:16 +00:00