From: "Wang, Jian J" <jian.j.wang@intel.com>
To: "Vang, Judah" <judah.vang@intel.com>,
"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>,
"Mistry, Nishant C" <nishant.c.mistry@intel.com>
Subject: Re: [PATCH v4 12/28] SecurityPkg: Add new variable types and functions
Date: Mon, 22 Aug 2022 02:34:12 +0000 [thread overview]
Message-ID: <CO1PR11MB4945E5C8EBCAF0A0A8667003B6719@CO1PR11MB4945.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20220811065337.2068-13-judah.vang@intel.com>
Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
Regards,
Jian
> -----Original Message-----
> From: Vang, Judah <judah.vang@intel.com>
> Sent: Thursday, August 11, 2022 2:53 PM
> To: devel@edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang@intel.com>; Yao, Jiewen <jiewen.yao@intel.com>;
> Mistry, Nishant C <nishant.c.mistry@intel.com>
> Subject: [PATCH v4 12/28] SecurityPkg: Add new variable types and functions
>
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594
>
> Add new variable encryption/decryption function prototypes.
> Add new variable digest structure. Add new Protected
> variable function prototypes. Update RPMC APIs to Add
> an index because there is could more than one counter.
>
> Cc: Jian J Wang <jian.j.wang@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Cc: Nishant C Mistry <nishant.c.mistry@intel.com>
> Signed-off-by: Jian J Wang <jian.j.wang@intel.com>
> Signed-off-by: Nishant C Mistry <nishant.c.mistry@intel.com>
> Signed-off-by: Judah Vang <judah.vang@intel.com>
> ---
> SecurityPkg/Include/Library/RpmcLib.h | 15 +++++---
> SecurityPkg/Include/Library/VariableKeyLib.h | 37 +++-----------------
> 2 files changed, 16 insertions(+), 36 deletions(-)
>
> diff --git a/SecurityPkg/Include/Library/RpmcLib.h
> b/SecurityPkg/Include/Library/RpmcLib.h
> index df4ba34ba8cf..cb71dfcd7e4d 100644
> --- a/SecurityPkg/Include/Library/RpmcLib.h
> +++ b/SecurityPkg/Include/Library/RpmcLib.h
> @@ -1,19 +1,23 @@
> /** @file
> Public definitions for the Replay Protected Monotonic Counter (RPMC) Library.
>
> -Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> -#ifndef _RPMC_LIB_H_
> -#define _RPMC_LIB_H_
> +#ifndef RPMC_LIB_H_
> +#define RPMC_LIB_H_
>
> #include <Uefi/UefiBaseType.h>
>
> +#define RPMC_COUNTER_1 0
> +#define RPMC_COUNTER_2 1
> +
> /**
> Requests the monotonic counter from the designated RPMC counter.
>
> + @param[in] CounterIndex The RPMC index
> @param[out] CounterValue A pointer to a buffer to store the RPMC
> value.
>
> @retval EFI_SUCCESS The operation completed successfully.
> @@ -23,12 +27,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> EFI_STATUS
> EFIAPI
> RequestMonotonicCounter (
> + IN UINT8 CounterIndex,
> OUT UINT32 *CounterValue
> );
>
> /**
> Increments the monotonic counter in the SPI flash device by 1.
>
> + @param[in] CounterIndex The RPMC index
> +
> @retval EFI_SUCCESS The operation completed successfully.
> @retval EFI_DEVICE_ERROR A device error occurred while attempting
> to update the counter.
> @retval EFI_UNSUPPORTED The operation is un-supported.
> @@ -36,7 +43,7 @@ RequestMonotonicCounter (
> EFI_STATUS
> EFIAPI
> IncrementMonotonicCounter (
> - VOID
> + IN UINT8 CounterIndex
> );
>
> #endif
> diff --git a/SecurityPkg/Include/Library/VariableKeyLib.h
> b/SecurityPkg/Include/Library/VariableKeyLib.h
> index 561ebad09da2..6076c4d4731b 100644
> --- a/SecurityPkg/Include/Library/VariableKeyLib.h
> +++ b/SecurityPkg/Include/Library/VariableKeyLib.h
> @@ -1,13 +1,13 @@
> /** @file
> Public definitions for Variable Key Library.
>
> -Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.<BR>
> SPDX-License-Identifier: BSD-2-Clause-Patent
>
> **/
>
> -#ifndef _VARIABLE_KEY_LIB_H_
> -#define _VARIABLE_KEY_LIB_H_
> +#ifndef VARIABLE_KEY_LIB_H_
> +#define VARIABLE_KEY_LIB_H_
>
> #include <Uefi/UefiBaseType.h>
>
> @@ -25,35 +25,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
> EFI_STATUS
> EFIAPI
> GetVariableKey (
> - OUT VOID **VariableKey,
> - IN OUT UINTN *VariableKeySize
> - );
> -
> -/**
> - Regenerates the variable key.
> -
> - @retval EFI_SUCCESS The variable key was regenerated successfully.
> - @retval EFI_DEVICE_ERROR An error occurred while attempting to
> regenerate the key.
> - @retval EFI_ACCESS_DENIED The function was invoked after locking
> the key interface.
> - @retval EFI_UNSUPPORTED Key regeneration is not supported in the
> current boot configuration.
> -**/
> -EFI_STATUS
> -EFIAPI
> -RegenerateVariableKey (
> - VOID
> - );
> -
> -/**
> - Locks the regenerate key interface.
> -
> - @retval EFI_SUCCESS The key interface was locked successfully.
> - @retval EFI_UNSUPPORTED Locking the key interface is not supported
> in the current boot configuration.
> - @retval Others An error occurred while attempting to lock the
> key interface.
> -**/
> -EFI_STATUS
> -EFIAPI
> -LockVariableKeyInterface (
> - VOID
> + OUT VOID *VariableKey,
> + IN UINTN VariableKeySize
> );
>
> #endif
> --
> 2.35.1.windows.2
next prev parent reply other threads:[~2022-08-22 2:34 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-11 6:53 [PATCH v4 00/28] UEFI variable protection Judah Vang
2022-08-11 6:53 ` [PATCH v4 01/28] MdeModulePkg: Update AUTH_VARIABLE_INFO struct Judah Vang
2022-08-11 6:53 ` [PATCH v4 02/28] MdeModulePkg: Add reference to new Ppi Guid Judah Vang
2022-08-11 6:53 ` [PATCH v4 03/28] MdeModulePkg: Add new ProtectedVariable GUIDs Judah Vang
2022-08-11 6:53 ` [PATCH v4 04/28] MdeModulePkg: Add new include files Judah Vang
2022-08-19 3:21 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 05/28] MdeModulePkg: Add new GUID for Variable Store Info Judah Vang
2022-08-11 6:53 ` [PATCH v4 06/28] MdeModulePkg: Add Null ProtectedVariable Library Judah Vang
2022-08-19 3:20 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 07/28] MdeModulePkg: Add new Variable functionality Judah Vang
2022-11-13 17:38 ` Wang, Jian J
[not found] ` <1727359DAB074995.1868@groups.io>
2022-11-14 2:34 ` [edk2-devel] " Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 08/28] MdeModulePkg: Add support for Protected Variables Judah Vang
2022-08-11 6:53 ` [PATCH v4 09/28] MdeModulePkg: Reference Null ProtectedVariableLib Judah Vang
2022-08-11 6:53 ` [PATCH v4 10/28] SecurityPkg: Add new GUIDs for Judah Vang
2022-08-11 6:53 ` [PATCH v4 11/28] SecurityPkg: Add new KeyService types and defines Judah Vang
2022-08-22 2:24 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 12/28] SecurityPkg: Add new variable types and functions Judah Vang
2022-08-22 2:34 ` Wang, Jian J [this message]
2022-08-11 6:53 ` [PATCH v4 13/28] SecurityPkg: Update RPMC APIs with index Judah Vang
2022-08-11 6:53 ` [PATCH v4 14/28] SecurityPkg: Fix GetVariableKey API Judah Vang
2022-08-22 3:47 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 15/28] SecurityPkg: Add null encryption variable libs Judah Vang
2022-08-22 3:48 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 16/28] SecurityPkg: Add VariableKey library function Judah Vang
2022-08-22 3:52 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 17/28] SecurityPkg: Add EncryptionVariable lib with AES Judah Vang
2022-08-22 4:05 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 18/28] SecurityPkg: Add Protected Variable Services Judah Vang
2022-08-22 4:14 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 19/28] SecurityPkg: Add references to new *.inf files Judah Vang
2022-08-22 4:15 ` Wang, Jian J
2022-08-11 6:53 ` [PATCH v4 20/28] ArmVirtPkg: Add reference to ProtectedVariableNull Judah Vang
2022-08-11 6:53 ` [PATCH v4 21/28] UefiPayloadPkg: Add ProtectedVariable reference Judah Vang
2022-08-12 23:01 ` Guo Dong
2022-08-11 6:53 ` [PATCH v4 22/28] EmulatorPkg: " Judah Vang
2022-08-11 6:53 ` [PATCH v4 23/28] OvmfPkg: " Judah Vang
2022-08-11 6:53 ` [PATCH v4 24/28] OvmfPkg: Add ProtectedVariableLib reference Judah Vang
2022-08-11 6:53 ` [PATCH v4 25/28] " Judah Vang
2022-08-11 6:53 ` [PATCH v4 26/28] " Judah Vang
2022-08-11 6:53 ` [PATCH v4 27/28] OvmfPkg: Add ProtectedVariable reference Judah Vang
2022-08-11 6:53 ` [PATCH v4 28/28] IntelTdx: " Judah Vang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CO1PR11MB4945E5C8EBCAF0A0A8667003B6719@CO1PR11MB4945.namprd11.prod.outlook.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox