From 9c330a90b97e6756b305e87d10a49b8a3c6a1b4a Mon Sep 17 00:00:00 2001 From: DmitriyMusatkin Date: Fri, 14 Jun 2024 00:14:43 -0700 Subject: [PATCH] wrong equality --- source/windows/bcrypt_aes.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/windows/bcrypt_aes.c b/source/windows/bcrypt_aes.c index 96b6fff6..ac3dacbf 100644 --- a/source/windows/bcrypt_aes.c +++ b/source/windows/bcrypt_aes.c @@ -309,7 +309,7 @@ static int s_aes_default_encrypt( struct aws_byte_buf *out) { struct aes_bcrypt_cipher *cipher_impl = cipher->impl; - if (to_encrypt->len == 0 && cipher_impl->auth_info_ptr != NULL) { + if (to_encrypt->len == 0 && cipher_impl->auth_info_ptr == NULL) { return AWS_OP_SUCCESS; } @@ -430,7 +430,7 @@ static int s_default_aes_decrypt( struct aws_byte_buf *out) { struct aes_bcrypt_cipher *cipher_impl = cipher->impl; - if (to_decrypt->len == 0 && cipher_impl->auth_info_ptr != NULL) { + if (to_decrypt->len == 0 && cipher_impl->auth_info_ptr == NULL) { return AWS_OP_SUCCESS; } @@ -696,7 +696,7 @@ static int s_aes_gcm_finalize_decryption(struct aws_symmetric_cipher *cipher, st cipher_impl->auth_info_ptr->pbTag = cipher->tag.buffer; cipher_impl->auth_info_ptr->cbTag = (ULONG)cipher->tag.len; } - + /* take whatever is remaining, make the final decrypt call with the auth chain flag turned off. */ struct aws_byte_cursor remaining_cur = aws_byte_cursor_from_buf(&cipher_impl->overflow); int ret_val = s_default_aes_decrypt(cipher, &remaining_cur, out);