Commit graph

38581 commits

Author SHA1 Message Date
Dan Fandrich
478e280278 tests: fix unit1636 with --disable-progress-meter
Closes #21500
2026-05-06 21:46:40 -07:00
Stefan Eissing
455bebc2c7
peer: fix compare of hostname for uds
Unix domain socket paths need to be compared case-senstive, in contrast
to DNS hostnames.

Follow-up to bc40e09f63

Pointed out by Codex Security

Closes #21511
2026-05-06 10:14:17 +02:00
Daniel Stenberg
06839bda76
RELEASE-NOTES: synced
Also bump pending version to 8.21.0
2026-05-06 09:19:12 +02:00
Daniel Stenberg
21687202d9
tool_formparse: polish error message + make two functions static
Closes #21510
2026-05-06 09:15:03 +02:00
Daniel Stenberg
e0df43b9d3
protocol: introduce typedef for the do_more() function
Instead of using magic values -1, 0 and -1 using enum.

Closes #21509
2026-05-06 08:16:33 +02:00
Daniel Stenberg
2c81cf620e
multi: make multi_runsingle use sub functions for states
The state machine now calls dedicated sub functions for each state, to
reduce the size and complexity.

Closes #21506
2026-05-05 17:54:54 +02:00
Daniel Stenberg
481c9d46f1
hostip: convert Curl_resolv_unix to static resolv_unix
It was only used within this file

Closes #21508
2026-05-05 17:49:12 +02:00
Daniel Stenberg
2cb6ba672d
hsts: rename Curl_hsts() to hsts_check() and make it static
It is no longer used outside of hsts.c

Closes #21507
2026-05-05 17:46:51 +02:00
Daniel Stenberg
80214dca6b
GHA: verify function-lengths
No production code function is allowed to be longer than 500 lines.

The lib/setopt.c:setopt_cptr function is currently exempt, as a single
exception until we make it smaller.

Closes #21492
2026-05-05 16:26:44 +02:00
Daniel Stenberg
f97f01f592
socks_gssapi: simplify Curl_SOCKS5_gssapi_negotiate
Also: pass in NULL when 'conf_state' is not wanted for gss_wrap() and
gss_unwrap()

Closes #21502
2026-05-05 16:24:40 +02:00
Stefan Eissing
bc40e09f63
lib: introduce Curl_peer
`struct Curl_peer` keeps information about a communication endpoint
together. It will replace `conn->host` and `conn->conn_to_host` and
proxyinfo host. It will also become part of `struct ssl_peer`.

It has a reference counter, so an instance can be shared between
connections and filters.

Elminiates `conn->host` and `conn->connect_to_host`, used in the
proxyinfo structures. Passed to DNS resolution and socks filters, etc.

Pass peer to http proxy and socks tunnel filters. Use peer in dns filter
and resolving. Make `Curl_peer` a member in the `struct ssl_peer`.

Add `docs/internals/PEERS.md` for documentation.

Closes #21472
2026-05-05 16:22:11 +02:00
Daniel Stenberg
9c9a4f3eab
thrdqueue.h: minor language polish in comments 2026-05-05 14:34:27 +02:00
Daniel Stenberg
484f724a30
thrdqueue.h: forward declare curl_thrdq unconditionally
This allows the unit tests to have a prototype involving such a struct
pointer - even when the build is done without threaded resolver.

Follow-up to 117d50b4bf

Closes #21503
2026-05-05 14:17:20 +02:00
Daniel Stenberg
03b547f73f
tool_formparse.c: use define instead of magic number
The longest header lines accepted for the -F option is now a define
instead of a magic number. I also bumped it to be an even 8K.

When fixing, I noticed that for some OOM errors curl would display two
error messages. Also fixed here.

Closes #21501
2026-05-05 10:11:10 +02:00
Daniel Stenberg
117d50b4bf
thrdqueue: make thrdq_await_done only for unit tests
It is not used for anything else, so drop Curl_ and make it conditional
accordingly.

Closes #21499
2026-05-05 08:55:49 +02:00
Daniel Stenberg
1ff399c3f7
gtls: fix some typos
Also make gtls_get_ietf_proto() static

Found by Copilot

Closes #21498
2026-05-05 08:46:26 +02:00
Daniel Stenberg
cb9cfee9b0
lib: two minor typos
Spotted by Copilot

Closes #21496
2026-05-04 19:53:49 +02:00
Daniel Stenberg
a575601b5b
show-headers.md: mention bold headers and --no-styled-output
Mentioned-by: Sollace on github
Fixes #21495
Closes #21497
2026-05-04 17:31:08 +02:00
Daniel Stenberg
46e9c65c8f
socks_gssapi: tiny Curl_SOCKS5_gssapi_negotiate cleanups
- use 'result' instead of 'code' for CURLcode variable
- use aprintf() instead of malloc + snprintf

Closes #21493
2026-05-04 16:18:46 +02:00
Daniel Stenberg
a790b634c0
libcurl-easy.md: minor clarifications
Closes #21491
2026-05-04 11:22:05 +02:00
Daniel Stenberg
f69ba0408e
mime: simplify Curl_mime_prepare_headers
Make add_content_disposition() a sub function for that single purpose.

Closes #21490
2026-05-04 11:20:22 +02:00
Daniel Stenberg
6f26ecb734
tool_formparse: cleanups
- explain the get_param_part() function
- make it parse only blanks like the rest of this code
- check for commas explicitly when scanning multiple files (to help code
  understanding)

Closes #21489
2026-05-04 10:57:45 +02:00
Daniel Stenberg
1963b2382c
gtls: simplify Curl_gtls_verifyserver
Move peer certificate verification logic into gtls_verify_cert()

Closes #21488
2026-05-04 10:35:40 +02:00
Daniel Stenberg
f59733be23
setopt: changing the proxy port is also a proxy change
Test 1589 verifies.

Closes #21485
2026-05-04 00:14:06 +02:00
dependabot[bot]
47755c4e69
GHA: bump actions and pips
- update action `actions/cache` from 5.0.4 to 5.0.5
- update action `actions/upload-artifact` from 7.0.0 to 7.0.1
- update action `github/codeql-action` from 4.32.4 to 4.35.2
- update action `msys2/setup-msys2` from 2.31.0 to 2.31.1

- update pip `filelock` from 3.25.2 to 3.29.0
- update pip `impacket` to 0.13.0
- update pip `ruff` from 0.15.10 to 0.15.12

Closes #21483
Closes #21482
2026-05-01 21:19:22 +02:00
Daniel Stenberg
faa4b0692d
tool_formparse.c: fix two minor comment typos
Pointed out by Copilot

Closes #21480
2026-05-01 11:54:08 +02:00
Daniel Stenberg
3f9baa890e
url: simplify parseurlandfillconn
Introduce two helper functions:

- hsts_upgrade()
- setup_hostname()

Closes #21479
2026-05-01 11:53:28 +02:00
Daniel Stenberg
ea392e6b36
RELEASE-NOTES: synced
Also bump the curlver to tenative 8.20.1
2026-05-01 11:34:15 +02:00
Stefan Eissing
c29278cc83
asyn-thrdd: fix result processing without wakeup socketpair
When building curl 8.20.0 with socketpair disabled, there is no
wakeup socket and the resolve results are not processed.

This fix performs result processing in the absence of a wakeup
socket before checking the resolve result.

Closes #21476
2026-05-01 11:30:51 +02:00
Daniel Stenberg
d0717acaf0
user-agent.md: mention double quotes too
Reported-by: Jeremy Nicoll
Bug: https://curl.se/mail/archive-2026-04/0029.html
Closes #21477
2026-05-01 10:27:17 +02:00
Daniel Stenberg
ecc8bf6be2
tool_formparse: simplify get_param_part
Introduce a few sub functions to reduce complexity

Closes #21478
2026-05-01 10:26:33 +02:00
Viktor Szakats
91232fc2a2
tidy-up: miscellaneous
- sha256: fix backend priority in comment.
- URLs: link to IETF URLs to the HTML document, to match others.
- VERSIONS.md: use unified date format for recent entries too.
  Ref: ce5d32032f
- GHA/labeler.yml: alpha-sort file masks in a label block.
- tests/server/mqttd: fix call arg list in a disabled function.
- tests/server/mqttd: fix comment.

Closes #21473
2026-04-30 20:22:23 +02:00
Viktor Szakats
ceaa5dfba0
GHA/curl-for-win: switch riscv job to debian:stable (testing broke)
```
The following packages have unmet dependencies:
[...]
E: Unable to satisfy dependencies. Reached two conflicting assignments:
   1. musl-dev:amd64=1.2.5-3+b1 is selected for install
   2. musl-dev:amd64 is not selected for install because:
      1. musl-dev:riscv64=1.2.5-3 is selected for install
      2. musl-dev:amd64 Breaks musl-dev:riscv64 (!= 1.2.5-3+b1)
```
Ref: https://github.com/curl/curl/actions/runs/25168601672/job/73785600341#step:3:154

Closes #21475
2026-04-30 16:14:13 +02:00
Raymond Steen
2bb5c9b555
mqtt: validate PINGRESP and DISCONNECT have remaining_length == 0
Per MQTT 3.1.1 sections 3.13.1 and 3.14.1, PINGRESP and DISCONNECT fixed
headers must have remaining_length set to zero. The previous code
dispatched to mqtt->nextstate based on the queued state alone without
validating remaining_length for these no-payload packet types, allowing
a malicious broker to send a PINGRESP with non-zero remaining_length
whose trailing bytes would be interpreted as the payload of whatever
message type was queued (CONNACK, SUBACK, etc.).

The exploitation path turned out to be narrow — curl sends data to the
server the user chose to talk to — but the spec violation and the
resulting protocol-state error are real. Reject the malformed packets
with CURLE_WEIRD_SERVER_REPLY before state dispatch.

Reported-by: Raymond Steen <raymond@vortiqxconsilium.com>
Found by VORTIQ-X VXF Framework
Bug: https://hackerone.com/reports/3702718

Signed-off-by: Raymond Steen <raymond@vortiqxconsilium.com>
Closes #21465
2026-04-30 14:14:44 +02:00
Viktor Szakats
ddb30354f6
GHA/linux: work around Linuxbrew install failure
Root cause unknown, it appeared today without any local change:
```
==> Installing dependencies for libssh2: openssl@3 and zlib-ng-compat
==> Installing libssh2 dependency: openssl@3
==> Pouring openssl@3--3.6.2.x86_64_linux.bottle.tar.gz
Error: A `brew install openssl@4 libssh2 libngtcp2 libnghttp3 c-ares` process has already locked /home/linuxbrew/.linuxbrew/Cellar/openssl@4.
Please wait for it to finish or terminate it to continue.
Error: Process completed with exit code 1.
```
Ref: https://github.com/curl/curl/actions/runs/25129061781/job/73650161844?pr=21468#step:2:407

Last known good run: https://github.com/curl/curl/actions/runs/25038989485/job/73337289504

Ref: 1fbffe7f08 #21379

Closes #21469
2026-04-29 22:12:35 +02:00
Daniel Stenberg
a05f34973e
RELEASE-NOTES: synced
curl 8.20.0 release

plus VERSIONS.md update
2026-04-29 07:45:21 +02:00
Daniel Stenberg
32970e7826
THANKS: names from the 8.20.0 release 2026-04-29 07:45:21 +02:00
Viktor Szakats
377ed81ab7
tidy-up: a cmake warning message and a variable name
Spotted by GitHub Code Quality

Closes #21462
2026-04-28 09:07:27 +02:00
Viktor Szakats
0f47ddc0a9
build: stop building and installing runtests.1 and testcurl.1
The corresponding tools are never installed, and both are dev tools.
Refer to their `.md` originals instead.

Also markdownify text in lines nearby.

Ref: https://github.com/curl/curl/pull/21460#issuecomment-4328258450

Closes #21461
2026-04-28 09:07:27 +02:00
Viktor Szakats
f485f5e031
cmake: do not install shell completions when BUILD_CURL_EXE=OFF
Follow-up to 74542c1f4b #21459

Closes #21460
2026-04-27 21:26:29 +02:00
Viktor Szakats
74542c1f4b
cmake: do not install wcurl when BUILD_CURL_EXE=OFF
Skip installing `wcurl.1` also.

Reported-by: Daniel Schulte
Fixes #21458
Follow-up to 23bed347b3 #17035

Closes #21459
2026-04-27 17:46:42 +02:00
Viktor Szakats
931ac3085a
GHA/checksrc: switch to zizmor --persona option
Closes #21457
2026-04-27 15:07:03 +02:00
Viktor Szakats
032ea65ff2
tidy-up: whitespace
Closes #21456
2026-04-27 13:34:27 +02:00
Daniel Stenberg
1ea3060a25
write-out.md: minor language fix
Pointed out by Copilot

Closes #21455
2026-04-27 12:50:32 +02:00
Viktor Szakats
13b6a6036c
tool_dirhie: fix to create drive-relative directory
Fix to create the top directory `foo` when specified as
`X:foo\bar\filename`, on Windows and MS-DOS. Add test to verify.

Caught by Codex Security

Follow-up to 787ee935ac #16566

Closes #21449
2026-04-27 12:09:09 +02:00
Viktor Szakats
e2f84e6ba9
tunits: initialize global tool_stderr
To avoid difficult to track down crashes when a tested function ends up
outputing a message via `errorf()`, `warnf()` or siblings.

Cherry-picked from #21449

Closes #21454
2026-04-27 11:53:47 +02:00
Viktor Szakats
4d89043fbc
runtests: fix linefeeds in log messages
Cherry-picked from #21449

Closes #21452
2026-04-27 11:53:47 +02:00
Viktor Szakats
aab8d47227
units: tidy up dynbuf init
Init dynbuf after global init to bring closer to use, improve
readability and sync test sources.

Closes #21451
2026-04-27 11:53:47 +02:00
Daniel Stenberg
c1cfdf59ac
setopt: clear proxy auth properties when switching
Verify with test 1588

Closes #21453
2026-04-27 10:27:01 +02:00
Daniel Stenberg
7586ca7455
docs/cmdline-opts/write-out.md: minor language edit 2026-04-26 16:42:31 +02:00