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

Function VerifyFfsFile

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

Source from the content-addressed store, hash-verified

613}
614
615EFI_STATUS
616VerifyFfsFile (
617 IN EFI_FFS_FILE_HEADER *FfsHeader
618 )
619/*++
620
621Routine Description:
622
623 Verify the current pointer points to a FFS file header.
624
625Arguments:
626
627 FfsHeader Pointer to an alleged FFS file.
628
629Returns:
630
631 EFI_SUCCESS The Ffs header is valid.
632 EFI_NOT_FOUND This "file" is the beginning of free space.
633 EFI_VOLUME_CORRUPTED The Ffs header is not valid.
634 EFI_ABORTED The erase polarity is not known.
635
636--*/
637{
638 BOOLEAN ErasePolarity;
639 EFI_STATUS Status;
640 EFI_FFS_FILE_HEADER2 BlankHeader;
641 UINT8 Checksum;
642 UINT32 FileLength;
643 UINT8 SavedChecksum;
644 UINT8 SavedState;
645 UINT8 FileGuidString[80];
646 UINT32 FfsHeaderSize;
647
648 //
649 // Verify library has been initialized.
650 //
651 if (mFvHeader == NULL || mFvLength == 0) {
652 return EFI_ABORTED;
653 }
654 //
655 // Verify FV header
656 //
657 Status = VerifyFv (mFvHeader);
658 if (EFI_ERROR (Status)) {
659 return EFI_ABORTED;
660 }
661 //
662 // Get the erase polarity.
663 //
664 Status = GetErasePolarity (&ErasePolarity);
665 if (EFI_ERROR (Status)) {
666 return EFI_ABORTED;
667 }
668
669 FfsHeaderSize = GetFfsHeaderLength(FfsHeader);
670 //
671 // Check if we have free space
672 //

Callers 4

AddFileFunction · 0.85
UpdateResetVectorFunction · 0.85
GetNextFileFunction · 0.85
GetSectionByTypeFunction · 0.85

Calls 9

GetErasePolarityFunction · 0.85
GetFfsHeaderLengthFunction · 0.85
memcmpFunction · 0.85
PrintGuidToBufferFunction · 0.85
GetFfsFileLengthFunction · 0.85
VerifyFvFunction · 0.70
CalculateSum8Function · 0.70
ErrorFunction · 0.70
memsetFunction · 0.50

Tested by

no test coverage detected