Implement TPM2 NVStorage related command.\r
\r
Copyright (c) 2013 - 2018, 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
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
@param[in] NvIndex The NV Index.\r
@param[out] NvPublic The public area of the index.\r
@param[out] NvName The Name of the nvIndex.\r
- \r
+\r
@retval EFI_SUCCESS Operation completed successfully.\r
@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.\r
SendBuffer.Header.commandCode = SwapBytes32(TPM_CC_NV_ReadPublic);\r
\r
SendBuffer.NvIndex = SwapBytes32 (NvIndex);\r
- \r
+\r
SendBufferSize = (UINT32) sizeof (SendBuffer);\r
SendBuffer.Header.paramSize = SwapBytes32 (SendBufferSize);\r
\r
\r
CopyMem (NvName->name, (UINT8 *)&RecvBuffer + sizeof(TPM2_RESPONSE_HEADER) + sizeof(UINT16) + NvPublicSize + sizeof(UINT16), NvNameSize);\r
NvName->size = NvNameSize;\r
- \r
+\r
return EFI_SUCCESS;\r
}\r
\r
@param[in] AuthSession Auth Session context\r
@param[in] Auth The authorization data.\r
@param[in] NvPublic The public area of the index.\r
- \r
+\r
@retval EFI_SUCCESS Operation completed successfully.\r
@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
@retval EFI_ALREADY_STARTED The command was returned successfully, but NvIndex is already defined.\r
@param[in] AuthHandle TPM_RH_OWNER or TPM_RH_PLATFORM+{PP}.\r
@param[in] NvIndex The NV Index.\r
@param[in] AuthSession Auth Session context\r
- \r
+\r
@retval EFI_SUCCESS Operation completed successfully.\r
@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.\r
@param[in] Size Number of bytes to read.\r
@param[in] Offset Byte offset into the area.\r
@param[in,out] OutData The data read.\r
- \r
+\r
@retval EFI_SUCCESS Operation completed successfully.\r
@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.\r
}\r
\r
CopyMem (OutData->buffer, &RecvBuffer.Data.buffer, OutData->size);\r
- \r
+\r
Done:\r
//\r
// Clear AuthSession Content\r
@param[in] AuthSession Auth Session context\r
@param[in] InData The data to write.\r
@param[in] Offset The offset into the NV Area.\r
- \r
+\r
@retval EFI_SUCCESS Operation completed successfully.\r
@retval EFI_DEVICE_ERROR The command was unsuccessful.\r
@retval EFI_NOT_FOUND The command was returned successfully, but NvIndex is not found.\r