mirror of
https://github.com/jedisct1/libsodium.git
synced 2026-08-25 08:37:13 +09:00
Trigger sodium_misuse() if mlen > secretstream_MESSAGESBYTES_MAX
This commit is contained in:
+2
-2
@@ -95,7 +95,7 @@ crypto_secretstream_xchacha20poly1305_push
|
||||
*outlen_p = 0U;
|
||||
}
|
||||
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX) {
|
||||
return -1;
|
||||
sodium_misuse();
|
||||
}
|
||||
crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);
|
||||
crypto_onetimeauth_poly1305_init(&poly1305_state, block);
|
||||
@@ -171,7 +171,7 @@ crypto_secretstream_xchacha20poly1305_pull
|
||||
}
|
||||
mlen = inlen - crypto_secretstream_xchacha20poly1305_ABYTES;
|
||||
if (mlen > crypto_secretstream_xchacha20poly1305_MESSAGESBYTES_MAX) {
|
||||
return -1;
|
||||
sodium_misuse();
|
||||
}
|
||||
crypto_stream_chacha20_ietf(block, sizeof block, state->nonce, state->k);
|
||||
crypto_onetimeauth_poly1305_init(&poly1305_state, block);
|
||||
|
||||
Reference in New Issue
Block a user