[winpr,cypto] fix return checks

This commit is contained in:
Armin Novak
2026-02-27 15:40:30 +01:00
parent d3c941768f
commit bb4b7a8693

View File

@@ -177,8 +177,9 @@ BOOL CryptProtectMemory(LPVOID pData, DWORD cbData, DWORD dwFlags)
if (winpr_RAND(randomKey, sizeof(randomKey)) < 0)
return FALSE;
winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, pMemBlock->salt, randomKey,
sizeof(randomKey), 4, pMemBlock->key, pMemBlock->iv);
if (winpr_Cipher_BytesToKey(WINPR_CIPHER_AES_256_CBC, WINPR_MD_SHA1, pMemBlock->salt, randomKey,
sizeof(randomKey), 4, pMemBlock->key, pMemBlock->iv) <= 0)
return FALSE;
SecureZeroMemory(randomKey, sizeof(randomKey));