From: OwenSanzas Date: Tue, 10 Mar 2026 09:31:54 +0000 (+0000) Subject: Remove unnecessary caps in key/iv initialization loops X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=707da1e0f378f2149510037fdee162cfdb0a1a7e;p=thirdparty%2Fopenssl.git Remove unnecessary caps in key/iv initialization loops 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 Reviewed-by: Kurt Roeckx MergeDate: Wed Mar 11 20:58:49 2026 (Merged from https://github.com/openssl/openssl/pull/30331) --- diff --git a/fuzz/provider.c b/fuzz/provider.c index 623c54b2b7a..1b67cfd7748 100644 --- a/fuzz/provider.c +++ b/fuzz/provider.c @@ -479,9 +479,9 @@ static int do_evp_cipher(const EVP_CIPHER *evp_cipher, const OSSL_PARAM param[]) 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();