Merge 48652f081125130a0dda11ae5ed3e7d215585273 into 03e1438089654fb884ac48e0f3cd0049cfe2c102

This commit is contained in:
Dave Rodgman 2026-10-27 10:46:09 -04:00 committed by GitHub
commit f692258bd4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -51,11 +51,20 @@ void ssl_cf_hmac(int hash)
ref_out, out_len,
&key));
/*
* Test all possible lengths up to a point. The difference between
* Test various possible lengths up to a point. The difference between
* max_in_len and min_in_len is at most 255, and make sure they both vary
* by at least one block size.
*
* It is quite expensive to test all possible lengths, so we test values
* which are within 1 of a multiple of block_size, plus loop end values.
*/
for (max_in_len = 0; max_in_len <= 255 + block_size; max_in_len++) {
int no_skip = (((max_in_len + block_size + 1) % block_size) < 3) ||
(max_in_len >= ((255 + block_size) - 1));
if (!no_skip) {
continue;
}
mbedtls_test_set_step(max_in_len * 10000);
/* Use allocated in buffer to catch overreads */