diff options
author | raywu <raywu@aaeon.com.tw> | 2018-09-13 16:11:56 +0800 |
---|---|---|
committer | raywu <raywu@aaeon.com.tw> | 2018-09-13 16:11:56 +0800 |
commit | 31bb486c913795c8b67d1c4dbaae2bdec4943fc9 (patch) | |
tree | f0e04ad6fe983d8aa11f0f8a808518e39ab408f1 /EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c | |
parent | 465bdc2f8b32bb4cc1ac2c420086ec79ccbd5f78 (diff) | |
download | zprj-31bb486c913795c8b67d1c4dbaae2bdec4943fc9.tar.xz |
SLP1.0 / SLP2.0 / Default Password / Logo / Fix Boot Order
Diffstat (limited to 'EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c')
-rw-r--r-- | EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c | 101 |
1 files changed, 101 insertions, 0 deletions
diff --git a/EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c b/EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c new file mode 100644 index 0000000..461b626 --- /dev/null +++ b/EDK/MiniSetup/PasswordEncode/TsePasswordEncode.c @@ -0,0 +1,101 @@ +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +//** **// +//** (C)Copyright 2012, American Megatrends, Inc. **// +//** **// +//** All Rights Reserved. **// +//** **// +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 **// +//** **// +//** Phone (770)-246-8600 **// +//** **// +//*****************************************************************// +//*****************************************************************// +//*****************************************************************// +// $Archive: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/PasswordEncode/TsePasswordEncode.c $ +// +// $Author: Arunsb $ +// +// $Revision: 2 $ +// +// $Date: 7/16/14 1:40p $ +// +//*****************************************************************// +//*****************************************************************// +// Revision History +// ---------------- +// $Log: /Alaska/SOURCE/Modules/AMITSE2_0/AMITSE/PasswordEncode/TsePasswordEncode.c $ +// +// 2 7/16/14 1:40p Arunsb +// [TAG] EIP178064 +// [Category] Bug Fix +// [Severity:] Normal +// [Symptom:] Password window hangs on post +// [Root Cause] Memory accessed over the allocated range +// [Solution] While changing the incoming password to non case sensitivie +// memory accessed only within range. +// [Files] PasswordEncode\PasswordEncode.c and +// PasswordEncode\TsePasswordEncode.c +// +// 1 5/08/14 4:37p Arunsb +// [TAG] EIP162197 +// [Category] Improvement +// [Description] Password encode feature. Modify to encode using Hashing +// based on token. +// Separate module created for TSE password encoding logic. +// +// +//************************************************************************* +//<AMI_FHDR_START> +// +// Name: CtrlCond.C +// +// Description: +// +//<AMI_FHDR_END> +//************************************************************************* + +//--------------------------------------------------------------------------- +#include "minisetup.h" + +//<AMI_PHDR_START> +//---------------------------------------------------------------------------- +// Procedure: TsePasswordEncodeLocal +// +// Description: Function to encode the password string +// +// Parameter: CHAR16 *Password, UINTN MaxSize +// +// Return value: VOID +//---------------------------------------------------------------------------- +//<AMI_PHDR_END> +BOOLEAN IsPasswordSupportNonCaseSensitive(); +VOID TsePasswordEncodeLocal ( CHAR16 *Password, UINTN MaxSize) +{ + UINTN ii; + unsigned int key = 0x935b; + + if (IsPasswordSupportNonCaseSensitive ()) + { + for ( ii = 0; ii < MaxSize/2; ii++ ) + Password[ii] = ((Password[ii]>=L'a')&&(Password[ii]<=L'z'))?(Password[ii]+L'A'-L'a'):Password[ii]; + } + // Encode the password.. + for ( ii = 1; ii <= MaxSize/2; ii++ ) + Password[ii-1] = (CHAR16)(Password[ii-1] ^ (key*ii)); +} + +//********************************************************************** +//********************************************************************** +//** ** +//** (C)Copyright 1985-2012, American Megatrends, Inc. ** +//** ** +//** All Rights Reserved. ** +//** ** +//** 5555 Oakbrook Pkwy, Building 200,Norcross, Georgia 30093 ** +//** ** +//** Phone: (770)-246-8600 ** +//** ** +//********************************************************************** +//********************************************************************** |