From 1bd0eb1bd202c806e69a86aa77966530502c2a5f Mon Sep 17 00:00:00 2001 From: waaagh Date: Wed, 8 Nov 2023 23:26:39 +0800 Subject: [PATCH 1/2] fix efi docs Signed-off-by: waaagh --- docs/how to sign&verify a EFI image.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/how to sign&verify a EFI image.md b/docs/how to sign&verify a EFI image.md index f9ef97a..775a60b 100644 --- a/docs/how to sign&verify a EFI image.md +++ b/docs/how to sign&verify a EFI image.md @@ -124,16 +124,30 @@ RUST_BACKTRACE=1 RUST_LOG=debug ./target/debug/client -c client.toml add --file- ``` # Verify the EFI file +## Using sbsigntools - first we should compile `sbsigntools` ``` +sudo dnf in gcc automake autoconf make binutils-devel gnu-efi gnu-efi-devel help2man # buildrequires on openEuler 22.03 git clone https://git.kernel.org/pub/scm/linux/kernel/git/jejb/sbsigntools.git cd sbsigntools git submodule init && git submodule update -make +./autogen.sh && ./configure && make ``` - verify the signed EFI image using the certificate we exported ``` $ src/sbverify `pwd`/shimx64.efi --cert certificate warning: data remaining[827688 vs 953240]: gaps between PE/COFF sections? Signature verification OK +``` + +## Using pesign +- Install pesign +``` +sudo dnf in -y pesign nss-utils openssl +``` +- verify the signed EFI image using pesign +``` +openssl x509 -in certificate -inform PEM -out cert.der -outform DER +pesigcheck -i `pwd`/shimx64.efi -c cert.der +pesigcheck: "shimx64.efi" is valid. ``` \ No newline at end of file -- Gitee From 23dfdbf7a0b9b032ef502491f35e6d03a2e4ce7f Mon Sep 17 00:00:00 2001 From: Li Chaoran Date: Fri, 10 Nov 2023 01:27:23 +0800 Subject: [PATCH 2/2] fix efi signature corrupt Signed-off-by: Li Chaoran --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b82a598..93acdaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,7 +72,7 @@ url = "2.3.1" futures = "0.3.26" utoipa = { version = "3", features = ["actix_extras"] } utoipa-swagger-ui = { version ="3.1.3", features = ["actix-web"]} -efi_signer = "0.2.4" +efi_signer = "0.2.5" regex = "1" csrf= "0.4.1" data-encoding= "2.4.0" -- Gitee