]> git.ipfire.org Git - thirdparty/curl.git/commit
multissl: initialize when requesting a random number
authorViktor Szakats <commit@vsz.me>
Sat, 19 Jul 2025 13:21:31 +0000 (15:21 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 20 Jul 2025 10:03:56 +0000 (12:03 +0200)
commitbf9d9fe0bd43757c1ac32129678c6321b5559a42
treeee7338fe3f9604b473377ea38b41f4bd729a801d
parentf2d1d4747db8ae4240c022b5c647782e07cbb264
multissl: initialize when requesting a random number

To fix test 1308 in MultiSSL builds.

Failure was caused by the random number generator virtual function being
NULL, instead of pointing to the implementation in the runtime-selected
TLS backend. This could happen in MultiSSL builds when a functionality
was asking for a random number without triggering a VTLS function table
initialization first. Such functionality is MIME, or form data via MIME.

The reason CI did not catch it in an earlier MultiSSL GHA/windows job,
is that it was a debug-enabled one. In debug-enabled builds the test
runner was overriding the random number generator for all tests.

Fixed this by moving the override to the tests requiring it, via
1fcf22585fa3d87a50c9dddc688d962978c0c120 #17971, enabling debug builds
to catch this issue.

Enable MultiSSL in two CI jobs, to verify this patch.

Fixing:
```
test 1308...[formpost tests]

libtests returned 44, when expecting 0
 1308: exit FAILED
[...]
=== Start of file stderr1308
 URL: log/3/test-1308
 tests/libtest/lib1308.c:70 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:72 Assertion 'total_size == 518' FAILED: curl_formget got wrong size back
 tests/libtest/lib1308.c:88 Assertion 'res == 0' FAILED: curl_formget returned error
 tests/libtest/lib1308.c:89 Assertion 'total_size == 899' FAILED: curl_formget got wrong size back
```
Ref: https://github.com/curl/curl/actions/runs/16387693424/job/46309536359?pr=17963#step:16:2515

Bug: https://github.com/curl/curl/pull/17963#issuecomment-3092282057

Closes #17970
.github/workflows/linux.yml
.github/workflows/macos.yml
lib/vtls/vtls.c