\r
ExecutePendingTpmRequest() will receive untrusted input and do validation.\r
\r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
sizeof (UINT8),\r
&NewFlags\r
); \r
+ if (EFI_ERROR (Status)) {\r
+ return;\r
+ }\r
}\r
\r
\r
&PpiFlags\r
);\r
if (EFI_ERROR (Status)) {\r
- if (Status == EFI_NOT_FOUND) {\r
- PpiFlags = FLAG_NO_PPI_PROVISION;\r
- Status = gRT->SetVariable (\r
- PHYSICAL_PRESENCE_FLAGS_VARIABLE,\r
- &gEfiPhysicalPresenceGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- sizeof (UINT8),\r
- &PpiFlags\r
- );\r
+ PpiFlags = FLAG_NO_PPI_PROVISION;\r
+ Status = gRT->SetVariable (\r
+ PHYSICAL_PRESENCE_FLAGS_VARIABLE,\r
+ &gEfiPhysicalPresenceGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ sizeof (UINT8),\r
+ &PpiFlags\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Set physical presence flag failed, Status = %r\n", Status));\r
+ return ;\r
}\r
- ASSERT_EFI_ERROR (Status);\r
}\r
- DEBUG ((EFI_D_ERROR, "[TPM] PpiFlags = %x, Status = %r\n", PpiFlags, Status));\r
+ DEBUG ((EFI_D_INFO, "[TPM] PpiFlags = %x\n", PpiFlags));\r
\r
//\r
// This flags variable controls whether physical presence is required for TPM command. \r
&TcgPpData\r
);\r
if (EFI_ERROR (Status)) {\r
- if (Status == EFI_NOT_FOUND) {\r
- ZeroMem ((VOID*)&TcgPpData, sizeof (TcgPpData));\r
- DataSize = sizeof (EFI_PHYSICAL_PRESENCE);\r
- Status = gRT->SetVariable (\r
- PHYSICAL_PRESENCE_VARIABLE,\r
- &gEfiPhysicalPresenceGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- DataSize,\r
- &TcgPpData\r
- );\r
+ ZeroMem ((VOID*)&TcgPpData, sizeof (TcgPpData));\r
+ DataSize = sizeof (EFI_PHYSICAL_PRESENCE);\r
+ Status = gRT->SetVariable (\r
+ PHYSICAL_PRESENCE_VARIABLE,\r
+ &gEfiPhysicalPresenceGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ DataSize,\r
+ &TcgPpData\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Set physical presence variable failed, Status = %r\n", Status));\r
+ return;\r
}\r
- ASSERT_EFI_ERROR (Status);\r
}\r
\r
DEBUG ((EFI_D_INFO, "[TPM] Flags=%x, PPRequest=%x\n", PpiFlags, TcgPpData.PPRequest));\r
\r
TrEEExecutePendingTpmRequest() will receive untrusted input and do validation.\r
\r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
&PpiFlags\r
);\r
if (EFI_ERROR (Status)) {\r
- if (Status == EFI_NOT_FOUND) {\r
- PpiFlags = 0;\r
- Status = gRT->SetVariable (\r
- TREE_PHYSICAL_PRESENCE_FLAGS_VARIABLE,\r
- &gEfiTrEEPhysicalPresenceGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- sizeof (UINT8),\r
- &PpiFlags\r
- );\r
+ PpiFlags = 0;\r
+ Status = gRT->SetVariable (\r
+ TREE_PHYSICAL_PRESENCE_FLAGS_VARIABLE,\r
+ &gEfiTrEEPhysicalPresenceGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ sizeof (UINT8),\r
+ &PpiFlags\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[TPM2] Set physical presence flag failed, Status = %r\n", Status));\r
+ return ;\r
}\r
- ASSERT_EFI_ERROR (Status);\r
}\r
- DEBUG ((EFI_D_ERROR, "[TPM2] PpiFlags = %x, Status = %r\n", PpiFlags, Status));\r
+ DEBUG ((EFI_D_INFO, "[TPM2] PpiFlags = %x\n", PpiFlags));\r
\r
//\r
// This flags variable controls whether physical presence is required for TPM command. \r
&TcgPpData\r
);\r
if (EFI_ERROR (Status)) {\r
- if (Status == EFI_NOT_FOUND) {\r
- ZeroMem ((VOID*)&TcgPpData, sizeof (TcgPpData));\r
- DataSize = sizeof (EFI_TREE_PHYSICAL_PRESENCE);\r
- Status = gRT->SetVariable (\r
- TREE_PHYSICAL_PRESENCE_VARIABLE,\r
- &gEfiTrEEPhysicalPresenceGuid,\r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- DataSize,\r
- &TcgPpData\r
- );\r
+ ZeroMem ((VOID*)&TcgPpData, sizeof (TcgPpData));\r
+ DataSize = sizeof (EFI_TREE_PHYSICAL_PRESENCE);\r
+ Status = gRT->SetVariable (\r
+ TREE_PHYSICAL_PRESENCE_VARIABLE,\r
+ &gEfiTrEEPhysicalPresenceGuid,\r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ DataSize,\r
+ &TcgPpData\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "[TPM2] Set physical presence variable failed, Status = %r\n", Status));\r
+ return ;\r
}\r
- ASSERT_EFI_ERROR (Status);\r
}\r
\r
- DEBUG ((EFI_D_ERROR, "[TPM2] Flags=%x, PPRequest=%x (LastPPRequest=%x)\n", PpiFlags, TcgPpData.PPRequest, TcgPpData.LastPPRequest));\r
+ DEBUG ((EFI_D_INFO, "[TPM2] Flags=%x, PPRequest=%x (LastPPRequest=%x)\n", PpiFlags, TcgPpData.PPRequest, TcgPpData.LastPPRequest));\r
\r
//\r
// Execute pending TPM request.\r
// \r
TrEEExecutePendingTpmRequest (PlatformAuth, &TcgPpData, PpiFlags);\r
- DEBUG ((EFI_D_ERROR, "[TPM2] PPResponse = %x (LastPPRequest=%x, Flags=%x)\n", TcgPpData.PPResponse, TcgPpData.LastPPRequest, PpiFlags));\r
+ DEBUG ((EFI_D_INFO, "[TPM2] PPResponse = %x (LastPPRequest=%x, Flags=%x)\n", TcgPpData.PPResponse, TcgPpData.LastPPRequest, PpiFlags));\r
\r
}\r
\r
This driver initilize MemoryOverwriteRequestControl variable. It \r
will clear MOR_CLEAR_MEMORY_BIT bit if it is set.\r
\r
-Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
IN VOID *Context\r
)\r
{\r
+ EFI_STATUS Status;\r
UINTN DataSize;\r
\r
if (MOR_CLEAR_MEMORY_VALUE (mMorControl) == 0x0) {\r
mMorControl &= 0xFE; \r
\r
DataSize = sizeof (mMorControl);\r
- gRT->SetVariable (\r
- MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
- &gEfiMemoryOverwriteControlDataGuid, \r
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
- DataSize, \r
- &mMorControl\r
- );\r
-\r
+ Status = gRT->SetVariable (\r
+ MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
+ &gEfiMemoryOverwriteControlDataGuid, \r
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_RUNTIME_ACCESS,\r
+ DataSize, \r
+ &mMorControl\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ DEBUG ((EFI_D_ERROR, "TcgMor: Clear MOR_CLEAR_MEMORY_BIT failure, Status = %r\n"));\r
+ }\r
}\r
\r
\r
// Set default value to 0\r
//\r
mMorControl = 0;\r
- DEBUG ((EFI_D_INFO, "TcgMor: Create gEfiMemoryOverwriteControlDataGuid!\n"));\r
Status = gRT->SetVariable (\r
MEMORY_OVERWRITE_REQUEST_VARIABLE_NAME, \r
&gEfiMemoryOverwriteControlDataGuid, \r
DataSize, \r
&mMorControl\r
);\r
- ASSERT_EFI_ERROR (Status);\r
- \r
+ DEBUG ((EFI_D_INFO, "TcgMor: Create MOR variable! Status = %r\n", Status));\r
} else {\r
//\r
// Create a Ready To Boot Event and Clear the MorControl bit in the call back function.\r
\r
PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
\r
-Copyright (c) 2011 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
&PpData\r
);\r
if (EFI_ERROR (Status)) {\r
+ mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
);\r
if (EFI_ERROR (Status)) {\r
mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
&MorControl\r
);\r
if (EFI_ERROR (Status)) {\r
+ mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
);\r
if (EFI_ERROR (Status)) { \r
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status));\r
}\r
\r
return EFI_SUCCESS;\r
\r
PhysicalPresenceCallback() and MemoryClearCallback() will receive untrusted input and do some check.\r
\r
-Copyright (c) 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials \r
are licensed and made available under the terms and conditions of the BSD License \r
which accompanies this distribution. The full text of the license may be found at \r
&PpData\r
);\r
if (EFI_ERROR (Status)) {\r
+ mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get PP variable failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
\r
if (EFI_ERROR (Status)) { \r
mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Set PP variable failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_SUCCESS;\r
);\r
if (EFI_ERROR (Status)) {\r
mTcgNvs->PhysicalPresence.ReturnCode = PP_SUBMIT_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get PP flags failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
&MorControl\r
);\r
if (EFI_ERROR (Status)) {\r
+ mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Get MOR variable failure! Status = %r\n", Status));\r
return EFI_SUCCESS;\r
}\r
\r
);\r
if (EFI_ERROR (Status)) { \r
mTcgNvs->MemoryClear.ReturnCode = MOR_REQUEST_GENERAL_FAILURE;\r
+ DEBUG ((EFI_D_ERROR, "[TPM] Set MOR variable failure! Status = %r\n", Status));\r
}\r
\r
return EFI_SUCCESS;\r