diff options
author | Star Zeng <star.zeng@intel.com> | 2016-06-15 13:38:56 +0800 |
---|---|---|
committer | Hao Wu <hao.a.wu@intel.com> | 2016-07-07 14:06:17 +0800 |
commit | 792625fe3c91d30ea854d89304d5176d233d8398 (patch) | |
tree | 1aa351c7bf5ca003cffd8ef5f480c92542888344 | |
parent | 72c1b49bdfe8372675d310c5015bf14f2b3706e3 (diff) | |
download | edk2-platforms-792625fe3c91d30ea854d89304d5176d233d8398.tar.xz |
SecurityPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr
It is the follow up of 3ab41b7a325ca11a12b42f5ad1661c4b6791cb49
to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with
UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS.
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
(cherry picked from commit b7c7179338ace62c76e39f1270cfce0fc57ae73f)
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c | 4 | ||||
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c | 6 | ||||
-rw-r--r-- | SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiPrivate.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c index 3764b24344..9bf1ced3cc 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalDriver.c @@ -239,7 +239,7 @@ OpalDriverPopUpHddPassword ( return NULL;
}
- UnicodeStrToAsciiStr(Unicode, Ascii);
+ UnicodeStrToAsciiStrS (Unicode, Ascii, MAX_PASSWORD_SIZE + 1);
return Ascii;
}
@@ -616,7 +616,7 @@ OpalDriverGetDeviceNameByProtocol( ASSERT (Dev->Name16 != NULL);
StrCpyS (Dev->Name16, StrLength, DevName);
Dev->NameZ = (CHAR8*)AllocateZeroPool(StrLength);
- UnicodeStrToAsciiStr(DevName, Dev->NameZ);
+ UnicodeStrToAsciiStrS (DevName, Dev->NameZ, StrLength);
//
// Retrieve bridge BDF info and port number or namespace depending on type
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c index 4c72df35b4..59b7b2722c 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHii.c @@ -598,7 +598,7 @@ HiiPsidRevert( OpalHiiGetBrowserData();
- UnicodeStrToAsciiStr(gHiiConfiguration.Psid, (CHAR8*)Psid.Psid);
+ UnicodeStrToAsciiStrS (gHiiConfiguration.Psid, (CHAR8*)Psid.Psid, PSID_CHARACTER_LENGTH);
OpalDisk = HiiGetOpalDiskCB (gHiiConfiguration.SelectedDiskIndex);
if (OpalDisk != NULL) {
@@ -1047,7 +1047,7 @@ HiiPasswordEntered( return EFI_BUFFER_TOO_SMALL;
}
- UnicodeStrToAsciiStr(UniStr, Password);
+ UnicodeStrToAsciiStrS (UniStr, Password, sizeof (Password));
gBS->FreePool(UniStr);
if (gHiiConfiguration.SelectedAction == HII_KEY_ID_GOTO_UNLOCK) {
@@ -1273,7 +1273,7 @@ HiiSetFormString( //
// Copy into unicode string, then copy into string id
//
- AsciiStrToUnicodeStr( SrcAsciiStr, UniStr );
+ AsciiStrToUnicodeStrS ( SrcAsciiStr, UniStr, Len + 1);
//
// Update the string in the form
diff --git a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiPrivate.h b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiPrivate.h index 366cd3813e..bb086bd35f 100644 --- a/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiPrivate.h +++ b/SecurityPkg/Tcg/Opal/OpalPasswordDxe/OpalHiiPrivate.h @@ -53,7 +53,7 @@ typedef struct { * The type indicates the structure of the PSID authority
*/
typedef struct {
- UINT8 Psid[32];
+ UINT8 Psid[PSID_CHARACTER_LENGTH];
} TCG_PSID;
/**
|