From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.1041.1648250921590027422 for ; Fri, 25 Mar 2022 16:28:42 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=PsIwHGjb; spf=pass (domain: intel.com, ip: 192.55.52.93, 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=1648250921; x=1679786921; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=8/35m4kzRAkZrAYSrTUoxVNpJ27iiHP5Dtw+wP5c784=; b=PsIwHGjbXSDqz6flO4bCLrK3XVMKB3UELB/Opi8coYk4oyzVzHo9ldJO cupc4BOtngb3RokmeRk0UfxJFMBiwYfGCRabX/ZKZv0SaX8W1xeqI9tTz PuFsRYKPoQsZF+iN3U6x1XxkTVVxwTzIxgFO3oPjWtzhO5ioI9Wi03HiK Ac6cpc32/CTQW42WtU/lKrOA4/1KQZ4qigg4nnK+bYUFAtj2NoqkPXWvd LtBo+mKh5nIn7AzuqfIBlLVoB1evlOI0lSG1ZOCt2CbmM0Z7vs+d5LDUO LmTK7C1so6m2rqxHe1/UdCKBjN2Xr06GYjkkopw+GhqXnxd/wrc+XzCCU w==; X-IronPort-AV: E=McAfee;i="6200,9189,10297"; a="256309518" X-IronPort-AV: E=Sophos;i="5.90,211,1643702400"; d="scan'208";a="256309518" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2022 16:28:41 -0700 X-IronPort-AV: E=Sophos;i="5.90,211,1643702400"; d="scan'208";a="638366556" Received: from jvang-mobl.amr.corp.intel.com ([10.212.95.18]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Mar 2022 16:28:41 -0700 From: "Judah Vang" To: devel@edk2.groups.io Cc: Judah Vang , Jian J Wang , Jiewen Yao , Nishant C Mistry Subject: [PATCH v1 10/28] SecurityPkg: Add new KeyService types and defines Date: Fri, 25 Mar 2022 16:28:07 -0700 Message-Id: <20220325232825.2167-6-judah.vang@intel.com> X-Mailer: git-send-email 2.35.1.windows.2 In-Reply-To: <20220325232825.2167-1-judah.vang@intel.com> References: <20220325232825.2167-1-judah.vang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2594 Add new KeyService types and defines. Cc: Jian J Wang Cc: Jiewen Yao Cc: 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..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.
+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.26.2.windows.1