From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 57D18AC0C9C for ; Thu, 29 Feb 2024 17:57:05 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=ZrobF32fXzpdpkzF05nvdzW4uivTtFtFOo++U33TwJM=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1709229423; v=1; b=K7Fr1EzLybzEXo5rbV3TnRb257ugA8NEzc9AUOkiH36HYAZhZPuq4H9xvnFCT+THaB/vYBji MA8ckIGylt1F7YA8fozNDiTKidD5RyWXmEcjI8AIMvSdM38XxVw8FPe8ozTQqLdinE0opuA1hAd oXnNNYBXCmzhlCbYNkyz68Zw= X-Received: by 127.0.0.2 with SMTP id 3LguYY7687511xtCugvdZs2N; Thu, 29 Feb 2024 09:57:03 -0800 X-Received: from NAM10-MW2-obe.outbound.protection.outlook.com (NAM10-MW2-obe.outbound.protection.outlook.com [40.107.94.128]) by mx.groups.io with SMTP id smtpd.web10.1926.1709229422872729867 for ; Thu, 29 Feb 2024 09:57:03 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OLQYUpOEXvqKx5M0SuDgpIu/1kyzaPlAiwaZQLJ2SYPlEhzHbS+Dlid+6ndyjmGUf696l+WQ3RGFnOoUldHOn4KIGoAPhi/wJ+a8Be6047+zQw3K1z8NIuQWmXLTSMq7RzBFbwH/DTw7s/wIk0e/5RrV8yeyghNyI/ovV5ReULSWWyWF06XtDt18BLXo3TNX7FZ9Y3Li0+ytm7gbdueE2a1ImI6OO1J1Q8QErMSjXeb5aXaV8x/ihqJohsbGIv63+KgwrlwFfsOLx30L4w7kha+FZ4qQ00An8JuUszLZcEtUYejiiVXetdKiVHoPwWP+O8MA0MOfGHAa5y/EJBhhXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5iWI5ItLCJGU4nl70ViLRwAO2L4ziPnozBRsBBKSTHM=; b=eFB0fH8hOUVzoopp33gHwK+D6U6hCngr7VENsqsQJQc29ISrFZEle047+GmqAwFEMTt73IAqXFBhWFKsdeAz9cflovSEGLyBqwnq4POs5hNroWckZaPEVryhzLw+TcPHL0sIdvQ/2uoUSbSrXoxTULChMDyJOlmlO2y08bUr8lFWAfr5SgGfExswJz3UpRcdhC6p/ctOBDYd6CYhdMcPvL77XIMijeSKo5HsJ8hhTUvVE79YrX+mdyYkMeUgz5/W6cjAKLSSBzTMq3VF0OFcVZSyi81xgG+Zig8quzKOTP2xzx6RjJFi4Ibx3k5sTh/6NsXs6Nkv4sPq0Tzu60LnBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=ami.com; dmarc=pass action=none header.from=ami.com; dkim=pass header.d=ami.com; arc=none X-Received: from BN0PR10MB4981.namprd10.prod.outlook.com (2603:10b6:408:12d::16) by DS7PR10MB7179.namprd10.prod.outlook.com (2603:10b6:8:ef::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.41; Thu, 29 Feb 2024 17:56:55 +0000 X-Received: from BN0PR10MB4981.namprd10.prod.outlook.com ([fe80::3d5d:c1c5:8ac0:255e]) by BN0PR10MB4981.namprd10.prod.outlook.com ([fe80::3d5d:c1c5:8ac0:255e%7]) with mapi id 15.20.7316.039; Thu, 29 Feb 2024 17:56:55 +0000 From: "Felix Polyudov via groups.io" To: "Tan, Ming" , "Yao, Jiewen" , "devel@edk2.groups.io" , "Pingle, Sneha S" , "Bi, Dandan" CC: "Xu, Min M" Subject: Re: [edk2-devel] [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec Thread-Topic: [EXTERNAL] RE: [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update UI according to UEFI spec Thread-Index: AQHaaSj6ZO+NRhaLkkS3S1Tg1Th80bEfQoYggAFjg0CAAPg0gA== Date: Thu, 29 Feb 2024 17:56:55 +0000 Message-ID: References: <20240227025909.10259-1-ming.tan@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN0PR10MB4981:EE_|DS7PR10MB7179:EE_ x-ms-office365-filtering-correlation-id: 3f33914e-19f0-4cb0-5832-08dc394fd0f3 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: Rbyvv+ImeIGQypTrarkruNaFXIdm/3h/YBzR1Y0a0VizuhEAYNc3xTEQE9FvbdARIvzZJ/Xmz8SKxA1x6yoSgvul8EjRd67jXeIiAL2QF386XFMTjC5m+KFtd7fs45C/QOBnGDcYarWJ+SlV/aBAyJsAAvS1NBvIg8hlCjHIONdZjDW+ZA4AB+RC7DkwpCaYvPkENk6v5JdI8oIVc+77+yVzKLnstdPV2lwy40Yycku5hZSgo2B9gDDgaz9TSzBwvE3KVP6xoprD313lobyPHFLqkVGkUOmv68tvbfgm4IagJ5ReMhKiZh9yWLLqyqaQq4vMSl4jyzcybIdXAj/IEK1B0rtYNMasM7ZNh0AtJE9oI/Hf0fusdstVC3OaOlmO7TkK34gtTaKAFVCGhwPAh8jY3h5c4gEpULUubWk3Y4bNt+C9Oazye58vJeeol5eYMxyUKru8sonz0/2Dxvt5RKxF62stZAhR7reAD7RMKe2HbZ7rIhKp9jLp6wGI9rsl4Sg1va9xIC08SaHvqp4VfKsb2JJONxGFHp5oAexW/JWbCAPZvGeJzo+/Yr/+QOaeB4XdEVbevA4aVwG44XCNbK78xISadQx2OdIV7cOg50P0rTwwoSwXmzWAPXAcX96zy3xrVkdRY0F1znq+V5B4l7aw9PR9U3rlX2SCos4Jk8A= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?3mfFcJAIgA1aEuwhXSpG02LygODWOF9JIQGjNmBVahIxoIsARWRY+0YsygKn?= =?us-ascii?Q?a71MVK2IKvvNDT9rvG5jKEGW8UrlgXJ0E5PdKEe+LIrzxR99wDQgzLwFXhHF?= =?us-ascii?Q?A7AGp2Ln4Y+5u+qxBRHUF62bwOGJCXZzQTzWIInq4e3DeP9Ed/ynxmPK032L?= =?us-ascii?Q?+OtDSJ0AR8v0Q9B2xRGRM+RnD5px6glJz+LWOj/34Gk9nLz88ObUTbuvX/ad?= =?us-ascii?Q?jj2fC+J1zwoHvB932Ny/938WtxR4OnFMd6JwqtT4hbAMfm/XOGI2FqXBCn3F?= =?us-ascii?Q?wKE7KIyOJSsWs2SoXbawGrEC/d+EmCcEb4wQE2+OUa0u2cIjL4xp9/I/o8NY?= =?us-ascii?Q?bG6oijePwYpniufjUjDGT19cJql0IiX+/S5UpWgA05Le2o5lUnwdeXsAPIuZ?= =?us-ascii?Q?5m5GuhjSjnWRaTA4LaHsbiN1sTjSxCNzldvYhtKMowafKrzQxS1psux8BVMC?= =?us-ascii?Q?5FHobOt845MIfkqknDdxoGxNq74JGTVkXEPlO1JHX/QXNv4luuxf/aCRhHEZ?= =?us-ascii?Q?vLvr6yOsy6tuby08zrs5ZzCrKeRJneZI0UT2pfnxD9LGbInI8+I09XIBpX+6?= =?us-ascii?Q?6HiNs5JDefC8tPT0PD13WRoGVAbyltIoZED2Fyz36Zyr+BiXdcd1AXqs/2Wt?= =?us-ascii?Q?3pQbQz0F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= =?us-ascii?Q?iseBE5tujlOpIYy7sMQ=3D?= MIME-Version: 1.0 X-OriginatorOrg: ami.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN0PR10MB4981.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3f33914e-19f0-4cb0-5832-08dc394fd0f3 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Feb 2024 17:56:55.0215 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 27e97857-e15f-486c-b58e-86c2b3040f93 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: txMHNYaCihVDIMfh4CFeAxzxk7qsxNurMGwEFRuWPsKGavLC2wuqYGlS9rkj0djh X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB7179 Precedence: Bulk 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,felixp@ami.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: AFbcEqLuEEhhfOOUUWaclx47x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=K7Fr1EzL; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}"); dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Reviewed-by: Felix Polyudov -----Original Message----- From: Tan, Ming Sent: Wednesday, February 28, 2024 10:32 PM To: Yao, Jiewen ; devel@edk2.groups.io; Pingle, Sneha= S ; Felix Polyudov ; Bi, Dandan = Cc: Xu, Min M Subject: [EXTERNAL] RE: [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update = UI according to UEFI spec **CAUTION: The e-mail below is from an external source. Please exercise cau= tion before opening attachments, clicking links, or following guidance.** Jiewen: This patch is only for UEFI spec mantis 1908 change in SecureBootConfigDx= e. This spec change just ask some drivers do some modification, it does not = ask the HII core to be modified, so this spec change will not cause compati= bility issue. For this patch, it only touch the UI setting, did not touch the modificat= ion of pk, kek, db, dbx, dbt EFI variable. I did the following unit test in EmulatorPkg WinHost.exe and Intel AlderL= ake RVP: 1. In PK Options, Enroll PK, check the "Attempt Secure Boot" is not gray = and enabled. 2. In RVP, Set "Attempt Secure Boot" to enable and disable, check it does= work, and device can boot to Windows. 3. In PK Options, delete PK, check the "Attempt Secure Boot" is gray and = disabled. 4. In DBX Options, Enroll Signature, check it does work, and the "Delete = All Signature List" is not gray. 5. In DBX Options, Delete all signature, check it does work, and the "Del= ete All Signature List" is gray after all signatures are deleted. 6. In KEK Options, Enroll KEK, check it does work. 7. In KEK Options, Delete KEK, check it does work. 8. In DB Options, Enroll Signature, check it does work. 9. In DB Options, Delete Signature, check it does work. 10. In DBT Options, Enroll Signature, check it does work. 11. In DBT Options, Delete Signature, check it does work. @Pingle, Sneha S Would you like to help to verify the secure boot functio= ns again in another Intel RVP? @Felix Polyudov Would you like to help to verify this patch with AMI brow= ser? Since AMI submitted this UEFI spec change, if verify pass, would you l= ike to add a "Reviewed-by' for this patch? @Bi, Dandan is HII expert and the reviewer of edk2 HII and UI modules, wo= uld you like to review this patch? And add a "Reviewed-by" for this patch? And I create a PR for this patch: https://github.com/tianocore/edk2/pull/= 5411, all CI checking are passed. Thank you. Tan Ming. -----Original Message----- From: Yao, Jiewen Sent: Wednesday, February 28, 2024 1:56 PM To: Tan, Ming ; devel@edk2.groups.io Cc: Xu, Min M Subject: RE: [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update UI accordin= g to UEFI spec Thanks for the update. First, would you please clarify which test you have done for this patch set= . Have you tested all previous function to ensure it still works? Second, would you please clarify if there is any compatibility issue to fol= low the new UEFI 2.10? For example, what if the core HII is still UEFI 2.9? would that still work? Third, because I am not HII expert, I would like to have HII expert to comm= ent the HII/Browser related change. Thank you Yao, Jiewen > -----Original Message----- > From: Tan, Ming > Sent: Tuesday, February 27, 2024 10:59 AM > To: devel@edk2.groups.io > Cc: Xu, Min M ; Yao, Jiewen > Subject: [PATCH v2] SecurityPkg/SecureBootConfigDxe: Update UI > according to UEFI spec > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4713 > > In UEFI_Spec_2_10_Aug29.pdf page 1694 section 35.5.4 for > EFI_BROWSER_ACTION_FORM_OPEN: > NOTE: EFI_FORM_BROWSER2_PROTOCOL.BrowserCallback() cannot be used with > this browser action because question values have not been retrieved yet. > > So should not call HiiGetBrowserData() and HiiSetBrowserData() in > FORM_OPEN call back function. > > Now call SecureBootExtractConfigFromVariable() to save the change to > EFI variable, then HII use EFI variable to control the UI. > > Cc: Min Xu > Cc: Jiewen Yao > Signed-off-by: Ming Tan > --- > V2: Change code style to pass uncrustify check. > > .../SecureBootConfigImpl.c | 37 ++++++++++--------- > 1 file changed, 20 insertions(+), 17 deletions(-) > > diff --git > a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf > igIm > pl.c > b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf > igIm > pl.c > index 2c11129526..e2e61d1e07 100644 > --- > a/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf > igIm > pl.c > +++ > b/SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConf > igIm > pl.c > @@ -3366,6 +3366,8 @@ SecureBootExtractConfigFromVariable ( > ConfigData->FileEnrollType =3D UNKNOWN_FILE_TYPE; > > } > > > > + ConfigData->ListCount =3D Private->ListCount; > > + > > // > > // If it is Physical Presence User, set the PhysicalPresent to true. > > // > > @@ -4541,12 +4543,13 @@ SecureBootCallback ( > EFI_HII_POPUP_PROTOCOL *HiiPopup; > > EFI_HII_POPUP_SELECTION UserSelection; > > > > - Status =3D EFI_SUCCESS; > > - SecureBootEnable =3D NULL; > > - SecureBootMode =3D NULL; > > - SetupMode =3D NULL; > > - File =3D NULL; > > - EnrollKeyErrorCode =3D None_Error; > > + Status =3D EFI_SUCCESS; > > + SecureBootEnable =3D NULL; > > + SecureBootMode =3D NULL; > > + SetupMode =3D NULL; > > + File =3D NULL; > > + EnrollKeyErrorCode =3D None_Error; > > + GetBrowserDataResult =3D FALSE; > > > > if ((This =3D=3D NULL) || (Value =3D=3D NULL) || (ActionRequest =3D=3D= NULL)) { > > return EFI_INVALID_PARAMETER; > > @@ -4565,15 +4568,12 @@ SecureBootCallback ( > return EFI_OUT_OF_RESOURCES; > > } > > > > - GetBrowserDataResult =3D HiiGetBrowserData > (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, > (UINT8 *)IfrNvData); > > - > > if (Action =3D=3D EFI_BROWSER_ACTION_FORM_OPEN) { > > if (QuestionId =3D=3D KEY_SECURE_BOOT_MODE) { > > // > > // Update secure boot strings when opening this form > > // > > - Status =3D UpdateSecureBootString (Private); > > - SecureBootExtractConfigFromVariable (Private, IfrNvData); > > + Status =3D UpdateSecureBootString (Private); > > mIsEnterSecureBootForm =3D TRUE; > > } else { > > // > > @@ -4587,23 +4587,22 @@ SecureBootCallback ( > (QuestionId =3D=3D KEY_SECURE_BOOT_DBT_OPTION)) > > { > > CloseEnrolledFile (Private->FileContext); > > - } else if (QuestionId =3D=3D KEY_SECURE_BOOT_DELETE_ALL_LIST) { > > - // > > - // Update ListCount field in varstore > > - // Button "Delete All Signature List" is > > - // enable when ListCount is greater than 0. > > - // > > - IfrNvData->ListCount =3D Private->ListCount; > > } > > } > > > > goto EXIT; > > } > > > > + GetBrowserDataResult =3D HiiGetBrowserData > (&gSecureBootConfigFormSetGuid, mSecureBootStorageName, BufferSize, > (UINT8 *)IfrNvData); > > + > > if (Action =3D=3D EFI_BROWSER_ACTION_RETRIEVE) { > > Status =3D EFI_UNSUPPORTED; > > if (QuestionId =3D=3D KEY_SECURE_BOOT_MODE) { > > if (mIsEnterSecureBootForm) { > > + if (GetBrowserDataResult) { > > + SecureBootExtractConfigFromVariable (Private, IfrNvData); > > + } > > + > > Value->u8 =3D SECURE_BOOT_MODE_STANDARD; > > Status =3D EFI_SUCCESS; > > } > > @@ -5179,6 +5178,10 @@ SecureBootCallback ( > } > > } > > > > + if (GetBrowserDataResult) { > > + SecureBootExtractConfigFromVariable (Private, IfrNvData); > > + } > > + > > EXIT: > > > > if (!EFI_ERROR (Status) && GetBrowserDataResult) { > > -- > 2.31.1.windows.1 -The information contained in this message may be confidential and propriet= ary to American Megatrends (AMI). This communication is intended to be read= only by the individual or entity to whom it is addressed or by their desig= nee. If the reader of this message is not the intended recipient, you are o= n notice that any distribution of this message, in any form, is strictly pr= ohibited. Please promptly notify the sender by reply e-mail or by telephone= at 770-246-8600, and then delete or destroy all copies of the transmission= . -=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 (#116180): https://edk2.groups.io/g/devel/message/116180 Mute This Topic: https://groups.io/mt/104596915/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-