Use _MESSAGEBYTES_MAX in crypto_aead_xchacha20poly1305
This commit is contained in:
parent
d8a5b63b7b
commit
462a8ab775
@ -53,7 +53,7 @@ crypto_aead_xchacha20poly1305_ietf_encrypt(unsigned char *c,
|
|||||||
unsigned long long clen = 0ULL;
|
unsigned long long clen = 0ULL;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (mlen > UINT64_MAX - crypto_aead_xchacha20poly1305_ietf_ABYTES) {
|
if (mlen > crypto_aead_xchacha20poly1305_ietf_MESSAGEBYTES_MAX) {
|
||||||
sodium_misuse();
|
sodium_misuse();
|
||||||
}
|
}
|
||||||
ret = crypto_aead_xchacha20poly1305_ietf_encrypt_detached
|
ret = crypto_aead_xchacha20poly1305_ietf_encrypt_detached
|
||||||
|
Loading…
Reference in New Issue
Block a user