* [patch 0/4] MdeModulePkg: Don't support password without interactive flag
@ 2016-11-17 2:24 Dandan Bi
2016-11-17 2:24 ` [patch 1/4] MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported Dandan Bi
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Dandan Bi @ 2016-11-17 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Eric Dong, Jiewen Yao
In current SetupBrowser, the logic related to non-interative password
is not correct. How to support it correctly or whether support it
is still under investigation. First step remove the incorrect logic.
These patches series remove non-interative password logic in Browser
and remove the sample code in the DriverSampleDxe.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
Dandan Bi (4):
MdeModulePkg/DisplayEngine: Popup dialogue when password is not
supported
MdeModulePkg/SetupBrowser:Don't support password without interactive
flag
MdeModulePkg: Clear the buffer after using it
MdeModulePkg/DriverSampleDxe: Remove the non-interactive password
.../Universal/DisplayEngineDxe/FormDisplay.c | 3 +++
.../Universal/DisplayEngineDxe/FormDisplay.h | 3 ++-
.../Universal/DisplayEngineDxe/FormDisplayStr.uni | 7 +++++--
.../Universal/DisplayEngineDxe/ProcessOptions.c | 8 +++++++-
.../Universal/DriverSampleDxe/NVDataStruc.h | 1 -
MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 10 ----------
.../Universal/SetupBrowserDxe/Presentation.c | 1 +
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 23 ++--------------------
8 files changed, 20 insertions(+), 36 deletions(-)
--
1.9.5.msysgit.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* [patch 1/4] MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
@ 2016-11-17 2:24 ` Dandan Bi
2016-11-17 2:24 ` [patch 2/4] MdeModulePkg/SetupBrowser:Don't support password without interactive flag Dandan Bi
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dandan Bi @ 2016-11-17 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Eric Dong, Jiewen Yao
when the password is not supported, pop up a dialogue
to let user know the reason.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c | 3 +++
MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h | 3 ++-
MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni | 7 +++++--
MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c | 5 +++++
4 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
index 32fc920..07c3454 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.c
@@ -151,10 +151,11 @@ CHAR16 *gConfirmExitMsg2nd;
CHAR16 *gConfirmOpt;
CHAR16 *gConfirmOptYes;
CHAR16 *gConfirmOptNo;
CHAR16 *gConfirmMsgConnect;
CHAR16 *gConfirmMsgEnd;
+CHAR16 *gPasswordUnsupported;
CHAR16 gModalSkipColumn;
CHAR16 gPromptBlockWidth;
CHAR16 gOptionBlockWidth;
CHAR16 gHelpBlockWidth;
CHAR16 *mUnknownString;
@@ -246,10 +247,11 @@ InitializeDisplayStrings (
gConfirmOpt = GetToken (STRING_TOKEN (CONFIRM_OPTION), gHiiHandle);
gConfirmOptYes = GetToken (STRING_TOKEN (CONFIRM_OPTION_YES), gHiiHandle);
gConfirmOptNo = GetToken (STRING_TOKEN (CONFIRM_OPTION_NO), gHiiHandle);
gConfirmMsgConnect = GetToken (STRING_TOKEN (CONFIRM_OPTION_CONNECT), gHiiHandle);
gConfirmMsgEnd = GetToken (STRING_TOKEN (CONFIRM_OPTION_END), gHiiHandle);
+ gPasswordUnsupported = GetToken (STRING_TOKEN (PASSWORD_NOT_SUPPORTED ), gHiiHandle);
}
/**
Free up the resource allocated for all strings required
by Setup Browser.
@@ -299,10 +301,11 @@ FreeDisplayStrings (
FreePool (gConfirmOpt);
FreePool (gConfirmOptYes);
FreePool (gConfirmOptNo);
FreePool (gConfirmMsgConnect);
FreePool (gConfirmMsgEnd);
+ FreePool (gPasswordUnsupported);
}
/**
Get prompt string id from the opcode data buffer.
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h
index 063e94c..45532ab 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplay.h
@@ -1,9 +1,9 @@
/** @file
FormDiplay protocol to show Form
-Copyright (c) 2013 - 2014, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2013 - 2016, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available under
the terms and conditions of the BSD License that accompanies this distribution.
The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php.
@@ -56,10 +56,11 @@ extern CHAR16 *gPressEnter;
extern CHAR16 *gEmptyString;
extern CHAR16 *gMiniString;
extern CHAR16 *gOptionMismatch;
extern CHAR16 *gFormSuppress;
extern CHAR16 *gProtocolNotFound;
+extern CHAR16 *gPasswordUnsupported;
extern CHAR16 gPromptBlockWidth;
extern CHAR16 gOptionBlockWidth;
extern CHAR16 gHelpBlockWidth;
extern CHAR16 *mUnknownString;
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
index 802a1b3..bd9c8b4 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/FormDisplayStr.uni
@@ -1,8 +1,8 @@
// *++
//
-// Copyright (c) 2004 - 2015, Intel Corporation. All rights reserved.<BR>
+// Copyright (c) 2004 - 2016, Intel Corporation. All rights reserved.<BR>
// This program and the accompanying materials
// are licensed and made available under the terms and conditions of the BSD License
// which accompanies this distribution. The full text of the license may be found at
// http://opensource.org/licenses/bsd-license.php
//
@@ -114,6 +114,9 @@
#string RECONNECT_CHANGES_OPTIONS #language en-US "Press 'Y' to save, 'N' to discard"
#language fr-FR "Press 'Y' to save, 'N' to discard"
#string RECONNECT_REQUIRED #language en-US "Reconnect is required, exit and reconnect"
#language fr-FR "Reconnect is required, exit and reconnect"
#string GET_TIME_FAIL #language en-US " Get date/time fail, display ??."
- #language fr-FR " Get data/time fail, display ??."
\ No newline at end of file
+ #language fr-FR " Get data/time fail, display ??."
+#string PASSWORD_NOT_SUPPORTED #language en-US "Unsupported! Because no interactieve flag or no ConfigAccess protocol!"
+ #language fr-FR "Unsupported! Because no interactieve flag or no ConfigAccess protocol!"
+
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
index c61a395..95bd5f0 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
@@ -812,10 +812,15 @@ PasswordProcess (
Status = Question->PasswordCheck (gFormData, Question, StringPtr);
if (Status == EFI_NOT_AVAILABLE_YET || Status == EFI_UNSUPPORTED) {
//
// Password can't be set now.
//
+ if (Status == EFI_UNSUPPORTED) {
+ do {
+ CreateDialog (&Key, gEmptyString, gPasswordUnsupported, gPressEnter, gEmptyString, NULL);
+ } while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
+ }
FreePool (StringPtr);
return EFI_SUCCESS;
}
if (EFI_ERROR (Status)) {
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch 2/4] MdeModulePkg/SetupBrowser:Don't support password without interactive flag
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
2016-11-17 2:24 ` [patch 1/4] MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported Dandan Bi
@ 2016-11-17 2:24 ` Dandan Bi
2016-11-17 2:24 ` [patch 3/4] MdeModulePkg: Clear the buffer after using it Dandan Bi
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Dandan Bi @ 2016-11-17 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Eric Dong, Jiewen Yao
In current SetupBrowser, the logic related to non-interative password
is not correct. How to support it correctly or whether support it
is still under investigation. First step remove the incorrect logic.
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 23 ++---------------------
1 file changed, 2 insertions(+), 21 deletions(-)
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
index 7547814..451fd03 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c
@@ -6106,33 +6106,14 @@ PasswordCheck (
if ((Question->QuestionFlags & EFI_IFR_FLAG_CALLBACK) == EFI_IFR_FLAG_CALLBACK) {
if (ConfigAccess == NULL) {
return EFI_UNSUPPORTED;
}
} else {
- if (PasswordString == NULL) {
- return EFI_SUCCESS;
- }
-
- //
- // Check whether has preexisted password.
- //
- if (PasswordString[0] == 0) {
- if (*((CHAR16 *) Question->BufferValue) == 0) {
- return EFI_SUCCESS;
- } else {
- return EFI_NOT_READY;
- }
- }
-
//
- // Check whether the input password is same as preexisted password.
+ // If a password doesn't have the CALLBACK flag, browser will not handle it.
//
- if (StrnCmp (PasswordString, (CHAR16 *) Question->BufferValue, Question->StorageWidth/sizeof (CHAR16)) == 0) {
- return EFI_SUCCESS;
- } else {
- return EFI_NOT_READY;
- }
+ return EFI_UNSUPPORTED;
}
//
// Prepare password string in HII database
//
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch 3/4] MdeModulePkg: Clear the buffer after using it
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
2016-11-17 2:24 ` [patch 1/4] MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported Dandan Bi
2016-11-17 2:24 ` [patch 2/4] MdeModulePkg/SetupBrowser:Don't support password without interactive flag Dandan Bi
@ 2016-11-17 2:24 ` Dandan Bi
2016-11-17 2:24 ` [patch 4/4] MdeModulePkg/DriverSampleDxe: Remove the non-interactive password Dandan Bi
2016-11-24 5:15 ` [patch 0/4] MdeModulePkg: Don't support password without interactive flag Gao, Liming
4 siblings, 0 replies; 6+ messages in thread
From: Dandan Bi @ 2016-11-17 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Eric Dong, Jiewen Yao
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c | 3 ++-
MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c | 1 +
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
index 95bd5f0..557e8ec 100644
--- a/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
+++ b/MdeModulePkg/Universal/DisplayEngineDxe/ProcessOptions.c
@@ -905,11 +905,12 @@ PasswordProcess (
CreateDialog (&Key, gEmptyString, gConfirmError, gPressEnter, gEmptyString, NULL);
} while (Key.UnicodeChar != CHAR_CARRIAGE_RETURN);
Status = EFI_INVALID_PARAMETER;
}
-
+ ZeroMem (TempString, (Maximum + 1) * sizeof (CHAR16));
+ ZeroMem (StringPtr, (Maximum + 1) * sizeof (CHAR16));
FreePool (TempString);
FreePool (StringPtr);
return Status;
}
diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
index 0c5d1b4..aa0bd22 100644
--- a/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
+++ b/MdeModulePkg/Universal/SetupBrowserDxe/Presentation.c
@@ -1614,10 +1614,11 @@ ProcessUserInput (
}
DeleteString(Statement->HiiValue.Value.string, gCurrentSelection->FormSet->HiiHandle);
Statement->HiiValue.Value.string = UserInput->InputValue.Value.string;
CopyMem (Statement->BufferValue, UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen);
+ ZeroMem (UserInput->InputValue.Buffer, (UINTN) UserInput->InputValue.BufferLen);
FreePool (UserInput->InputValue.Buffer);
//
// Two password match, send it to Configuration Driver
//
if ((Statement->QuestionFlags & EFI_IFR_FLAG_CALLBACK) != 0) {
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [patch 4/4] MdeModulePkg/DriverSampleDxe: Remove the non-interactive password
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
` (2 preceding siblings ...)
2016-11-17 2:24 ` [patch 3/4] MdeModulePkg: Clear the buffer after using it Dandan Bi
@ 2016-11-17 2:24 ` Dandan Bi
2016-11-24 5:15 ` [patch 0/4] MdeModulePkg: Don't support password without interactive flag Gao, Liming
4 siblings, 0 replies; 6+ messages in thread
From: Dandan Bi @ 2016-11-17 2:24 UTC (permalink / raw)
To: edk2-devel; +Cc: Liming Gao, Eric Dong, Jiewen Yao
Cc: Liming Gao <liming.gao@intel.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Dandan Bi <dandan.bi@intel.com>
---
MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h | 1 -
MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 10 ----------
2 files changed, 11 deletions(-)
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
index 17b4d99..3dfacca 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
+++ b/MdeModulePkg/Universal/DriverSampleDxe/NVDataStruc.h
@@ -32,11 +32,10 @@ Revision History:
#define CONFIGURATION_VARSTORE_ID 0x1234
#pragma pack(1)
typedef struct {
- UINT16 WhatIsThePassword[20];
UINT16 WhatIsThePassword2[20];
UINT16 MyStringData[40];
UINT16 PasswordClearText[20];
UINT16 SomethingHiddenForHtml;
UINT8 HowOldAreYouInYearsManual;
diff --git a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
index 326d9b2..376f0ef 100644
--- a/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
+++ b/MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr
@@ -456,20 +456,10 @@ formset
defaultstore = MyManufactureDefault,
prompt = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_PROMPT),
help = STRING_TOKEN(STR_MANUFACTURE_DEFAULT_HELP),
endresetbutton;
- //
- // Non-interactive password, validate by Setup Browser
- //
- password varid = MyIfrNVData.WhatIsThePassword,
- prompt = STRING_TOKEN(STR_PASSWORD_PROMPT),
- help = STRING_TOKEN(STR_PASSWORD_HELP),
- minsize = 6,
- maxsize = 20,
- endpassword;
-
string varid = MyIfrNVData.PasswordClearText,
prompt = STRING_TOKEN(STR_MY_STRING_PROMPT),
help = STRING_TOKEN(STR_MY_STRING_HELP),
minsize = 6,
maxsize = 0x14,
--
1.9.5.msysgit.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [patch 0/4] MdeModulePkg: Don't support password without interactive flag
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
` (3 preceding siblings ...)
2016-11-17 2:24 ` [patch 4/4] MdeModulePkg/DriverSampleDxe: Remove the non-interactive password Dandan Bi
@ 2016-11-24 5:15 ` Gao, Liming
4 siblings, 0 replies; 6+ messages in thread
From: Gao, Liming @ 2016-11-24 5:15 UTC (permalink / raw)
To: Bi, Dandan, edk2-devel@lists.01.org; +Cc: Dong, Eric, Yao, Jiewen
Reviewed-by: Liming Gao <liming.gao@intel.com>
> -----Original Message-----
> From: Bi, Dandan
> Sent: Thursday, November 17, 2016 10:24 AM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming <liming.gao@intel.com>; Dong, Eric <eric.dong@intel.com>;
> Yao, Jiewen <jiewen.yao@intel.com>
> Subject: [patch 0/4] MdeModulePkg: Don't support password without
> interactive flag
>
> In current SetupBrowser, the logic related to non-interative password
> is not correct. How to support it correctly or whether support it
> is still under investigation. First step remove the incorrect logic.
>
> These patches series remove non-interative password logic in Browser
> and remove the sample code in the DriverSampleDxe.
>
> Cc: Liming Gao <liming.gao@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Jiewen Yao <jiewen.yao@intel.com>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Dandan Bi <dandan.bi@intel.com>
>
> Dandan Bi (4):
> MdeModulePkg/DisplayEngine: Popup dialogue when password is not
> supported
> MdeModulePkg/SetupBrowser:Don't support password without interactive
> flag
> MdeModulePkg: Clear the buffer after using it
> MdeModulePkg/DriverSampleDxe: Remove the non-interactive password
>
> .../Universal/DisplayEngineDxe/FormDisplay.c | 3 +++
> .../Universal/DisplayEngineDxe/FormDisplay.h | 3 ++-
> .../Universal/DisplayEngineDxe/FormDisplayStr.uni | 7 +++++--
> .../Universal/DisplayEngineDxe/ProcessOptions.c | 8 +++++++-
> .../Universal/DriverSampleDxe/NVDataStruc.h | 1 -
> MdeModulePkg/Universal/DriverSampleDxe/Vfr.vfr | 10 ----------
> .../Universal/SetupBrowserDxe/Presentation.c | 1 +
> MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 23 ++---------------
> -----
> 8 files changed, 20 insertions(+), 36 deletions(-)
>
> --
> 1.9.5.msysgit.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-11-24 5:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-17 2:24 [patch 0/4] MdeModulePkg: Don't support password without interactive flag Dandan Bi
2016-11-17 2:24 ` [patch 1/4] MdeModulePkg/DisplayEngine: Popup dialogue when password is not supported Dandan Bi
2016-11-17 2:24 ` [patch 2/4] MdeModulePkg/SetupBrowser:Don't support password without interactive flag Dandan Bi
2016-11-17 2:24 ` [patch 3/4] MdeModulePkg: Clear the buffer after using it Dandan Bi
2016-11-17 2:24 ` [patch 4/4] MdeModulePkg/DriverSampleDxe: Remove the non-interactive password Dandan Bi
2016-11-24 5:15 ` [patch 0/4] MdeModulePkg: Don't support password without interactive flag Gao, Liming
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox