X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=SecurityPkg%2FLibrary%2FDxeImageVerificationLib%2FMeasurement.c;h=3f0d4f25eb3181f8f20b1f6dd01e37da837c6a4f;hp=2213423c3328eeba81810f1c77ee42e40223c34b;hb=b3548d32ddb553a9e95503457c66d11462622d16;hpb=c1d932429ef9700a2da64452546be14e92468b07 diff --git a/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c b/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c index 2213423c33..3f0d4f25eb 100644 --- a/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c +++ b/SecurityPkg/Library/DxeImageVerificationLib/Measurement.c @@ -1,7 +1,7 @@ /** @file - Measure TrEE required variable. + Measure TCG required variable. -Copyright (c) 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2013 - 2018, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -15,7 +15,6 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include #include #include -#include #include #include @@ -98,9 +97,9 @@ AssignVendorGuid ( @param[in] VarName A Null-terminated string that is the name of the vendor's variable. @param[in] VendorGuid A unique identifier for the vendor. - @param[in] VarData The content of the variable data. - @param[in] VarSize The size of the variable data. - + @param[in] VarData The content of the variable data. + @param[in] VarSize The size of the variable data. + @retval EFI_SUCCESS Operation completed successfully. @retval EFI_OUT_OF_RESOURCES Out of memory. **/ @@ -152,8 +151,8 @@ AddDataMeasured ( @param[in] VarName A Null-terminated string that is the name of the vendor's variable. @param[in] VendorGuid A unique identifier for the vendor. - @param[in] VarData The content of the variable data. - @param[in] VarSize The size of the variable data. + @param[in] VarData The content of the variable data. + @param[in] VarSize The size of the variable data. @retval TRUE The data is already measured. @retval FALSE The data is not measured yet. @@ -198,7 +197,7 @@ IsSecureAuthorityVariable ( UINTN Index; for (Index = 0; Index < sizeof(mVariableType)/sizeof(mVariableType[0]); Index++) { - if ((StrCmp (VariableName, mVariableType[Index].VariableName) == 0) && + if ((StrCmp (VariableName, mVariableType[Index].VariableName) == 0) && (CompareGuid (VendorGuid, mVariableType[Index].VendorGuid))) { return TRUE; } @@ -211,9 +210,9 @@ IsSecureAuthorityVariable ( @param[in] VarName A Null-terminated string that is the name of the vendor's variable. @param[in] VendorGuid A unique identifier for the vendor. - @param[in] VarData The content of the variable data. - @param[in] VarSize The size of the variable data. - + @param[in] VarData The content of the variable data. + @param[in] VarSize The size of the variable data. + @retval EFI_SUCCESS Operation completed successfully. @retval EFI_OUT_OF_RESOURCES Out of memory. @retval EFI_DEVICE_ERROR The operation was unsuccessful. @@ -230,18 +229,18 @@ MeasureVariable ( { EFI_STATUS Status; UINTN VarNameLength; - EFI_VARIABLE_DATA_TREE *VarLog; + UEFI_VARIABLE_DATA *VarLog; UINT32 VarLogSize; // - // The EFI_VARIABLE_DATA_TREE.VariableData value shall be the EFI_SIGNATURE_DATA value + // The UEFI_VARIABLE_DATA.VariableData value shall be the EFI_SIGNATURE_DATA value // from the EFI_SIGNATURE_LIST that contained the authority that was used to validate the image // VarNameLength = StrLen (VarName); VarLogSize = (UINT32)(sizeof (*VarLog) + VarNameLength * sizeof (*VarName) + VarSize - sizeof (VarLog->UnicodeName) - sizeof (VarLog->VariableData)); - VarLog = (EFI_VARIABLE_DATA_TREE *) AllocateZeroPool (VarLogSize); + VarLog = (UEFI_VARIABLE_DATA *) AllocateZeroPool (VarLogSize); if (VarLog == NULL) { return EFI_OUT_OF_RESOURCES; } @@ -312,7 +311,7 @@ SecureBootHook ( Data, DataSize ); - DEBUG ((EFI_D_ERROR, "MeasureBootPolicyVariable - %r\n", Status)); + DEBUG ((EFI_D_INFO, "MeasureBootPolicyVariable - %r\n", Status)); if (!EFI_ERROR (Status)) { AddDataMeasured (VariableName, VendorGuid, Data, DataSize);