1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-20 02:25:14 -07:00

aes256gcm_encrypt_afternm() - abort() if mlen > 2^39-256 bits

This commit is contained in:
Frank Denis 2016-01-27 14:42:32 +01:00
parent 113091b2a0
commit aa2ae5642b

View File

@ -527,7 +527,7 @@ crypto_aead_aes256gcm_encrypt_afternm(unsigned char *c, unsigned long long *clen
(void) nsec;
memcpy(H, ctx->H, sizeof H);
if (mlen > 16ULL * (1ULL << 32)) {
if (mlen > 16ULL * ((1ULL << 32) - 2)) {
abort(); /* LCOV_EXCL_LINE */
}
memcpy(&n2[0], npub, 3 * 4);