diff --git a/Cargo.toml b/Cargo.toml index b82a59808a74f70d841be4034d8884e6f858974b..93acdafa59418058a0785db36c905fa31d9c0506 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" diff --git a/docs/how to sign&verify a EFI image.md b/docs/how to sign&verify a EFI image.md index f9ef97aeb7f498447db79d5ac4dfeb7360e9a9f2..775a60b687906edaed99e8c1d63ced5a85bb4226 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