From 27582c41bacab463c9ca8db219c257dcd6081b32 Mon Sep 17 00:00:00 2001 From: Eric Dong Date: Thu, 23 Jan 2014 02:00:15 +0000 Subject: Update password process logic, if password without interactive attribute, the first byte of buffer is zero means this password not has preexist value. Signed-off-by: Eric Dong Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15170 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Universal/SetupBrowserDxe/Setup.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c index 11c9589ceb..9b6111c03b 100644 --- a/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c +++ b/MdeModulePkg/Universal/SetupBrowserDxe/Setup.c @@ -1,7 +1,7 @@ /** @file Entry and initialization module for the browser. -Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.
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 @@ -4673,7 +4673,21 @@ PasswordCheck ( 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 (StrnCmp (PasswordString, (CHAR16 *) Question->BufferValue, Question->StorageWidth/sizeof (CHAR16)) == 0) { return EFI_SUCCESS; } else { -- cgit v1.2.3