From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web11.3634.1660200854871999493 for ; Wed, 10 Aug 2022 23:54:15 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=TM8IxSeS; spf=pass (domain: intel.com, ip: 192.55.52.43, mailfrom: judah.vang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660200854; x=1691736854; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EIxGIa6QRSH+jxnFpnJBftpgUtPAltwseuG/hqyKQa4=; b=TM8IxSeSCZGk7BCGJRmz8mxt8X1mUWTM72q4aD4pz0BKJ9EzTE5j1h3u CtRK5AohiR8Y741IEdvSo04OJGu4ufr1imrvxE+r6TPKCJPbVzFYVkj0J pFHsUPnpb6W6odawEide9eDI2eOPt0jgU3Je5cDt4HmduT7YQ72bA8imm D2ehak//cKiiwYkE7vcYOq2mx5X/gSzdNR9nQTxjR2KNL3nbWz33fy5bB zj4t+VQR+WRk9sAwgxigTw8hoNVz9ZcYRj9rfU3pOqF5vf7IQUpiJ4r81 /W5jLBqT5IuCFYRLp2bn8PJZxUvW3lT/PsgRcj/b/STfwitciFGMAdCs8 A==; X-IronPort-AV: E=McAfee;i="6400,9594,10435"; a="377565796" X-IronPort-AV: E=Sophos;i="5.93,228,1654585200"; d="scan'208";a="377565796" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2022 23:54:14 -0700 X-IronPort-AV: E=Sophos;i="5.93,228,1654585200"; d="scan'208";a="673586353" Received: from moisespe-mobl.amr.corp.intel.com (HELO jvang-mobl.amr.corp.intel.com) ([10.212.171.64]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Aug 2022 23:54:13 -0700 From: "Judah Vang" To: devel@edk2.groups.io Cc: Jian J Wang , Jiewen Yao , Nishant C Mistry Subject: [PATCH v4 11/28] SecurityPkg: Add new KeyService types and defines Date: Wed, 10 Aug 2022 23:53:20 -0700 Message-Id: <20220811065337.2068-12-judah.vang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220811065337.2068-1-judah.vang@intel.com> References: <20220811065337.2068-1-judah.vang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594 V4: revert copyright date change. V1: Add new KeyService types and defines. Cc: Jian J Wang Cc: Jiewen Yao Cc: Nishant C Mistry Signed-off-by: Jian J Wang Signed-off-by: Nishant C Mistry Signed-off-by: Judah Vang --- 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..8cfec04f96e5 --- /dev/null +++ b/SecurityPkg/Include/Ppi/KeyServicePpi.h @@ -0,0 +1,57 @@ +/** @file + Provides Key Services. + +Copyright (c) 2008 - 2022, Intel Corporation. All rights reserved.
+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