[winpr,crypto] improve logging

This commit is contained in:
akallabeth 2023-01-28 11:25:09 +01:00 committed by akallabeth
parent 427a4fa057
commit 2f05166fb1
1 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,9 @@
#include <winpr/crypto.h>
#include "../log.h"
#define TAG WINPR_TAG("crypto.cipher")
#ifdef WITH_OPENSSL
#include <openssl/aes.h>
#include <openssl/rc4.h>
@ -633,7 +636,10 @@ BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen,
int outl = (int)*olen;
if (ilen > INT_MAX)
{
WLog_ERR(TAG, "input length %" PRIuz " > %d, abort", ilen, INT_MAX);
return FALSE;
}
if (EVP_CipherUpdate((EVP_CIPHER_CTX*)ctx, output, &outl, input, (int)ilen) == 1)
{
@ -647,6 +653,8 @@ BOOL winpr_Cipher_Update(WINPR_CIPHER_CTX* ctx, const BYTE* input, size_t ilen,
return TRUE;
#endif
WLog_ERR(TAG, "Failed to update the data");
return FALSE;
}