X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FTcg%2FTcgSmm%2FTcgSmm.c;h=6080eff3b7b880346e0a2b37b0a0add1a4f5a348;hb=8a8c6c962a4abc75224799bfd03f2f68bb2a89e3;hp=97cd916d0711f5d1768e946b48e48e621e3c667e;hpb=ed094569d6a1248b1b6ca6d0439e5bdf0db36aa2;p=mirror_edk2.git diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c index 97cd916d07..6080eff3b7 100644 --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c @@ -8,7 +8,7 @@ PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check. -Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2011 - 2014, 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 @@ -68,6 +68,8 @@ PhysicalPresenceCallback ( &PpData ); if (EFI_ERROR (Status)) { + mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE; + DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -116,6 +118,7 @@ PhysicalPresenceCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE; + DEBUG ((EFI_D_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -226,6 +229,8 @@ MemoryClearCallback ( &MorControl ); if (EFI_ERROR (Status)) { + mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; + DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status)); return EFI_SUCCESS; } @@ -245,6 +250,7 @@ MemoryClearCallback ( ); if (EFI_ERROR (Status)) { mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE; + DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status)); } return EFI_SUCCESS; @@ -339,6 +345,7 @@ PublishAcpiTable ( ASSERT (Table->OemTableId == SIGNATURE_64 ('T', 'c', 'g', 'T', 'a', 'b', 'l', 'e')); + CopyMem (Table->OemId, PcdGetPtr (PcdAcpiDefaultOemId), sizeof (Table->OemId) ); mTcgNvs = AssignOpRegion (Table, SIGNATURE_32 ('T', 'N', 'V', 'S'), (UINT16) sizeof (TCG_NVS)); ASSERT (mTcgNvs != NULL); @@ -385,6 +392,11 @@ InitializeTcgSmm ( EFI_SMM_SW_REGISTER_CONTEXT SwContext; EFI_HANDLE SwHandle; + if (!CompareGuid (PcdGetPtr(PcdTpmInstanceGuid), &gEfiTpmDeviceInstanceTpm12Guid)){ + DEBUG ((EFI_D_ERROR, "No TPM12 instance required!\n")); + return EFI_UNSUPPORTED; + } + Status = PublishAcpiTable (); ASSERT_EFI_ERROR (Status);