From 462a8ab7758f51290cf5a4168f396ce376cf0553 Mon Sep 17 00:00:00 2001 From: Tom Auger Date: Sun, 29 Apr 2018 14:47:12 +0100 Subject: [PATCH] Use _MESSAGEBYTES_MAX in crypto_aead_xchacha20poly1305 --- .../xchacha20poly1305/sodium/aead_xchacha20poly1305.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c b/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c index c18cdf94..04971a82 100644 --- a/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c +++ b/src/libsodium/crypto_aead/xchacha20poly1305/sodium/aead_xchacha20poly1305.c @@ -53,7 +53,7 @@ crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c, unsigned long long clen = 0ULL; int ret; - if (mlen > UINT64_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES) { + if (mlen > crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX) { sodium_misuse(); } ret = crypto_aead_xchacha20poly1305_ietf_encrypt_detached