From nobody Tue Feb 10 05:10:34 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+92356+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+92356+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1660200856; cv=none; d=zohomail.com; s=zohoarc; b=eZ5gk0kkRyqzsVwNVWvqPRPwM9GGZ6JDn6bJr3fMKqBZfXIy/sbDqMsZCFUOZchFRbVd6XhWxvVK/94hexVbWvrhII9gWbOECUSg8oOdiMs1mn2d23ZCpDt5xdzdgeR/0tPd19BgsTE+KtrKVVRRLRzXLqM75iFqv7VROfmeUvk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1660200856; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=seMFyTwb8qcqwIyIpuj0GXE6yBvACg8JL0uGFgwVt60=; b=GdUdohVQhkOHhgXT9xSPPjtm6znXpEqoBzWf6E0xyGWfURnYkFwo4n8mjLn+kgfCkRuL55U60T7wKWsFQVdwOM15uhzoSVmKrO/HTTwmurhLvB507U6KVkAWFDe4naPHQTDZfqZ+a3oXeMomEOhm+Xw9dSqM1FIMN0Z+AX67lvA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+92356+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1660200856409701.1690137005282; Wed, 10 Aug 2022 23:54:16 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id vJzfYY1788612xOT01vJ0jQX; Wed, 10 Aug 2022 23:54:16 -0700 X-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 X-IronPort-AV: E=McAfee;i="6400,9594,10435"; a="377565800" X-IronPort-AV: E=Sophos;i="5.93,228,1654585200"; d="scan'208";a="377565800" X-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="673586360" X-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:14 -0700 From: "Judah Vang" To: devel@edk2.groups.io Cc: Jian J Wang , Jiewen Yao , Nishant C Mistry Subject: [edk2-devel] [PATCH v4 12/28] SecurityPkg: Add new variable types and functions Date: Wed, 10 Aug 2022 23:53:21 -0700 Message-Id: <20220811065337.2068-13-judah.vang@intel.com> In-Reply-To: <20220811065337.2068-1-judah.vang@intel.com> References: <20220811065337.2068-1-judah.vang@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,judah.vang@intel.com X-Gm-Message-State: 0FfEZO6mJP4t31kyLCMLuJU2x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1660200856; bh=IGjbfjLU1K6NAp3hvPTOOExHF4g4tN19/yD8HuweKV0=; h=Cc:Date:From:Reply-To:Subject:To; b=OUD6QhApFczNR1u0qtcwRoJBxSDRYJnbtx2b5aGungRa4f3l1HkLP8szV2C+PIYU7Wd Sdsklyc+3D4lHhCcnn1Esix5QO6UiFNdbXShhz5FNaMXbDk+m9A8DgbfcV+lhgqMCPDdh D0Mpf6iW7U6EwBrxd/5KNGmzruG7FDkMj8I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1660200857828100049 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2594 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 Cc: Jiewen Yao Cc: Nishant C Mistry Signed-off-by: Jian J Wang Signed-off-by: Nishant C Mistry Signed-off-by: Judah Vang Reviewed-by: Jian J Wang --- 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/Li= brary/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) Lib= rary. =20 -Copyright (c) 2020, Intel Corporation. All rights reserved.
+Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef _RPMC_LIB_H_ -#define _RPMC_LIB_H_ +#ifndef RPMC_LIB_H_ +#define RPMC_LIB_H_ =20 #include =20 +#define RPMC_COUNTER_1 0 +#define RPMC_COUNTER_2 1 + /** Requests the monotonic counter from the designated RPMC counter. =20 + @param[in] CounterIndex The RPMC index @param[out] CounterValue A pointer to a buffer to store the= RPMC value. =20 @retval EFI_SUCCESS The operation completed successful= ly. @@ -23,12 +27,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_STATUS EFIAPI RequestMonotonicCounter ( + IN UINT8 CounterIndex, OUT UINT32 *CounterValue ); =20 /** Increments the monotonic counter in the SPI flash device by 1. =20 + @param[in] CounterIndex The RPMC index + @retval EFI_SUCCESS The operation completed successful= ly. @retval EFI_DEVICE_ERROR A device error occurred while atte= mpting 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 ); =20 #endif diff --git a/SecurityPkg/Include/Library/VariableKeyLib.h b/SecurityPkg/Inc= lude/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. =20 -Copyright (c) 2020, Intel Corporation. All rights reserved.
+Copyright (c) 2020 - 2022, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ =20 -#ifndef _VARIABLE_KEY_LIB_H_ -#define _VARIABLE_KEY_LIB_H_ +#ifndef VARIABLE_KEY_LIB_H_ +#define VARIABLE_KEY_LIB_H_ =20 #include =20 @@ -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 s= uccessfully. - @retval EFI_DEVICE_ERROR An error occurred while attempting= to regenerate the key. - @retval EFI_ACCESS_DENIED The function was invoked after loc= king 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 succe= ssfully. - @retval EFI_UNSUPPORTED Locking the key interface is not s= upported 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 ); =20 #endif --=20 2.35.1.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#92356): https://edk2.groups.io/g/devel/message/92356 Mute This Topic: https://groups.io/mt/92953537/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-