From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.115; helo=mga14.intel.com; envelope-from=eric.dong@intel.com; receiver=edk2-devel@lists.01.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1FD08211C3842 for ; Wed, 30 Jan 2019 18:51:08 -0800 (PST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 Jan 2019 18:51:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,543,1539673200"; d="scan'208";a="122739422" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 30 Jan 2019 18:51:08 -0800 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 30 Jan 2019 18:51:07 -0800 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 30 Jan 2019 18:51:07 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.207]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.194]) with mapi id 14.03.0415.000; Thu, 31 Jan 2019 10:51:05 +0800 From: "Dong, Eric" To: "Chu, Maggie" , "edk2-devel@lists.01.org" CC: "Zhang, Chao B" , "Yao, Jiewen" Thread-Topic: [PATCH] SecurityPkg: Add a PCD to skip Opal password prompt Thread-Index: AQHUuGbHd99PHMu1Z02kbZr10vPZyqXIrpWQ Date: Thu, 31 Jan 2019 02:51:05 +0000 Message-ID: References: <20190130064051.7704-1-maggie.chu@intel.com> In-Reply-To: <20190130064051.7704-1-maggie.chu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SecurityPkg: Add a PCD to skip Opal password prompt X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Jan 2019 02:51:09 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Maggie, Thanks for your contribution!=20 Reviewed-by: Eric Dong And pushed: 8a9301cdd75439e781754014f514fa06d99140d1 Thanks, Eric > -----Original Message----- > From: Chu, Maggie > Sent: Wednesday, January 30, 2019 2:41 PM > To: edk2-devel@lists.01.org > Cc: Zhang, Chao B ; Yao, Jiewen > ; Dong, Eric > Subject: [PATCH] SecurityPkg: Add a PCD to skip Opal password prompt >=20 > https://bugzilla.tianocore.org/show_bug.cgi?id=3D1484 > Add a PCD for skipping password prompt and device unlock flow so that > other pre-OS applications are able to take over Opal devices unlock flow. >=20 > Contributed-under: TianoCore Contribution Agreement 1.1 > Signed-off-by: Maggie Chu > Cc: Chao Zhang > Cc: Jiewen Yao > Cc: Eric Dong > --- > SecurityPkg/SecurityPkg.dec | 6 ++++++ > SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c | 4 ++++ > SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf | 3 +++ > 3 files changed, 13 insertions(+) >=20 > diff --git a/SecurityPkg/SecurityPkg.dec b/SecurityPkg/SecurityPkg.dec in= dex > 2708e7953c..70c9ff28a8 100644 > --- a/SecurityPkg/SecurityPkg.dec > +++ b/SecurityPkg/SecurityPkg.dec > @@ -428,6 +428,12 @@ > # @Prompt Possible TPM2 Interrupt Number buffer > gEfiSecurityPkgTokenSpaceGuid.PcdTpm2PossibleIrqNumBuf|{0x00, 0x00, > 0x00, 0x00}|VOID*|0x0001001D >=20 > + ## Indicates if Opal DXE driver skip unlock device flow.

> + # TRUE - Skip unlock device flow.
> + # FALSE - Does not skip unlock device flow.
> + # @Prompt Skip Opal DXE driver unlock device flow. > + > + > gEfiSecurityPkgTokenSpaceGuid.PcdSkipOpalDxeUnlock|FALSE|BOOLEAN|0 > x000 > + 10020 > + > [PcdsDynamic, PcdsDynamicEx] >=20 > ## This PCD indicates Hash mask for TPM 2.0. Bit definition strictly f= ollows > TCG Algorithm Registry.

diff --git > a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > index 38268539fb..734c5f06ff 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalDriver.c > @@ -988,6 +988,10 @@ OpalDriverRequestPassword ( >=20 > IsLocked =3D OpalDeviceLocked (&Dev->OpalDisk.SupportedAttributes, > &Dev->OpalDisk.LockingFeature); >=20 > + if (IsLocked && PcdGetBool (PcdSkipOpalDxeUnlock)) { > + return; > + } > + > while (Count < MAX_PASSWORD_TRY_COUNT) { > Password =3D OpalDriverPopUpPasswordInput (Dev, PopUpString, NULL, > &PressEsc); > if (PressEsc) { > diff --git a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > index cfa55dded7..11e58b95cd 100644 > --- a/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > +++ b/SecurityPkg/Tcg/Opal/OpalPassword/OpalPasswordDxe.inf > @@ -75,5 +75,8 @@ > [Guids] > gEfiEndOfDxeEventGroupGuid ## CONSUMES = ## Event >=20 > +[Pcd] > + gEfiSecurityPkgTokenSpaceGuid.PcdSkipOpalDxeUnlock ## CONSUMES > + > [Depex] > gEfiHiiStringProtocolGuid AND gEfiHiiDatabaseProtocolGuid > -- > 2.16.2.windows.1