Commit graph

38725 commits

Author SHA1 Message Date
Viktor Szakats
bcd0497c81
tidy-up: use curlx_safefree()
Closes #21700
2026-05-21 01:31:03 +02:00
Dan Fandrich
d3b04e5600 tests: add an assert to avoid IPC blocking
If so much data is being sent over the internal IPC pipe that the pipe
buffer fills and the syscall blocks, the program will hang. Add an
assert to ensure that this limit is never reached. The buffer size is
going to be different on different platforms, so choose 1KB which is
likely to be a reasonable lower bound on just about any system.
Currently, the maximum amount ever written is <100 bytes, so this should
provide plenty of headroom.

Spotted by Codex Security

Closes #21688
2026-05-20 11:32:38 -07:00
Joshua Rogers
cce4d3b0ed schannel: fix revoke_best_effort setting for proxy
- Fix revoke_best_effort reading wrong ssl config.

Prior to this change the revoke_best_effort setting for the proxy was
wrongly ignored in favor of the same setting for the destination host.

In other words, CURLSSLOPT_REVOKE_BEST_EFFORT set via
CURLOPT_PROXY_SSL_OPTIONS did not apply to the proxy and
CURLSSLOPT_REVOKE_BEST_EFFORT set via CURLOPT_SSL_OPTIONS wrongly
applied to the proxy.

Closes https://github.com/curl/curl/pull/21683
2026-05-20 13:51:35 -04:00
Stefan Eissing
5e4e62962c cfilters: fix busy loop on blocked transfers
When a transfer gets paused after the connection has been established,
any data sitting in the kernel socket buffers will no longer get read.

Prevent the sockets form being added to the pollsets, because they
will trigger POLLIN endlessly and cause a busy poll loop. Same in event
based processing.

Reported-by: Harry Sintonen

Fixes https://github.com/curl/curl/issues/21671
Closes https://github.com/curl/curl/pull/21675
2026-05-20 13:51:34 -04:00
penpal
ba7b65f957 sspi: clear SSPI credentials on AcquireCredentialsHandle failure
- Clear credentials on AcquireCredentialsHandle failure so it is not
  used on a subsequent call.

SSPI initialization may evaluate the credentials pointer to determine
whether or not a prior call to AcquireCredentialsHandle was successful,
therefore we must clear it on a failed call.

Closes https://github.com/curl/curl/pull/21642
2026-05-20 13:51:33 -04:00
Viktor Szakats
c30db7b6be
cmake: quote COMPONENTS string in curl-config.in.cmake
For consistency and for handling an accidental empty more gracefully.

Follow-up to 7d546e52b2 #21540

Closes #21699
2026-05-20 19:24:50 +02:00
Daniel Stenberg
88c7e16cce
setopt: clear proxy auth properly on NULL
Verify NULLed proxy credentials with test1648

Closes #21696
2026-05-20 15:54:41 +02:00
Viktor Szakats
f902c3c486
Dockerfile: fix typo in variable name
Did not cause an actual issue.

Spotted by GitHub Code Quality

Follow-up to 41c03b4c98 #13250

Closes #21693
2026-05-20 13:01:56 +02:00
Viktor Szakats
76e1da0989
GHA/non-native: drop DragonFlyBSD job, due to unreliable package repo updates
Example:
```
Wed, 20 May 2026 09:51:48 GMT Updating Avalon repository catalogue...
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT repository Avalon has no meta file, using default settings
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT pkg: An error occurred while fetching package: No error
Wed, 20 May 2026 09:51:48 GMT Unable to update repository Avalon
Wed, 20 May 2026 09:51:48 GMT Error updating repositories!
Wed, 20 May 2026 09:51:48 GMT Error: Process completed with exit code 3.
```

As tested over at libssh2, retrying the install command also does not
help, only repeats the same failure.

Also: fix whitespace in matrix.

Follow-up to b158d1c9f7 #21681

Closes #21694
2026-05-20 13:01:56 +02:00
Joshua Rogers
edfc80c7c4
urlapi: compare zone-id in Curl_url_same_origin()
Closes #21686
2026-05-20 11:53:29 +02:00
Stefan Eissing
77e4e5b86d
websockets: auto-tunnel through http proxy
When using a ws: or wss: url with a http proxy, automatically
switch to tunneling operation mode.

Add test_20_10 to check.

Fixes #21663
Closes #21691
2026-05-20 11:50:35 +02:00
Viktor Szakats
b158d1c9f7
GHA/non-native: move BSDs to a single matrix, add DragonFly and Midnight
- bump cross-platform-actions to v1.1.0.
  Ref: https://github.com/cross-platform-actions/action/releases/tag/v1.1.0

- merge BSD jobs into a single matrix.

- split BSD jobs into build steps as used for other platforms.
  A new feature of cross-platform-actions v1.1.0.

- sync BSD build steps with other platforms.

- add DragonFlyBSD and MidnightBSD to the BSD matrix.
  New features of cross-platform-actions v1.1.0.
  MidnightBSD uses GnuTLS to add variation, also the preinstalled
  OpenSSL is too old (v1.1.1w) for curl.
  Stick with autotools for DragonFlyBSD; I could not figure out how
  to install cmake.
  Refs:
  https://en.wikipedia.org/wiki/DragonFly_BSD
  https://en.wikipedia.org/wiki/MidnightBSD

- bump Intel FreeBSD jobs from v14.3 to v15.0.

- fix to show `gcc` in the NetBSD job name.

All these saved 50 lines of YAML. The two new jobs take 2m15s each. The
bump to FreeBSD 15 needs and extra minute in total.

Note, the DragonFlyBSD job seems to have reliability issues. If it
remains an issue, I'll comment it out or delete it in a future commit.

Closes #21681
2026-05-20 03:19:02 +02:00
renovate[bot]
25a70e18c1
Dockerfile: update debian:bookworm-slim Docker digest to 0104b33
Closes #21687
2026-05-20 03:19:02 +02:00
Viktor Szakats
68e0b13209
runner.pm: apply minor correctness fix
"Lines 244-245 overwrite global variables `$runnerr` and `$runnerw` that
were already assigned in the child process (lines 205-206). In the
parent process context, these assignments appear incorrect and could
cause issues if `runner_init` is called multiple times. The parent
should only store references in the controller hashes."

It could never cause an actual issue, but clarifies the intent of the
code.

Spotted and fixed by GitHub Code Quality

Cherry-picked from #21646

Closes #21672
2026-05-20 03:14:26 +02:00
Viktor Szakats
b3f76b21c9
tidy-up: miscellaneous
- fix typos and wording in documentation and comments.
- KNOWN_BUGS: merge duplicate H1 section.
- test_10_proxy: delete stray expressions.
- Perl: `while()` -> `while(1)`.
- Perl: fix indent, whitespace, drop redundant quotes and parentheses.
- fix casing: URL, SSL, Windows.
- badwords: readd `threadsafe`, add `well-known` (and fix it).
- replace `WinXP` -> `Windows XP` to match other uses.

Closes #21646
2026-05-20 00:50:43 +02:00
Viktor Szakats
1c3289c85e
unit3303, unit3304: tidy-ups
- use `curlx_safefree()`.
- drop redundant blocks.

Follow-up to 7541ae569d #21667

Closes #21684
2026-05-20 00:48:54 +02:00
Joshua Rogers
7541ae569d
tls: fix incomplete mTLS config in conn reuse and session cache
cert_type, key, key_type, key_passwd and key_blob lived in
ssl_config_data but not in ssl_primary_config, so they were invisible to
match_ssl_primary_config() and to the TLS session cache peer key.

Two easy handles sharing a connection pool could reuse each other's
authenticated connections when they differed only on SSLKEY, SSLKEYTYPE,
KEYPASSWD, SSLCERTTYPE or SSLKEYBLOB. The second handle would silently
inherit the first handle's authenticated identity.

Promote all five fields into ssl_primary_config so the conn-reuse
predicate and session cache key cover the complete client credential
set. Also replace the fixed ":CCERT" session cache marker with the
actual clientcert path so sessions are not shared across different
client certificates.

Verified by test 3303 and 3304

Reported-By: Joshua Rogers (AISLE Research)
Closes #21667
2026-05-20 00:02:33 +02:00
Viktor Szakats
a4dca608e1
GHA/non-native: alpha-sort BSD jobs
Closes #21680
2026-05-19 19:03:58 +02:00
Daniel Stenberg
5c225384b8
url: detect proxy changes read from environment
When a proxy is set from an environment variable, detect if that proxy
is not the same as previously and flush state.

Verified by test1647: verify changing proxy with env variables and make
sure Digest state is flushed in the second use

Closes #21666
2026-05-19 17:14:16 +02:00
Viktor Szakats
d99dcfb04a
BUFQ.md: re-sync with source code
Also:
- move bullet points out from C code fences.
- fold long lines.

Follow-up to d4983ffc13 #17396

Closes #21678
2026-05-19 16:55:45 +02:00
Viktor Szakats
000de81fb1
tidy-up: rename more CURLcode variables to result
Follow-up to 885b553545 #21348

Closes #21676
2026-05-19 16:55:45 +02:00
Viktor Szakats
1fb734bc2d
docs: tidy-up scheme references
After this patch `://` schemes are lowercase and enclosed in backticks.

Also:
- docs/libcurl/libcurl-multi.md: drop a stray C code fence.
- docs/libcurl/libcurl-tutorial.md: replace single/double quotes with
  Markdown markup where applicable.

Ref: #21646

Closes #21674
2026-05-19 16:55:45 +02:00
Viktor Szakats
a7bfbc09d4
unit1304: use enum type and values, rename result to res
Ref: #21646

Closes #21673
2026-05-19 16:55:45 +02:00
Viktor Szakats
6999ccb8e0
managen: apply minor fixes and improvements
- replace `goto` with `while` loop.
- fix newlines in a warning message.
- handle open error for `curl/curlver.h` header.

Ref: #21646

Closes #21670
2026-05-19 16:55:45 +02:00
Joshua Rogers
81da4ee249
vtls: use Curl_safecmp for CRLfile and pinned_key comparison
Both are filesystem paths (or case-sensitive hash strings for
pinned_key). curl_strequal is case-insensitive and would treat
/etc/ssl/Crl.pem and /etc/ssl/crl.pem as the same file, unlike the other
path fields (CApath, CAfile, issuercert, clientcert) which already use
Curl_safecmp.

Closes #21668
2026-05-19 15:10:47 +02:00
Dan Fandrich
d24652971a docs/libcurl: fix the version for curl_multi_socket_action
It was added in 7.16.3, not 7.15.4 (that's when curl_multi_socket was
added).
2026-05-18 22:34:05 -07:00
Shintomon Mathew
38cd720f76
creds: mask OAuth bearer token in trace logs
Masked OAuth bearer tokens in credential trace output by emitting ***
when a bearer token is present, matching the existing password redaction
behavior and preventing sensitive token disclosure in verbose/debug
logs.

Closes #21659
2026-05-18 23:53:41 +02:00
Daniel Stenberg
b190c803e3
test1588: use %TESTNUMBER, not hard-coded number
Closes #21662
2026-05-18 23:52:45 +02:00
Daniel Stenberg
64824e439d
VULN-DISCLOSURE-POLICY.md: test code is not secure
Don't tell us about it

Closes #21660
2026-05-18 16:19:06 +02:00
Daniel Stenberg
9107e8ba98
curl_easy_pause.md: rephrase the stream cache when pause clause
- mention HTTP/3
- it is 10 MB per stream these days

Closes #21658
2026-05-18 15:51:08 +02:00
Daniel Stenberg
7ca5f939c8
test1646: netrc parsing without user match but user in URL
Follow-up to 4ae1d7cc26
2026-05-18 15:19:22 +02:00
Stefan Eissing
4ae1d7cc26
netrc: scanner refactor
Refactor the netrc scanner. Add test case for checking that the last
matched machine with unmatched login does not return the password as
success (unit1304).

Closes #21624
2026-05-18 15:18:09 +02:00
Daniel Stenberg
5c1e017987
curl_easy_setopt.md: change options when no transfer runs
Underscore this. Changing them mid-transfer may cause problems.

Fixes #21604
Reported-by: Joshua Rogers
Closes #21657
2026-05-18 15:07:00 +02:00
Mark Esler
8a86fa13f3
vtls_scache: include signature_algorithms in the SSL peer cache key
Curl_ssl_peer_key_make() omitted ssl->signature_algorithms, although
match_ssl_primary_config() compares the field. Two handles differing
only in CURLOPT_SSL_SIGNATURE_ALGORITHMS therefore shared a peer key and
could resume each other's sessions across a shared CURLSH SSL session
cache.

Add :SIGALGS-%s next to the other ssl_primary_config fields.

Closes #21651
2026-05-18 13:59:11 +02:00
Viktor Szakats
a55750af0b
mk-unity.pl: #include, and not concatenate input headers
When using `-D_CURL_TESTS_CONCAT=ON` with CMake, do not concatenate
`first.h` (or any future header) into the output C file, but `#include`
it instead. This is to play nice with compilers and analyzers which may
apply different checker rules on logic found in headers, vs. the input
source file. As seen for example with `-Wunused-macro` enabled in CI.
After this patch concatenated sources behave closer to regular C
sources.

Also:
- first.h: drop some `-Wunused-macro` silencers that became redundant
  with this patch.

Follow-up to 47f411c6d8 #21554
Follow-up to 39542f0993 #20667

Closes #21656
2026-05-18 13:57:13 +02:00
Daniel Stenberg
240408a725
scripts/contri*: fix the Credits-to regex
On my suggestion, the regex turned up wrong when looking for Credits-to
in git logs. This adjustment allows the leading spaces.

Follow-up to 64adc43a6e

Closes #21655
2026-05-18 07:53:52 +02:00
Viktor Szakats
3c597ced16
cmake: fix three issues generating lib options in config files
- drop duplicate libs lists next to each other in `libcurl.pc`.
  Logic copied from libssh2.
  Fixing (seen in a local build):
  ```diff
  -Libs.private: -lssh2 -lz -lz -lldap -llber -lssl -lcrypto -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace
  +Libs.private: -lssh2 -lz -lldap -llber -lssl -lcrypto -lz -lbrotlidec -lbrotlicommon -lzstd -lnghttp2 -licucore -liconv -lpsl -lbacktrace
  ```
  Refs:
  e1da7b2cb8
  https://github.com/libssh2/libssh2/pull/1621
  6464301820
  https://github.com/libssh2/libssh2/pull/1131

- handle `$<LINK_ONLY:NAMESPACE::NAME>` references.
  Fixing (seen in a local build using libssh2 v1.11.2-DEV):
  ```diff
  -Libs.private: -lssh2 -l$<LINK_ONLY:OpenSSL::Crypto> -lz -lldap -llber [...]
  +Libs.private: -lssh2 -lcrypto -lz -lldap -llber [...]
  ```

- fix `-l-pthread` sneaking into `libcurl.pc`.
  Fixing (seen with Android):
  ```diff
  -Libs.private:  -lz -l-pthread
  +Libs.private: -pthread -lz
  ```
  Refs:
  2b65c20fc6/ports/curl/dependencies.patch (L631-L634)
  70b941a5d2 (diff-7f2c3b2f93cd3478671a603cbd5ef818c7c403a11dc25e1d3539e9b03495a5d3)
  Upstream-patch-by: Kai Pastor

Closes #21654
2026-05-17 22:48:22 +02:00
Viktor Szakats
64adc43a6e
scripts: catch Credits-to contributors
Also:
- THANKS: add Credits-to attribution missed earlier.

Closes #21653
2026-05-17 22:48:22 +02:00
Daniel Stenberg
e8c1023b00
connect: remove deref of freed pointer in trace call
Spotted by CodeSonar

Closes #21649
2026-05-17 14:20:19 +02:00
Daniel Stenberg
d74c0ada4e
urlapi: prevent a terminal .0x component to normalize IPv4
Extend test 1560 to verify

Follow-up to 831a151484

Spotted by Codex Security
Closes #21652
2026-05-17 14:19:26 +02:00
Viktor Szakats
7bde6cb9fc
build: omit zlib pkg-config reference for Android
In both autotools and cmake builds, because Android does not offer
a `zlib.pc`.

Also:
- GHA/non-native: dump config files, to verify.

Reported-by: sfan5 on github
Fixes #21647

Closes #21648
2026-05-17 13:27:06 +02:00
Daniel Stenberg
44ede0cc5a
url: remove superfluous check
This pointer is already verified to be non-NULL some 15 lines above.

Pointed out by CodeSonar
Closes #21650
2026-05-17 00:35:25 +02:00
Stefan Eissing
a0f08d6975
cf-h2-prox: fix peer leak
The unlinking of the new Curl_peer was happening too later after
the struct had been set to zero. Move the unlink to happen before
that.

Fixes #21602
Reported-by: Joshua Rogers
Closes #21627
2026-05-17 00:14:36 +02:00
Daniel Stenberg
061136f24b
RELEASE-NOTES: synced 2026-05-16 23:09:52 +02:00
Stefan Eissing
ad549c4641
unix-sockets: ignore proxy settings
Fix a recent regression: when a unix-socket is configured, all proxy
settings must be ignored. The `via_peer` had been checked correctly,
but the connections proxy bits were not cleared.

Add test_11_04 to verify.

Reported-by: Fabian Keil (libcurl mailing list)
Closes #21630
2026-05-16 18:49:46 +02:00
Viktor Szakats
535c575e31
lib678: fix to not be perma-skipped
Prior to this patch the test was always skipped due to failing precheck
with `CURLE_BAD_FUNCTION_ARGUMENT`, because of the zero-length blob
passed to setopt. Fix by passing a non-zero long dummy blob as done in
`mk-lib1521.pl`.

Fixing:
```
test 0678 SKIPPED: CURLOPT_CAINFO_BLOB is not supported
```

Follow-up to 956e1ae84f #20705

Closes #21641
2026-05-16 11:55:59 +02:00
Viktor Szakats
40c516f941
runner.pm: set CURL_TESTNUM for precheck commands
Closes #21640
2026-05-16 11:55:59 +02:00
Viktor Szakats
5688c2a8ee
SSLCERTS: document 8.19.0 default Native CA builds (Windows)
Ref: https://curl.se/docs/sslcerts.html

Follow-up to 1730407b74 #18279
Reported-by: chrizilla on github
Fixes #21634

Closes #21639
2026-05-16 11:55:59 +02:00
Viktor Szakats
c46a7913e5
setopt: fix to honor CURLOPT_PROXY_CAINFO_BLOB over Native CA
In AppleSecTrust or NativeCA-enabled builds, make sure override it when
setting a custom `CURLOPT_PROXY_CAINFO_BLOB`.

Reported-by: Joshua Rogers (Aisle Research)

Follow-up to 1730407b74 #18279
Follow-up to eefd03c572 #18703

Closes #21631
2026-05-16 11:55:59 +02:00
Viktor Szakats
3f8f725d97
schannel: enforce Extended Key Usage for custom CA roots
Reported-by: Joshua Rogers (Aisle Research)

Closes #21629
2026-05-16 11:55:59 +02:00