Commit graph

38516 commits

Author SHA1 Message Date
Daniel Stenberg
7d295145eb
mbedtls: remove failf() call with first argument as NULL
failf() needs an easy handle to work. This change removes the call since
there is normnally nowhere to show the output if init fails.

Bonus: improve language in an infof() call

Spotted by Copilot

Closes #21441
2026-04-24 17:47:30 +02:00
Viktor Szakats
41f3f94d91
sshserver.pl: add option to enable KEX algorithms in sshd
Necessary when the libssh2/libssh client library does not support KEX
algos offered by default by the OpenSSH server. E.g. libssh2 with WinCNG
combined with OpenSSH 10+.

Also: use this option in GHA/windows.

Follow-up to 3b8bb1a86a #21219
Follow-up to c98d0a2e9a #21220

Closes #21438
2026-04-24 17:09:21 +02:00
Daniel Stenberg
d19a039472
mbedtls: cleanup more without care for 'initialized'
Several mbedTLS resources (entropy/CTR-DRBG, CA/client certs, keys, CRL)
are initialized and may allocate memory before initialized is set, and
must still be cleaned up.

Follow-up to 1c4813c769

Caught by Codex Security
Closes #21440
2026-04-24 17:01:01 +02:00
Viktor Szakats
7c0a8fc210
GHA/windows: disable ssh-ed25519 hostkey in libssh2-wincng jobs
libssh2 built with the WinCNG crypto backend does not support ed25519
hostkeys.

Ref: #21438
Follow-up to acda4eae5e #21223

Closes #21439
2026-04-24 15:03:25 +02:00
Stefan Eissing
b6e0ecb3f2
resolve: pass bool for proxy resolves
So that CURLcode failure is correct and not figured out later via
`conn->bits.proxy`. Add the flag to the async struct.

`for_proxy` is figured out by the caller of Curl_resolv() when it
figures out which host/proxy name it wants the addresses for.

Remove CONN_IS_PROXIED macro as no longer needed.

Closes #21423
2026-04-24 13:10:59 +02:00
Viktor Szakats
0d3d9f2222
checksrc: add missing semicolon, fix IFDEFSINGLE capture group
Pointed out by GitHub Code Quality

Closes #21435
2026-04-24 11:08:56 +02:00
Daniel Stenberg
2f37943406
tests: drop support for the hex="yes" option in getpart
The remaining datacheck sections using this for MQTT tests were not
actually used anyway!

Closes #21428
2026-04-24 10:42:34 +02:00
Viktor Szakats
8b7e460cce
checksrc: add missing items to warnings hash, alpha-sort
Closes #21434
2026-04-24 10:14:26 +02:00
Viktor Szakats
ee65f19e2a
checksrc: fix code quality findings
- fix counting errors. Update test1185 results accordingly.
- fix an error message.
- tidy up regexp syntax.

Pointed out by GitHub Code Quality

Closes #21429
2026-04-24 09:46:35 +02:00
Daniel Stenberg
4bc34a5416
doh: fix #ifdef name
Spotted by Copilot

Closes #21431
2026-04-24 08:56:35 +02:00
Daniel Stenberg
5c756684ba
hostip: init the curl_jmpenv_lock appropriately
A zero-initialized static value is not guaranteed to be a valid mutex on
all POSIX implementations

Spotted by Codex Security

Closes #21432
2026-04-24 08:30:33 +02:00
Daniel Stenberg
eea9ce45a4
urldata.h: fix typo and lingering backtick
Spotted by Copilot

Closes #21430
2026-04-24 08:18:57 +02:00
Daniel Stenberg
961a13e366
rustls: fix memory leak on repeated SSLKEYLOGFILE fails
Before this fix, Curl_tls_keylog_open() assigned the environment
variable result to a global keylog_file_name without freeing any prior
allocation. If the file cannot be opened (e.g., permission error)
keylog_file_fp stays NULL, so subsequent calls to Curl_tls_keylog_open
will overwrite keylog_file_name and leak the previous allocation.

Spotted by Codex Security

Closes #21427
2026-04-23 22:58:39 +02:00
Viktor Szakats
734793f533
checksrc.pl: delete stray commas
Closes #21426
2026-04-23 22:07:41 +02:00
Daniel McCarney
ed9083eba2
ci: update RUSTLS_VERSION 0.15.2 -> 0.15.3
Closes #21424
2026-04-23 20:24:53 +02:00
Stefan Eissing
69f3a36bcb
doh: remove conn->bits.doh
Since we have a new struct instance for each async operation now and
async operation may happen in parallel, remove the connection bit
indicating doh is in progress.

Closes #21422
2026-04-23 17:23:54 +02:00
Stefan Eissing
00cac453c7
multi: enhance pending handles fairness
When trying to connect a pending transfer, remember the `mid` that was
last reactivated and start looking for future pending handles from the
last one forward through the pending bitset.

Background: when many pending handles exist, iterating the bitset always
from the start may become unfair to transfers that were assigned higher
`mid` values.

Fixes #21396
Reported-by: Juan Belón
Closes #21412
2026-04-23 15:55:07 +02:00
Viktor Szakats
d6372e60e5
vtls: fix comment typos and tidy up a type
Pointed out by GitHub Code Quality

Closes #21421
2026-04-23 12:31:11 +02:00
Viktor Szakats
e418b42c82
CI: set DO_NOT_TRACK=1
Closes #21420
2026-04-23 11:22:35 +02:00
Viktor Szakats
fd2a729a12
GHA/appveyor-status: disable gh tool telemetry
Ref: https://cli.github.com/telemetry

Closes #21418
2026-04-23 10:26:10 +02:00
Yedaya Katsman
7100e8d45a
vtls: log when key logging is enabled.
If built with LibreSSL, also warn that it only works for TLS <= 1.2

Inspired-by: Viktor Szakats
Closes #19814
2026-04-23 08:13:59 +02:00
Daniel Stenberg
4c078fd115
urlapi: simplify urlget_url
- unify the query and fragment separator logic
- read the bitflags directly instead of via a temp variable
- narrow the scope of a few variables

Closes #21417
2026-04-23 07:40:56 +02:00
Viktor Szakats
50ff4f2927
GHA: deprioritize Azure Ubuntu mirror
Due to year-long unreliability.

The default Ubuntu mirror works as fast as the Azure one when it's
working at its normal speed. And has HTTPS.

Also:
- replac the retry hack that turn out to not solve the problem.
- add timeouts to each download step to catch slowness early.

Follow-up to a5838847c4 #21181
Follow-up to 5172ba5475 #21107

Closes #21414
2026-04-22 19:38:56 +02:00
Viktor Szakats
bfc0cb42fb
asyn-thrdd: drop redundant result check
Pointed out by GitHub Code Quality

Closes #21415
2026-04-22 18:24:25 +02:00
Viktor Szakats
ed3fea6087
GHA: delete all apt sources except ubuntu.sources
GitHub runners are getting new 3rd-party sources frequntly now, last
week `docker.list`, this week: `google-chrome.sources`. To avoid
playing catch up, allowlist the only one we use: `ubuntu.sources`. If
this is renamed, CI would break. Let's hope this happens much less
often than new sources.

Bug: https://github.com/curl/curl/pull/21414#issuecomment-4297788640

Follow-up to 3e0e2cc1ab #21344

Closes #21416
2026-04-22 18:22:33 +02:00
Daniel Stenberg
0f2b020c03
asyn-thrdd: minor without-IPv6 fixes
Pointed out by Copilot

Closes #21413
2026-04-22 15:30:33 +02:00
Dio Putra
37ab2469c1
docs: clarify retry-max-time timing
Closes #21411
2026-04-22 14:53:59 +02:00
renovate[bot]
99d460d6da
Dockerfile: update debian:bookworm-slim Docker digest to f9c6a2f
Closes #21406
2026-04-22 09:29:05 +02:00
Viktor Szakats
7d73fe9494
appveyor: bump to OpenSSL 3.6
Closes #21405
2026-04-22 09:29:05 +02:00
Daniel Stenberg
528f6238a5
RELEASE-NOTES: synced 2026-04-22 07:53:54 +02:00
Daniel Stenberg
b16be8e244
tool_operate: reset the upload glob counter for next URL
Fixes #21402

Adjust test 2012 and 2013 accordingly

Closes #21403
2026-04-22 07:50:59 +02:00
Daniel Stenberg
dcf535629b
tool_operate: keep the filename for upload globbing
Follow-up to 19695e815c

Verify with test 2012 and 2013

Closes #21401
2026-04-21 23:11:42 +02:00
Daniel Stenberg
779bba2f3f
runtests: allow %EMPTY in <stdout> to verify no output 2026-04-21 17:22:11 +02:00
Stefan Eissing
ad1fcd6111
async-ares: fix query counter handling
When starting an c-ares query, the provided callback may be invoked
right away, leading to a decrement of `queries_ongoing`. Increment
the counter *before* call c-ares. Otherwise, the `async->done` bit
is not properly set.

Closes #21399
2026-04-21 15:58:06 +02:00
Daniel Stenberg
4daf483b5b
lib557: add tests with flags AND conversion specifier
Remove superfluous and never-built test code for systems with 16-bit and
64-bit ints and 16-bit longs, as we don't know any such.
2026-04-21 15:21:16 +02:00
Daniel Stenberg
4f7e323b29
mprintf: OR the flags
As 'flags' may already have been set to something when
parse_conversion() is called, make sure to only OR the new flags.

Follow-up to 4e0bfd8cf7

Closes #21398
2026-04-21 15:21:10 +02:00
Viktor Szakats
8eb3cb75a3
misc: fix code quality findings
- httpsrr: drop redundant checks.
  Follow-up to 809dda3a37 #21354
- httpsrr.h: drop obsolete comment.
  Follow-up to 2b3dfb4ad4 #21175
- ws: drop redundant check in `curl_ws_start_frame()`.
  Follow-up to 37cecfc7b9 #17683
- ws: fix typo in comment.
- tool_operate: fix VMS build. (broken since 2019-07-20, v7.66.0)
  Follow-up to b889408500 #3804

Pointed out by Copilot Code Quality

Closes #21393
2026-04-21 14:35:55 +02:00
Daniel Stenberg
2e3607034d
parsedate: refactor
- introduce 'struct when' to hold the parser result
- initwhen() initializes a 'struct when'
- datestring() parses strings
- datenum() parses numbers
- datecheck() does some final checks
- tzadjust() adds the time zone offset
- convert math to 64 bit, squeeze into time_t only in the last step,
  mktimet() does the time_t storing

Closes #21394
2026-04-21 14:22:07 +02:00
Viktor Szakats
5ff7f77310
wolfssl: fix -Wmissing-prototypes
Seen with unity, H3, wolfssl with `HAVE_EX_DATA`.

Fixing:
```
lib/vtls/wolfssl.c:412:10: error: no previous prototype for function 'Curl_wssl_cache_session' [-Wmissing-prototypes]
  412 | CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf,
      |          ^
lib/vtls/wolfssl.c:412:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
  412 | CURLcode Curl_wssl_cache_session(struct Curl_cfilter *cf,
      | ^
      | static
1 error generated.
```

Follow-up to cc5c1553fb #19852

Closes #21392
2026-04-21 10:09:58 +02:00
Daniel Stenberg
19695e815c
tool_operate: split create_single into smaller sub functions
Reduces complexity from 58 => 32.

Closes #21389
2026-04-21 08:35:09 +02:00
Daniel Stenberg
4e0bfd8cf7
mprintf: simplify parsefmt
- split out parse_flags() and parse_conversion() to reduce complexity
  from 57 to 30.

Closes #21391
2026-04-21 08:33:28 +02:00
Daniel Stenberg
0838297ad1
lib: minor comment typos
Closes #21388
2026-04-20 23:48:37 +02:00
Stefan Eissing
809dda3a37
Happy Eyeballs: add resolution time delay
HEv3 describes conditions on when first connect attempts shall be
started.
https://www.ietf.org/archive/id/draft-ietf-happy-happyeyeballs-v3-01.html
Chapter 4.2

libcurl now waits 50ms for AAAA and HTTPS results (when requested) to
return before continuing with the connect.

Added HTTPS-RR to the "was resolved" information info message. Changed
logging of HTTPS-RR to a one-liner with RFC 9460 like formatting. This
way the user can see if/what was resolved and used in connecting.

Closes #21354
2026-04-20 23:47:49 +02:00
Viktor Szakats
70a159527c
build: link bcrypt.lib via vcxproj files
And drop pragma from `rand.c`.

Closes #21386
2026-04-20 16:29:25 +02:00
Daniel Stenberg
db13c08c58
lib: fix typos in comments
Closes #21385
2026-04-20 14:56:31 +02:00
Daniel Stenberg
d087a7e4ec
mime: only allow 40 levels of calls
To avoid problems when doing insane things.

Closes #21384
2026-04-20 14:28:43 +02:00
Stefan Eissing
5448495cfd
vtls_scache: check reentrancy
Track lock status of session cache, add DEBUGASSERT()s for proper
calling sequences. Add check of lock status.

Use lock status check to prevent reentry of import/export calls.
Deny such calls with CURLE_RECURSIVE_API_CALL.

Closes #21383
2026-04-20 11:22:00 +02:00
Viktor Szakats
85e825770a
GHA: bump test minimums (more)
Follow-up to 701a8319ec96c0b73c39e16c5db68dd758419c2 #21353

Closes #21382
2026-04-20 10:47:19 +02:00
Viktor Szakats
1fbffe7f08
GHA: use more OpenSSL 4, enable ECH in more jobs
for Linux and macOS.

Closes #21379
2026-04-20 02:53:24 +02:00
Viktor Szakats
4c548b978f
openssl: fix unused variable warnings in !verbose builds
Also fix clang-tidy `readability-redundant-control-flow`.

```
lib/vtls/openssl.c:4055:46: error: unused parameter 'reason' [-Wunused-parameter]
 4055 |                                          int reason)
      |                                              ^
lib/vtls/openssl.c:4279:19: error: variable 'status' set but not used [-Wunused-but-set-variable]
 4279 |       const char *status = NULL;
      |                   ^
```
Ref: https://github.com/curl/curl/actions/runs/24641388439/job/72045859306?pr=21379

```
lib/vtls/openssl.c:4092:7: error: Value stored to 'rv' is never read [clang-analyzer-deadcode.DeadStores]
 4092 |       rv = SSL_ech_get1_status(ssl, &inner, &outer);
      |       ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vtls/openssl.c:4092:7: note: Value stored to 'rv' is never read
 4092 |       rv = SSL_ech_get1_status(ssl, &inner, &outer);
      |       ^    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
lib/vtls/openssl.c:4112:3: error: redundant return statement at the end of a function with a void return type [readability-redundant-control-flow]
 4111 | #endif
      | ~~~~~~
 4112 |   return;
      |   ^~~~~~~
 4113 | }
```
Ref: https://github.com/curl/curl/actions/runs/24642154148/job/72047919525?pr=21379#step:42:186

Cherry-picked from #21379

Closes #21380
2026-04-20 02:37:35 +02:00