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 <eric.dong@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>

git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15170 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
Eric Dong 2014-01-23 02:00:15 +00:00 committed by ydong10
parent 96179cb36e
commit 27582c41ba
1 changed files with 16 additions and 2 deletions

View File

@ -1,7 +1,7 @@
/** @file /** @file
Entry and initialization module for the browser. Entry and initialization module for the browser.
Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR> Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License 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 which accompanies this distribution. The full text of the license may be found at
@ -4673,7 +4673,21 @@ PasswordCheck (
if (PasswordString == NULL) { if (PasswordString == NULL) {
return EFI_SUCCESS; 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) { if (StrnCmp (PasswordString, (CHAR16 *) Question->BufferValue, Question->StorageWidth/sizeof (CHAR16)) == 0) {
return EFI_SUCCESS; return EFI_SUCCESS;
} else { } else {