[edk2-devel] [PATCH v5 15/19] SecurityPkg: Add null encryption variable libs

Wang, Jian J jian.j.wang at intel.com
Tue Nov 22 06:55:48 UTC 2022


Reviewed-by: Jian J Wang <jian.j.wang at intel.com>

Regards,
Jian

> -----Original Message-----
> From: Vang, Judah <judah.vang at intel.com>
> Sent: Sunday, November 06, 2022 3:35 PM
> To: devel at edk2.groups.io
> Cc: Wang, Jian J <jian.j.wang at intel.com>; Yao, Jiewen <jiewen.yao at intel.com>;
> Mistry, Nishant C <nishant.c.mistry at intel.com>
> Subject: [PATCH v5 15/19] SecurityPkg: Add null encryption variable libs
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594
> 
> V4: Applied code review - Remove empty Guids section
> from .inf file. Update description in *.c. Remove *.uni file
> and reference to it.
> 
> V1: Provide null ecryption variable libraries.
> These will be used by default for platforms that don't
> support protected variable encryption.
> 
> Cc: Jian J Wang <jian.j.wang at intel.com>
> Cc: Jiewen Yao <jiewen.yao at intel.com>
> Cc: Nishant C Mistry <nishant.c.mistry at intel.com>
> Signed-off-by: Jian J Wang <jian.j.wang at intel.com>
> Signed-off-by: Nishant C Mistry <nishant.c.mistry at intel.com>
> Signed-off-by: Judah Vang <judah.vang at intel.com>
> ---
>  SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf |
> 34 ++++++++
>  SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c          | 92
> ++++++++++++++++++++
>  2 files changed, 126 insertions(+)
> 
> diff --git
> a/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf
> b/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf
> new file mode 100644
> index 000000000000..185b6f9bedf7
> --- /dev/null
> +++
> b/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariableLibNull.inf
> @@ -0,0 +1,34 @@
> +## @file
> +#  Provides NULL version of encryption variable services.
> +#
> +#  Copyright (c) 2015 - 2022, Intel Corporation. All rights reserved.<BR>
> +#
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> +#
> +##
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010005
> +  BASE_NAME                      = EncryptionVariableLibNull
> +  FILE_GUID                      = 3972E6FE-74D5-45C3-A9FB-DB9E5E5C9C17
> +  MODULE_TYPE                    = BASE
> +  VERSION_STRING                 = 1.0
> +  LIBRARY_CLASS                  = EncryptionVariableLib
> +
> +#
> +# The following information is for reference only and not required by the build
> tools.
> +#
> +#  VALID_ARCHITECTURES           = IA32 X64
> +#
> +
> +[Sources]
> +  EncryptionVariable.c
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MdeModulePkg/MdeModulePkg.dec
> +  SecurityPkg/SecurityPkg.dec
> +
> +[LibraryClasses]
> +  BaseLib
> +  DebugLib
> diff --git a/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c
> b/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c
> new file mode 100644
> index 000000000000..52ee8a7b5aae
> --- /dev/null
> +++ b/SecurityPkg/Library/EncryptionVariableLibNull/EncryptionVariable.c
> @@ -0,0 +1,92 @@
> +/** @file
> +  NULL implementation of EncryptionVariableLib.
> +
> +Copyright (c) 2022, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Uefi.h>
> +
> +#include <Library/EncryptionVariableLib.h>
> +#include <Library/DebugLib.h>
> +
> +/**
> +  Encrypt variable data.
> +
> +  Null version.
> +
> +  @param[in, out]   VarEncInfo   Pointer to structure containing detailed
> +                                 information about a variable.
> +
> +  @retval EFI_UNSUPPORTED         Unsupported to encrypt variable.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +EncryptVariable (
> +  IN OUT VARIABLE_ENCRYPTION_INFO  *VarEncInfo
> +  )
> +{
> +  return EFI_UNSUPPORTED;
> +}
> +
> +/**
> +  Decrypt variable data.
> +
> +  Null version.
> +
> +  @param[in, out]   VarEncInfo   Pointer to structure containing detailed
> +                                 information about a variable.
> +
> +  @retval EFI_UNSUPPORTED         Unsupported to encrypt variable.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +DecryptVariable (
> +  IN OUT VARIABLE_ENCRYPTION_INFO  *VarEncInfo
> +  )
> +{
> +  return EFI_UNSUPPORTED;
> +}
> +
> +/**
> +  Get cipher information.
> +
> +  Null version.
> +
> +  @param[in]   VarEncInfo   Pointer to structure containing detailed
> +                            information about a variable.
> +
> +  @retval EFI_UNSUPPORTED         Unsupported interface.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +GetCipherDataInfo (
> +  IN VARIABLE_ENCRYPTION_INFO  *VarEncInfo
> +  )
> +{
> +  return EFI_UNSUPPORTED;
> +}
> +
> +/**
> +  Set cipher information for a variable.
> +
> +  Null version.
> +
> +  @param[in]   VarEncInfo   Pointer to structure containing detailed
> +                            information about a variable.
> +
> +  @retval EFI_UNSUPPORTED         If this method is not supported.
> +
> +**/
> +EFI_STATUS
> +EFIAPI
> +SetCipherDataInfo (
> +  IN VARIABLE_ENCRYPTION_INFO  *VarEncInfo
> +  )
> +{
> +  return EFI_UNSUPPORTED;
> +}
> --
> 2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#96539): https://edk2.groups.io/g/devel/message/96539
Mute This Topic: https://groups.io/mt/94840831/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list