CryptoPkg: Fix compilation with newer Xcode due to bugged type conversion

This commit is contained in:
vit9696 2025-04-05 16:31:57 +03:00 committed by Mikhail Krichanov
parent 5714ade571
commit 9d2cf3bd21

View File

@ -20,22 +20,22 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
@retval The number of characters in the passphrase or 0 if an error occurred. @retval The number of characters in the passphrase or 0 if an error occurred.
**/ **/
INTN INT32
PasswordCallback ( PasswordCallback (
OUT CHAR8 *Buf, OUT CHAR8 *Buf,
IN INTN Size, IN INT32 Size,
IN INTN Flag, IN INT32 Flag,
IN VOID *Key IN VOID *Key
) )
{ {
INTN KeyLength; INT32 KeyLength;
ZeroMem ((VOID *)Buf, (UINTN)Size); ZeroMem ((VOID *)Buf, (UINTN)Size);
if (Key != NULL) { if (Key != NULL) {
// //
// Duplicate key phrase directly. // Duplicate key phrase directly.
// //
KeyLength = (INTN)AsciiStrLen ((CHAR8 *)Key); KeyLength = (INT32)AsciiStrLen ((CHAR8 *)Key);
KeyLength = (KeyLength > Size) ? Size : KeyLength; KeyLength = (KeyLength > Size) ? Size : KeyLength;
CopyMem (Buf, Key, (UINTN)KeyLength); CopyMem (Buf, Key, (UINTN)KeyLength);
return KeyLength; return KeyLength;