- if (Status != EFI_SUCCESS) {\r
- //\r
- // Security check failed. The firmware volume should not be used for any purpose.\r
- //\r
- if (Buffer != NULL) {\r
- FreePool (Buffer);\r
+ Index = 0;\r
+ do {\r
+ FvHeader = NULL;\r
+ FvAlignment = 0;\r
+ Buffer = NULL;\r
+ BufferSize = 0;\r
+ AlignedBuffer = NULL;\r
+ Status = Fv->ReadSection (\r
+ Fv,\r
+ FileName,\r
+ SectionType,\r
+ Index,\r
+ &Buffer,\r
+ &BufferSize,\r
+ &AuthenticationStatus\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ //\r
+ // Evaluate the authentication status of the Firmware Volume through\r
+ // Security Architectural Protocol\r
+ //\r
+ if (gSecurity != NULL) {\r
+ FvFileDevicePath = CoreFvToDevicePath (Fv, FvHandle, FileName);\r
+ Status = gSecurity->FileAuthenticationState (\r
+ gSecurity,\r
+ AuthenticationStatus,\r
+ FvFileDevicePath\r
+ );\r
+ if (FvFileDevicePath != NULL) {\r
+ FreePool (FvFileDevicePath);\r
+ }\r
+\r
+ if (Status != EFI_SUCCESS) {\r
+ //\r
+ // Security check failed. The firmware volume should not be used for any purpose.\r
+ //\r
+ if (Buffer != NULL) {\r
+ FreePool (Buffer);\r
+ }\r
+ break;\r