From 4bee65a8f63a6ccbb0de97fb35316dbc94bb9942 Mon Sep 17 00:00:00 2001 From: Raghava Gudla Date: Thu, 13 Aug 2020 15:07:05 -0700 Subject: [PATCH] Fix an issue in firmware update This patch fixed an issue in firmware update. During the saved capsule signature verification against the capsule signature to make sure that the capsule did not change during the reboot, instead of using length of the signature, used the size of the macro that indicate the length of the signature. Verified that firmware update is able to pass on WHL. Signed-off-by: Raghava Gudla --- PayloadPkg/FirmwareUpdate/FirmwareUpdate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PayloadPkg/FirmwareUpdate/FirmwareUpdate.c b/PayloadPkg/FirmwareUpdate/FirmwareUpdate.c index 50104742..8e427fc0 100644 --- a/PayloadPkg/FirmwareUpdate/FirmwareUpdate.c +++ b/PayloadPkg/FirmwareUpdate/FirmwareUpdate.c @@ -623,7 +623,7 @@ AuthenticateCapsule ( // if (*(UINT32 *)(FwUpdStatus.CapsuleSig) != 0xFFFFFFFF) { - CopyMem((VOID *)&FwUpdStatus.CapsuleSig, (VOID *)SignatureHdr, sizeof(FW_UPDATE_SIG_LENGTH)); + CopyMem((VOID *)&FwUpdStatus.CapsuleSig, (VOID *)SignatureHdr, FW_UPDATE_SIG_LENGTH); Status = BootMediaWrite (FwUpdStatusOffset, sizeof(FW_UPDATE_STATUS), (UINT8 *)&FwUpdStatus); if (EFI_ERROR (Status)) {