Skip to content

Commit

Permalink
Merge pull request #6509 from douzzer/20230613-wc_test_ret_t
Browse files Browse the repository at this point in the history
20230613-wc_test_ret_t
  • Loading branch information
dgarske authored Jun 23, 2023
2 parents ea68920 + 902d47a commit 102cb11
Show file tree
Hide file tree
Showing 4 changed files with 698 additions and 661 deletions.
8 changes: 4 additions & 4 deletions wolfcrypt/src/chacha20_poly1305.c
Original file line number Diff line number Diff line change
Expand Up @@ -355,9 +355,9 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot(
int isEncrypt)
{
int ret;
ssize_t dst_len = isEncrypt ?
(ssize_t)src_len + POLY1305_DIGEST_SIZE :
(ssize_t)src_len - POLY1305_DIGEST_SIZE;
long int dst_len = isEncrypt ?
(long int)src_len + POLY1305_DIGEST_SIZE :
(long int)src_len - POLY1305_DIGEST_SIZE;
const byte *src_i;
byte *dst_i;
size_t src_len_rem;
Expand All @@ -375,7 +375,7 @@ static WC_INLINE int wc_XChaCha20Poly1305_crypt_oneshot(
goto out;
}

if ((ssize_t)dst_space < dst_len) {
if ((long int)dst_space < dst_len) {
ret = BUFFER_E;
goto out;
}
Expand Down
Loading

0 comments on commit 102cb11

Please sign in to comment.