From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-170.mimecast.com (us-smtp-delivery-170.mimecast.com [216.205.24.170]) by mx.groups.io with SMTP id smtpd.web11.4010.1586413330549692420 for ; Wed, 08 Apr 2020 23:22:10 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@phoenix.com header.s=mimecast20170203 header.b=qe9VuiHK; spf=pass (domain: phoenix.com, ip: 216.205.24.170, mailfrom: keysound_chang@phoenix.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=phoenix.com; s=mimecast20170203; t=1586413329; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=R+VEm+DIF5DmVkr5JiAfo3Sgj9ld3Zfuq/Lnw2zPpPg=; b=qe9VuiHKWzmq/fEPfREvYT0c1XPfAx8GtWQ9T3vVwyxyttON15sr0wDSFPEzxooDSp/tBh evukjlm9VHyyeqUj91986Djt0cwpKq7Vl4Kkc6LKvUX7UQx1Pq2CdGgQanxS2dGrdo+LPZ oKkcfnXwLSkhKS7ww6errusIGE7GST0= Received: from TWN-EXCHMB-13.phoenix.com (123.51.168.5 [123.51.168.5]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-m1tqiPAwMqCvHLYIvUv55A-1; Thu, 09 Apr 2020 02:22:04 -0400 X-MC-Unique: m1tqiPAwMqCvHLYIvUv55A-1 X-CrossPremisesHeadersFilteredBySendConnector: TWN-EXCHMB-13.phoenix.com Received: from SCL-EXCHMB-13.phoenix.com (10.122.68.16) by TWN-EXCHMB-13.phoenix.com (10.122.170.118) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Thu, 9 Apr 2020 14:22:52 +0800 Received: from Keysound-Chang.phoenix.com (10.122.168.247) by SCL-EXCHMB-13.phoenix.com (10.122.68.16) with Microsoft SMTP Server id 15.0.1156.6 via Frontend Transport; Wed, 8 Apr 2020 23:21:59 -0700 From: "Keysound" To: CC: Keysound Chang , Jiaxin Wu , Siyuan Fu , Maciej Rabeda Subject: [PATCH] TlsAuthConfigDxe: Use HiiPopUp->CreatePopup() instead of CreatePopUp() Date: Thu, 9 Apr 2020 14:21:42 +0800 Message-ID: <9a54945d2845b18e4776754abcbdabb71abe19b7.1586413284.git.keysound_chang@phoenix.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Return-Path: keysound_chang@phoenix.com X-OrganizationHeadersPreserved: TWN-EXCHMB-13.phoenix.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: phoenix.com Content-Type: text/plain Content-Transfer-Encoding: quoted-printable From: Keysound Chang REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2635 According to EDK2 Driver Writer's Guide For UEFI 2.3.1, 4.2.18 Offer alternatives to function keys. Configuration of drivers should be accomplished via HII and via OS-present interfaces. Cc: Jiaxin Wu Cc: Siyuan Fu Signed-off-by: Maciej Rabeda --- .../TlsAuthConfigDxe/TlsAuthConfigDxe.inf | 1 + .../TlsAuthConfigDxeStrings.uni | 2 ++ .../TlsAuthConfigDxe/TlsAuthConfigImpl.c | 20 +++++++++++++------ .../TlsAuthConfigDxe/TlsAuthConfigImpl.h | 1 + 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf b/NetworkPkg/= TlsAuthConfigDxe/TlsAuthConfigDxe.inf index 3fc924a1d4..0ada835252 100644 --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxe.inf @@ -52,6 +52,7 @@ [Protocols]=0D gEfiDevicePathProtocolGuid ## PRODUCES=0D gEfiHiiConfigAccessProtocolGuid ## PRODUCES=0D + gEfiHiiPopupProtocolGuid ## CONSUMES=0D =20=0D [Guids]=0D gTlsAuthConfigGuid ## PRODUCES ## GUID=0D diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni b/Netw= orkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni index 973b8b7716..2b4a27d24e 100644 --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigDxeStrings.uni @@ -28,6 +28,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #string STR_TLS_AUTH_CONFIG_SAVE_AND_EXIT #language en-US "Comm= it Changes and Exit"=0D #string STR_TLS_AUTH_CONFIG_NO_SAVE_AND_EXIT #language en-US "Disc= ard Changes and Exit"=0D =20=0D +#string STR_TLS_AUTH_ENROLL_CERT_FAILURE #language en-US "Enro= ll Cert Failure!"=0D +=0D #string STR_CERT_TYPE_PCKS_GUID #language en-US "GUID= for CERT"=0D =20=0D #string STR_NULL #language en-US ""=0D diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c b/NetworkPkg/T= lsAuthConfigDxe/TlsAuthConfigImpl.c index 2481d1098f..0ef96dfaf2 100644 --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.c @@ -1383,7 +1383,6 @@ TlsAuthConfigAccessCallback ( OUT EFI_BROWSER_ACTION_REQUEST *ActionRequest=0D )=0D {=0D - EFI_INPUT_KEY Key;=0D EFI_STATUS Status;=0D RETURN_STATUS RStatus;=0D TLS_AUTH_CONFIG_PRIVATE_DATA *Private;=0D @@ -1391,6 +1390,8 @@ TlsAuthConfigAccessCallback ( TLS_AUTH_CONFIG_IFR_NVDATA *IfrNvData;=0D UINT16 LabelId;=0D EFI_DEVICE_PATH_PROTOCOL *File;=0D + EFI_HII_POPUP_PROTOCOL *HiiPopUp;=0D + EFI_HII_POPUP_SELECTION PopUpSelect;=0D =20=0D Status =3D EFI_SUCCESS;=0D File =3D NULL;=0D @@ -1402,6 +1403,11 @@ TlsAuthConfigAccessCallback ( Private =3D TLS_AUTH_CONFIG_PRIVATE_FROM_THIS (This);=0D =20=0D mTlsAuthPrivateData =3D Private;=0D + Status =3D gBS->LocateProtocol (&gEfiHiiPopupProtocolGuid, NULL, &HiiPop= Up);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((DEBUG_ERROR, "Can't find Form PopUp protocol. Exit (%r)\n", St= atus));=0D + return Status;=0D + }=0D =20=0D //=0D // Retrieve uncommitted data from Browser=0D @@ -1460,11 +1466,13 @@ TlsAuthConfigAccessCallback ( if (EFI_ERROR (Status)) {=0D CleanFileContext (Private);=0D =20=0D - CreatePopUp (=0D - EFI_LIGHTGRAY | EFI_BACKGROUND_BLUE,=0D - &Key,=0D - L"ERROR: Enroll Cert Failure!",=0D - NULL=0D + HiiPopUp->CreatePopup(=0D + HiiPopUp,=0D + EfiHiiPopupStyleError,=0D + EfiHiiPopupTypeOk,=0D + Private->RegisteredHandle,=0D + STRING_TOKEN(STR_TLS_AUTH_ENROLL_CERT_FAILURE),=0D + &PopUpSelect=0D );=0D }=0D break;=0D diff --git a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h b/NetworkPkg/T= lsAuthConfigDxe/TlsAuthConfigImpl.h index e9af492893..68c16845b3 100644 --- a/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h +++ b/NetworkPkg/TlsAuthConfigDxe/TlsAuthConfigImpl.h @@ -14,6 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent =20=0D #include =0D #include =0D +#include =0D =20=0D //=0D // Libraries=0D --=20 2.23.0.windows.1