[edk2-devel] [Patch v2 10/28] SecurityPkg: Add new KeyService types and defines

Judah Vang posted 28 patches 3 months, 3 weeks ago
There is a newer version of this series
[edk2-devel] [Patch v2 10/28] SecurityPkg: Add new KeyService types and defines
Posted by Judah Vang 3 months, 3 weeks ago
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594

Add new KeyService types and defines.

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/Ppi/KeyServicePpi.h | 57 ++++++++++++++++++++
 1 file changed, 57 insertions(+)

diff --git a/SecurityPkg/Include/Ppi/KeyServicePpi.h b/SecurityPkg/Include/Ppi/KeyServicePpi.h
new file mode 100644
index 000000000000..f126913d2d81
--- /dev/null
+++ b/SecurityPkg/Include/Ppi/KeyServicePpi.h
@@ -0,0 +1,57 @@
+/** @file
+  Provides Key Services.
+
+Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+@par Specification Reference:
+**/
+
+#ifndef PEI_KEY_SERVICE_PPI_H_
+#define PEI_KEY_SERVICE_PPI_H_
+///
+/// KEY SERVICE PPI GUID
+///
+extern EFI_GUID  gKeyServicePpiGuid;
+
+/**
+  Generate a new key from root key.
+
+  @param[in]   Salt                     Pointer to the salt(non-secret) value.
+  @param[in]   SaltSize                 Salt size in bytes.
+  @param[out]  NewKey                   Pointer to buffer to receive new key.
+  @param[in]   NewKeySize               Size of new key bytes to generate.
+
+  @retval EFI_SUCCESS                   The function completed successfully
+  @retval OTHER                         The function completed with failure.
+**/
+typedef
+EFI_STATUS
+(EFIAPI *KEY_SERVICE_GEN_KEY)(
+  IN   UINT8        *Salt,
+  IN   UINTN        SaltSize,
+  OUT  UINT8        *NewKey,
+  IN   UINTN        NewKeySize
+  );
+
+#define KEY_SERVICE_PPI_REVISION  1
+#define ROOT_KEY_LEN              64
+#define SALT_SIZE_MIN_LEN         64
+#define KEY_SERVICE_KEY_NAME      L"KEY_SERVICE_KEY"
+
+typedef struct {
+  UINT8    RootKey[ROOT_KEY_LEN];
+  UINT8    PreviousRootKey[ROOT_KEY_LEN];
+} KEY_SERVICE_DATA;
+
+typedef struct _KEY_SERVICE_PPI KEY_SERVICE_PPI;
+
+///
+/// KEY SERVICE PPI
+/// The interface functions are for Key Service in PEI Phase
+///
+struct _KEY_SERVICE_PPI {
+  KEY_SERVICE_GEN_KEY    GenerateKey; /// Generate Key
+};
+
+#endif
-- 
2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89427): https://edk2.groups.io/g/devel/message/89427
Mute This Topic: https://groups.io/mt/90781895/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [Patch v2 10/28] SecurityPkg: Add new KeyService types and defines
Posted by Wang, Jian J 2 months, 4 weeks ago
Judah,


> -----Original Message-----
> From: Vang, Judah <judah.vang@intel.com>
> Sent: Saturday, April 30, 2022 2:04 AM
> 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 v2 10/28] SecurityPkg: Add new KeyService types and defines
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594
> 
> Add new KeyService types and defines.
> 
> 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/Ppi/KeyServicePpi.h | 57 ++++++++++++++++++++
>  1 file changed, 57 insertions(+)
> 
> diff --git a/SecurityPkg/Include/Ppi/KeyServicePpi.h
> b/SecurityPkg/Include/Ppi/KeyServicePpi.h
> new file mode 100644
> index 000000000000..f126913d2d81
> --- /dev/null
> +++ b/SecurityPkg/Include/Ppi/KeyServicePpi.h
> @@ -0,0 +1,57 @@
> +/** @file
> +  Provides Key Services.
> +
> +Copyright (c) 2008 - 2018, Intel Corporation. All rights reserved.<BR>
[JianJW] 
2018 -> 2022

Regards,
Jian

> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +@par Specification Reference:
> +**/
> +
> +#ifndef PEI_KEY_SERVICE_PPI_H_
> +#define PEI_KEY_SERVICE_PPI_H_
> +///
> +/// KEY SERVICE PPI GUID
> +///
> +extern EFI_GUID  gKeyServicePpiGuid;
> +
> +/**
> +  Generate a new key from root key.
> +
> +  @param[in]   Salt                     Pointer to the salt(non-secret) value.
> +  @param[in]   SaltSize                 Salt size in bytes.
> +  @param[out]  NewKey                   Pointer to buffer to receive new key.
> +  @param[in]   NewKeySize               Size of new key bytes to generate.
> +
> +  @retval EFI_SUCCESS                   The function completed successfully
> +  @retval OTHER                         The function completed with failure.
> +**/
> +typedef
> +EFI_STATUS
> +(EFIAPI *KEY_SERVICE_GEN_KEY)(
> +  IN   UINT8        *Salt,
> +  IN   UINTN        SaltSize,
> +  OUT  UINT8        *NewKey,
> +  IN   UINTN        NewKeySize
> +  );
> +
> +#define KEY_SERVICE_PPI_REVISION  1
> +#define ROOT_KEY_LEN              64
> +#define SALT_SIZE_MIN_LEN         64
> +#define KEY_SERVICE_KEY_NAME      L"KEY_SERVICE_KEY"
> +
> +typedef struct {
> +  UINT8    RootKey[ROOT_KEY_LEN];
> +  UINT8    PreviousRootKey[ROOT_KEY_LEN];
> +} KEY_SERVICE_DATA;
> +
> +typedef struct _KEY_SERVICE_PPI KEY_SERVICE_PPI;
> +
> +///
> +/// KEY SERVICE PPI
> +/// The interface functions are for Key Service in PEI Phase
> +///
> +struct _KEY_SERVICE_PPI {
> +  KEY_SERVICE_GEN_KEY    GenerateKey; /// Generate Key
> +};
> +
> +#endif
> --
> 2.35.1.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#89933): https://edk2.groups.io/g/devel/message/89933
Mute This Topic: https://groups.io/mt/90781895/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-