From 45d382dcf9d7d7a31b4459e5e47beda630946b49 Mon Sep 17 00:00:00 2001 From: Daniel Maslowski Date: Mon, 28 Oct 2024 04:29:56 +0100 Subject: [PATCH] add alternative header ending signature This is found in ASRock firmware images, e.g. A520M-HVS A52MIX_2.73. Also seen in coreboot 3rd_party/blobs/mainboard/, and used in Fiano: https://github.com/linuxboot/fiano/blob/d844cd98141518f41b3e4012bcf419984074a2b4/pkg/amd/apcb/internal.go#L16 Fixes . Signed-off-by: Daniel Maslowski --- src/apcb.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/apcb.rs b/src/apcb.rs index 4b02e82..4720f22 100644 --- a/src/apcb.rs +++ b/src/apcb.rs @@ -1268,8 +1268,12 @@ impl<'a> Apcb<'a> { "V3_HEADER_EXT::data_offset", )); } + // NOTE: The AMD docs for Turin, Genoa, Milan and Rome say `BCPA`, + // i.e., `APCB` backwards. Some vendors are using `BCBA` instead, + // e.g., ASRock and coreboot (`3rdparty/blobs/mainboard/`). if !options.check_signature_ending || value.signature_ending == *b"BCPA" + || value.signature_ending == *b"BCBA" { } else { return Err(Error::FileSystem(