Drop the `&& i < 16` and `&& i < 8` guards that were carried over from
the original fixed-size arrays. The loops now fill the entire
heap-allocated buffer, with values wrapping naturally via unsigned char.
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
MergeDate: Wed Mar 11 20:58:49 2026
(Merged from https://github.com/openssl/openssl/pull/30331)
iv = OPENSSL_zalloc(iv_len);
if (key == NULL || iv == NULL)
goto err;
- for (i = 0; i < key_len && i < 16; i++)
+ for (i = 0; i < key_len; i++)
key[i] = (unsigned char)i;
- for (i = 0; i < iv_len && i < 8; i++)
+ for (i = 0; i < iv_len; i++)
iv[i] = (unsigned char)(i + 1);
ctx = EVP_CIPHER_CTX_new();