Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/wp_aes_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,13 @@ static int wp_aes_stream_doit(wp_AesStreamCtx *ctx, unsigned char *out,
if (inLen < AES_BLOCK_SIZE) {
ok = 0;
}
/* The CTS helpers cast the block count to int, so an inLen past
* 0x7FFFFFFF overflows blocks*AES_BLOCK_SIZE. Not reachable via
* EVP_CipherUpdate (its inl is int) - defense in depth for a caller
* driving OSSL_FUNC_cipher_update directly. */
if (inLen > 0x7FFFFFFFU) {
ok = 0;
}
if (ok) {
if (ctx->enc) {
ok = wp_aes_cts_encrypt(ctx, out, in, inLen);
Expand Down
Loading