Merge pull request #712 from tom-auger/patch-1

Use _MESSAGEBYTES_MAX in crypto_aead_xchacha20poly1305
This commit is contained in:
Frank Denis 2018-04-29 17:47:00 +02:00 committed by GitHub
commit 754cff66d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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