MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / VerifyFv

Function VerifyFv

BaseTools/Source/C/Common/FvLib.c:566–613  ·  view source on GitHub ↗

will not parse compressed sections

Source from the content-addressed store, hash-verified

564// will not parse compressed sections
565//
566EFI_STATUS
567VerifyFv (
568 IN EFI_FIRMWARE_VOLUME_HEADER *FvHeader
569 )
570/*++
571
572Routine Description:
573
574 Verify the current pointer points to a valid FV header.
575
576Arguments:
577
578 FvHeader Pointer to an alleged FV file.
579
580Returns:
581
582 EFI_SUCCESS The FV header is valid.
583 EFI_VOLUME_CORRUPTED The FV header is not valid.
584 EFI_INVALID_PARAMETER A required parameter was NULL.
585 EFI_ABORTED Operation aborted.
586
587--*/
588{
589 UINT16 Checksum;
590
591 //
592 // Verify input parameters
593 //
594 if (FvHeader == NULL) {
595 return EFI_INVALID_PARAMETER;
596 }
597
598 if (FvHeader->Signature != EFI_FVH_SIGNATURE) {
599 Error (NULL, 0, 0006, "invalid FV header signature", NULL);
600 return EFI_VOLUME_CORRUPTED;
601 }
602 //
603 // Verify header checksum
604 //
605 Checksum = CalculateSum16 ((UINT16 *) FvHeader, FvHeader->HeaderLength / sizeof (UINT16));
606
607 if (Checksum != 0) {
608 Error (NULL, 0, 0006, "invalid FV header checksum", NULL);
609 return EFI_ABORTED;
610 }
611
612 return EFI_SUCCESS;
613}
614
615EFI_STATUS
616VerifyFfsFile (

Callers 5

GetNextFileFunction · 0.70
GetFileByNameFunction · 0.70
GetFileByTypeFunction · 0.70
VerifyFfsFileFunction · 0.70
GetErasePolarityFunction · 0.70

Calls 2

ErrorFunction · 0.70
CalculateSum16Function · 0.70

Tested by

no test coverage detected