NetworkPkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr

It is the follow up of 3ab41b7a32
to replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr with
UnicodeStrToAsciiStrS/AsciiStrToUnicodeStrS.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Siyuan Fu <siyuan.fu@intel.com>
Cc: Jiaxin Wu <jiaxin.wu@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: Jiaxin Wu <jiaxin.wu@intel.com>
Reviewed-by: Siyuan Fu <siyuan.fu@intel.com>
This commit is contained in:
Star Zeng
2016-06-15 13:38:03 +08:00
parent b68ccac17c
commit b9679cd745
8 changed files with 87 additions and 52 deletions

View File

@@ -271,7 +271,7 @@ CreateSpdEntry (
//
ValueStr = ShellCommandLineGetValue (ParamPackage, L"--name");
if (ValueStr != NULL) {
UnicodeStrToAsciiStr (ValueStr, (CHAR8 *) (*Data)->Name);
UnicodeStrToAsciiStrS (ValueStr, (CHAR8 *) (*Data)->Name, sizeof ((*Data)->Name));
*Mask |= NAME;
}
@@ -785,7 +785,7 @@ CreateSadEntry (
(*Data)->AlgoInfo.EspAlgoInfo.EncKeyLength = EncKeyLength;
AsciiStr = AllocateZeroPool (EncKeyLength + 1);
ASSERT (AsciiStr != NULL);
UnicodeStrToAsciiStr (ValueStr, AsciiStr);
UnicodeStrToAsciiStrS (ValueStr, AsciiStr, EncKeyLength + 1);
CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.EncKey, AsciiStr, EncKeyLength);
FreePool (AsciiStr);
*Mask |= ENCRYPT_KEY;
@@ -815,7 +815,7 @@ CreateSadEntry (
(*Data)->AlgoInfo.EspAlgoInfo.AuthKeyLength = AuthKeyLength;
AsciiStr = AllocateZeroPool (AuthKeyLength + 1);
ASSERT (AsciiStr != NULL);
UnicodeStrToAsciiStr (ValueStr, AsciiStr);
UnicodeStrToAsciiStrS (ValueStr, AsciiStr, AuthKeyLength + 1);
CopyMem ((*Data)->AlgoInfo.EspAlgoInfo.AuthKey, AsciiStr, AuthKeyLength);
FreePool (AsciiStr);
*Mask |= AUTH_KEY;