-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Signatures Invalid after BIOS update, Microsoft Certificate Revoked? #13
Comments
@Skyyblaze I have been looking for information and, although I am sure you already know it, there are some newer certificates. I suppose that with them this issue is resolved. If you haven't tried it yet, the links to the active certificates are those in point 2 or 3, depending on what operating systems you boot, I think that the ones in point 2 are enough for Windows and macOS with OpenCore: 1.- Microsoft KEKs enable signature database updates and binary execution. 2.- Microsoft certificates to verify binaries before execution. 3.- Source: Microsoft Secure Boot Objects GitHub I leave this open while we check if these changes are enough before updating the guide. |
@perez987 Thanks for looking into this! To be honest without your guide I would be very confused about the signing process anyhow so I'm actually not sure how to proceed even though you shared the links. I'm assuming these two files from the original files need to be updated: Microsoft Windows Production CA 2011 however I'm unsure which of the links you posted correctly correspond to these files. If you could guide me into the right direction I would try the guide with the new files and then report back if it works. |
@Skyyblaze |
@perez987 |
@Skyyblaze So far, we were using 2 certificates, both dated 2011:
if you download the 2 items of
Are both certificates required or only the new |
Alright thank you, I might be able to test things until Monday evening but when I do I'll report back! |
@Skyyblaze In order to boot I had to completely erase the main BIOS and boot from the backup BIOS. Now I can boot macOS and Windows with Secure Boot disabled but I have not been able to reset the secure keys to factory settings. I probably did something wrong. I downloaded the 2 certificates, the one from 2011 that has not been updated and the one from 2023, and generated the keys with both. I was able to put the keys (PK, KEK and db) in the firmware but after that I couldn't go back. So you know, be careful if you try it. |
Alright thanks for the warning, I didn't have time to test things yet but I think I'll refrain for now then until this is better figured out. |
@Skyyblaze
Microsoft firmware certificates are:
All three of these Microsoft certificates expire in 2026. Microsoft will be rolling out Secure Boot database updates in phases to add trust for the new DB and KEK certificates. The first DB update has added the Microsoft Windows UEFI CA 2023 to the system DB. Next task is to resign OpenCore files having the new certificate. Here is where I failed. I'll comment if I find the way to do it. |
@perez987 Alright, thanks for looking into it! I'll also comment if I find anything out. |
@Skyyblaze
And I have been successful, by activating UEFI Secure Boot I can boot Windows 11, OpenCore 1.0.0 (-> macOS Ventura) and Ubuntu 24.04. So now I have the question of what happens with the update 2023 certificate and the obsolete 2011 certificate because I have not installed the new one and everything seems to have worked fine. The script can be run by this Linux command in Terminal #!/bin/bash
#Copyrigth (c) 2021 by profzei
#Licensed under the terms of the GPL v3
# Linux command in Terminal
# sh ./sign.sh 1.0.0
sudo apt update && sudo apt upgrade
if ! command -v unzip &> /dev/null
then
echo "Installing unzip..."
sudo apt install unzip
fi
if ! command -v sbsign &> /dev/null
then
echo "Installing sbsigntool..."
sudo apt-get install sbsigntool
fi
if ! command -v cert-to-efi-sig-list &> /dev/null
then
echo "Installing efitools..."
sudo apt-get install efitools
fi
VERSION=$1
echo "=============================="
echo "Creating efikeys folder"
mkdir efikeys
cd efikeys
openssl req -new -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes -subj "/CN=KEYS PK/" -keyout PK.key -out PK.pem
openssl req -new -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes -subj "/CN=KEYS KEK/" -keyout KEK.key -out KEK.pem
openssl req -new -x509 -newkey rsa:2048 -sha256 -days 3650 -nodes -subj "/CN=KEYS ISK/" -keyout ISK.key -out ISK.pem
chmod 0600 *.key
echo "============================="
echo "Downloading Microsoft certificates..."
wget --user-agent="Mozilla" https://www.microsoft.com/pkiops/certs/MicWinProPCA2011_2011-10-19.crt
wget --user-agent="Mozilla" https://www.microsoft.com/pkiops/certs/MicCorUEFCA2011_2011-06-27.crt
echo "============================="
echo "Signing certificates..."
openssl x509 -in MicWinProPCA2011_2011-10-19.crt -inform DER -out MicWinProPCA2011_2011-10-19.pem -outform PEM
openssl x509 -in MicCorUEFCA2011_2011-06-27.crt -inform DER -out MicCorUEFCA2011_2011-06-27.pem -outform PEM
echo "============================="
echo "Converting PEM to ESL..."
cert-to-efi-sig-list -g $(uuidgen) PK.pem PK.esl
cert-to-efi-sig-list -g $(uuidgen) KEK.pem KEK.esl
cert-to-efi-sig-list -g $(uuidgen) ISK.pem ISK.esl
cert-to-efi-sig-list -g $(uuidgen) MicWinProPCA2011_2011-10-19.pem MicWinProPCA2011_2011-10-19.esl
cert-to-efi-sig-list -g $(uuidgen) MicCorUEFCA2011_2011-06-27.pem MicCorUEFCA2011_2011-06-27.esl
echo "============================="
echo "Creating database of allowed signs..."
cat ISK.esl MicWinProPCA2011_2011-10-19.esl MicCorUEFCA2011_2011-06-27.esl > db.esl
echo "============================="
echo "Signing ESL files..."
sign-efi-sig-list -k PK.key -c PK.pem PK PK.esl PK.auth
sign-efi-sig-list -k PK.key -c PK.pem KEK KEK.esl KEK.auth
sign-efi-sig-list -k KEK.key -c KEK.pem db db.esl db.auth
cd ..
mkdir oc
cp efikeys/ISK.key oc
cp efikeys/ISK.pem oc
cp efikeys/PK.auth oc
cp efikeys/KEK.auth oc
cp efikeys/db.auth oc
cd oc
echo "============================="
echo "Creating required directories"
mkdir Signed
mkdir Signed/EFI
mkdir Signed/EFI/BOOT
mkdir Signed/EFI/OC
mkdir Signed/EFI/OC/Drivers
mkdir Signed/EFI/OC/Tools
mkdir Signed/Download
echo "============================="
#LINK="https://github.com/acidanthera/OpenCorePkg/releases/download/${VERSION}/OpenCore-${VERSION}-RELEASE.zip"
LINK="https://github.com/acidanthera/OpenCorePkg/releases/download/1.0.0/OpenCore-1.0.0-RELEASE.zip"
echo "Downlading Opencore ${VERSION}"
wget -nv $LINK
echo "============================="
echo "Downloading HfsPlus.efi"
wget -nv https://github.com/acidanthera/OcBinaryData/raw/master/Drivers/HfsPlus.efi -O ./Signed/Download/HfsPlus.efi
echo "============================="
echo "Do you use OpenLinuxBoot? (Y/N)"
read LUKA
LUKA1="Y"
LUKA2="y"
if [ "$LUKA" = "$LUKA1" ] || [ "$LUKA" = "$LUKA2" ]; then
wget -nv https://github.com/acidanthera/OcBinaryData/raw/master/Drivers/ext4_x64.efi -O ./Signed/Download/ext4_x64.efi
fi
echo "============================="
echo "Unzipping OpenCore ${VERSION}"
unzip "OpenCore-${VERSION}-RELEASE.zip" "X64/*" -d "./Signed/Download"
rm "OpenCore-${VERSION}-RELEASE.zip"
echo "============================"
echo "Signing drivers, tools, BOOTx64.efi and OpenCore.efi"
echo ""
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/BOOT/BOOTx64.efi ./Signed/Download/X64/EFI/BOOT/BOOTx64.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/OpenCore.efi ./Signed/Download/X64/EFI/OC/OpenCore.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/OpenRuntime.efi ./Signed/Download/X64/EFI/OC/Drivers/OpenRuntime.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/OpenCanopy.efi ./Signed/Download/X64/EFI/OC/Drivers/OpenCanopy.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/CrScreenshotDxe.efi ./Signed/Download/X64/EFI/OC/Drivers/CrScreenshotDxe.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Tools/OpenShell.efi ./Signed/Download/X64/EFI/OC/Tools/OpenShell.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/HfsPlus.efi ./Signed/Download/HfsPlus.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/AudioDxe.efi ./Signed/Download/X64/EFI/OC/Drivers/AudioDxe.efi
if [ "$LUKA" = "$LUKA1" ] || [ "$LUKA" = "$LUKA2" ]; then
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/OpenLinuxBoot.efi ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/ext4_x64.efi ./Signed/Download/ext4_x64.efi
echo "Linux drivers signed"
else
rm ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
fi
echo "============================"
echo "====CREATED BY LUKAKEITON==="
echo "============================" |
@perez987 Hmm I assume you aren't using a current BIOS so your UEFI doesn't know that the old certificate was revoked yet? |
@Skyyblaze |
@Skyyblaze
KEYS KEK is my own KEK generated by the linux script.
KEYS ISK is my own variable generated by the linux script. Windows 11 and signed OpenCore boot fine after enabling Secure Boot. The same as before adding 2023 keys. Tried with BIOS F11 (latest) and F10. |
@perez987 I see interesting, so the important part is to Append the keys and not Replace them? |
@perez987 There is a small script error like in sh ./sign.sh 1.0.0. Can you please check again and correct it? thx Unzipping OpenCore
unzip: cannot find or open OpenCore--RELEASE.zip, OpenCore--RELEASE.zip.zip or OpenCore--RELEASE.zip.ZIP.
rm: cannot remove 'OpenCore--RELEASE.zip': No such file or directory
Signing drivers, tools, BOOTx64.efi and OpenCore.efi
Error reading file ./Signed/Download/X64/EFI/BOOT/BOOTx64.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/OpenCore.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/Drivers/OpenRuntime.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/Drivers/OpenCanopy.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/Drivers/CrScreenshotDxe.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/Tools/OpenShell.efi: No such file or directory
warning: data remaining[37888 vs 37892]: gaps between PE/COFF sections?
warning: data remaining[37888 vs 37896]: gaps between PE/COFF sections?
Signing Unsigned original image
Error reading file ./Signed/Download/X64/EFI/OC/Drivers/AudioDxe.efi: No such file or directory
Error reading file ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi: No such file or directory
Image was already signed; adding additional signature
image_write/open: No such file or directory
Linux drivers signed
====CREATED BY LUKAKEITON=== |
@tonho911 |
@perez987 |
@Skyyblaze
Microsoft offers updated files to be shoved into the firmware from the BIOS menu, they are those in the attached file In short, on my motherboard the guide works fine as is, even without adding the updated Microsoft certificate. So I don't know how to approach this issue. Note: when I shove my own keys into the firmware, with PK I have to use Update since there must only be one key but with KEK and db (or dbx if I also want to update it) I use Append, this way I don't delete the existing keys but rather that I add the new ones (they can coexist). |
@tonho911 Now: if [ "$LUKA" = "$LUKA1" ] || [ "$LUKA" = "$LUKA2" ]; then
sbsign --key ISK.key --cert ISK.pem --output ./Signed/Drivers/OpenLinuxBoot.efi ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/Drivers/ext4_x64.efi ./Signed/Download/ext4_x64.efi
echo "Linux drivers signed"
else
rm ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
fi Fixed: if [ "$LUKA" = "$LUKA1" ] || [ "$LUKA" = "$LUKA2" ]; then
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/OpenLinuxBoot.efi ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
sbsign --key ISK.key --cert ISK.pem --output ./Signed/EFI/OC/Drivers/ext4_x64.efi ./Signed/Download/ext4_x64.efi
echo "Linux drivers signed"
else
rm ./Signed/Download/X64/EFI/OC/Drivers/OpenLinuxBoot.efi
fi
Try and comment if you have success. |
@perez987 Hmm I see, now I'm really unsure what to do as my BIOS clearly doesn't like th old key anymore but I also don't want to mess too many things up. |
U have to be kidding bro, it works, thanks... |
What brand of motherboard are you using? I'm confused about the function of backup bios or dual bios which the brand is always proud of. |
@tonho911 Ah that might explain things as I am using a Gigabyte mainboard. They are a brand that never let me down in the past 15 or so years but I also never had to utilize the DualBIOS feature so I don't know how it works. |
@Skyyblaze |
@tonho911 |
I am restructuring the entire site to make it more useful to the user. I have separated it into sections. If something you read seems incomplete or you want to contribute or comment on anything, I would appreciate it. This does not solve the original question of @Skyyblaze but I cannot reproduce the issue with the certificate on my system. What I do see frequently are the All of this is included in the guide. |
@Skyyblaze |
@perez987 Huh thanks for the heads-up, this sounds very interesting and easy indeed. I'll try it when I have time! |
It’s work bro |
I followed the guide pretty early on and had no issues however yesterday I had to run a BIOS update on my mainboard and upon reinserting all the keys I still got hit with a Secure Boot Violation because of Invalid Signatures when booting OpenCore afterwards. Looking around I found out that the Microsoft Certificate was apparently revoked:
ValdikSS/Super-UEFIinSecureBoot-Disk#15
Was this already reflected in the guide, is there an updated certificate?
The text was updated successfully, but these errors were encountered: