diff options
author | Qiu Shumin <shumin.qiu@intel.com> | 2015-08-28 02:51:50 +0000 |
---|---|---|
committer | shenshushi <shenshushi@Edk2> | 2015-08-28 02:51:50 +0000 |
commit | d2e8af97149c6f4e0247178a1a58e428e4aba37a (patch) | |
tree | 3e61f51e65549323c22f63a82f56707458865819 /SecurityPkg/Tcg/Tcg2Config | |
parent | c91c8ba803dbd9935f0d3d415dc37bb85c3ccdc9 (diff) | |
download | edk2-platforms-d2e8af97149c6f4e0247178a1a58e428e4aba37a.tar.xz |
SecurityPkg: Use safe string function.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Qiu Shumin <shumin.qiu@intel.com>
Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18344 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/Tcg2Config')
-rw-r--r-- | SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c index e1835b9613..245376966e 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c @@ -307,33 +307,33 @@ AppendBufferWithTpmAlgHash ( switch (TpmAlgHash) {
case TPM_ALG_SHA1:
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA1", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA1");
break;
case TPM_ALG_SHA256:
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA256", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA256");
break;
case TPM_ALG_SHA384:
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA384", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA384");
break;
case TPM_ALG_SHA512:
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA512", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA512");
break;
case TPM_ALG_SM3_256:
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SM3_256", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SM3_256");
break;
}
}
@@ -356,33 +356,33 @@ FillBufferWithBootHashAlg ( Buffer[0] = 0;
if ((BootHashAlg & EFI_TCG2_BOOT_HASH_ALG_SHA1) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA1", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA1");
}
if ((BootHashAlg & EFI_TCG2_BOOT_HASH_ALG_SHA256) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA256", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA256");
}
if ((BootHashAlg & EFI_TCG2_BOOT_HASH_ALG_SHA384) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA384", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA384");
}
if ((BootHashAlg & EFI_TCG2_BOOT_HASH_ALG_SHA512) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SHA512", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SHA512");
}
if ((BootHashAlg & EFI_TCG2_BOOT_HASH_ALG_SM3_256) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"SM3_256", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"SM3_256");
}
}
@@ -404,21 +404,21 @@ FillBufferWithTCG2EventLogFormat ( Buffer[0] = 0;
if ((TCG2EventLogFormat & EFI_TCG2_EVENT_LOG_FORMAT_TCG_1_2) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"TCG_1_2", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"TCG_1_2");
}
if ((TCG2EventLogFormat & EFI_TCG2_EVENT_LOG_FORMAT_TCG_2) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"TCG_2", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"TCG_2");
}
if ((TCG2EventLogFormat & (~EFI_TCG2_EVENT_LOG_FORMAT_ALL)) != 0) {
if (Buffer[0] != 0) {
- StrnCat (Buffer, L", ", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L", ");
}
- StrnCat (Buffer, L"UNKNOWN", (BufferSize / sizeof (CHAR16)) - StrLen (Buffer) - 1);
+ StrCatS (Buffer, BufferSize / sizeof (CHAR16), L"UNKNOWN");
}
}
|