From: Eric Dong Date: Thu, 23 Jan 2014 02:00:15 +0000 (+0000) Subject: Update password process logic, if password without interactive attribute, the first... X-Git-Tag: edk2-stable201903~11787 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=27582c41bacab463c9ca8db219c257dcd6081b32;hp=96179cb36e78bd21e64e7b00c0dc914cb9844850 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 --- 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 {