Commit Graph

36717 Commits

Author SHA1 Message Date
Daniel Stenberg
70a11c6f06
CURLOPT_COPYPOSTFIELDS.md: used with MQTT and RTSP as well
Follow-up to 5ec87346a9

Closes #19351
2025-11-04 09:08:16 +01:00
Daniel Stenberg
f8e7b1377b
BINDINGS: change dead link to archive.org version
The Hollywood binding host name www.hollywood-mal.com does not seem to
work anymore.

Closes #19352
2025-11-04 09:07:41 +01:00
Daniel Stenberg
e5299a1b87
README.md: use the first paragraph from the man page
Which also mentions all protocols

Closes #19335
2025-11-03 23:13:26 +01:00
Daniel Stenberg
5ec87346a9
CURLOPT_POSTFIELDSIZE*: these also work for MQTT and RTSP
Closes #19346
2025-11-03 22:29:28 +01:00
Joshua Rogers
feab390124
rtsp: use explicit postfieldsize if specified
Signed-off-by: Joshua Rogers <MegaManSec@users.noreply.github.com>
Closes #19345
2025-11-03 22:27:16 +01:00
Viktor Szakats
63e9721b63
tests: avoid hard-coded CRLFs in more sections
- `reply/data*`, `verify/stdout`, `verify/stderr`, `verify/file*`,
  `verify/proxy`:
  - make `crlf="yes"` force CRLF to all lines, instead of just applying
    to HTTP protocol headers.
  - add support for `crlf="headers"` that only converts HTTP protocol
    header lines to CRLF. (previously done via `crlf="yes"`.)
  - use `crlf="headers"` where possible.

- `reply/connect*`:
  - add support for `crlf="yes"` and `crlf="headers"`.
  - use them where possible.

- `client/file*`, `client/stdin`:
  - add support for `crlf="yes"`.
  - use it where possible.

- `reply/data*`, `verify/protocol`:
  - replace existing uses of `crlf="yes"` with `crlf="headers`" where it
    does not change the result.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 10295 to 1985. (119985 lines total)
- files with mixed newlines from 656 to 113. (1890 files total)

After this patch there remain 141 sections with mixed newlines, where
the mixing is not split between headers/non-headers. There is no obvious
pattern here. Some of the CRLF uses might be accidental, or
non-significant. They will be tackled in a future patch.

Follow-up to 6cf3d7b1b1 #19318
Follow-up to 4d2a05d3fe #19284

Closes #19313
2025-11-03 21:15:12 +01:00
x2018
6adefe8ad0
multi: check the return value of strdup()
Closes #19344
2025-11-03 20:19:36 +01:00
x2018
231f0a2eec
http: check the return value of strdup
Closes #19343
2025-11-03 20:17:41 +01:00
Joshua Rogers
0d5e24281d
vtls: check final cfilter node in find_ssl_filter
find_ssl_filter used while(cf && cf->next) and skipped the last node.
If the SSL filter was last, channel binding lookup failed and we returned
CURLE_BAD_FUNCTION_ARGUMENT. Switch to while(cf) so the tail is examined.

This bug was found with ZeroPath.

Closes #19229
2025-11-03 18:21:57 +01:00
Devdatta Talele
8616e5aada
gssapi: make channel binding conditional on GSS_C_CHANNEL_BOUND_FLAG
Fixes #19109 - GSSAPI authentication fails on macOS with Apple's Heimdal
implementation which lacks GSS_C_CHANNEL_BOUND_FLAG support for TLS
channel binding.

Commit 0a5ea09a91 introduced TLS channel binding for SPNEGO/GSSAPI
authentication unconditionally, but Apple's Heimdal fork (used on macOS)
does not support this feature, causing "unsupported mechanism" errors
when authenticating to corporate HTTP services with Kerberos.

Solution:
- Add CURL_GSSAPI_HAS_CHANNEL_BINDING detection in curl_gssapi.h based
  on GSS_C_CHANNEL_BOUND_FLAG presence (MIT Kerberos >= 1.19)
- Make negotiatedata.channel_binding_data field conditional in vauth.h
- Guard channel binding collection/cleanup in http_negotiate.c
- Guard channel binding usage in spnego_gssapi.c

This follows the same pattern as GSS_C_DELEG_POLICY_FLAG detection and
ensures graceful degradation when channel binding is unavailable while
maintaining full support for implementations that have it.

Changes:
- lib/curl_gssapi.h: Add feature detection macro
- lib/vauth/vauth.h: Make struct field conditional
- lib/http_negotiate.c: Conditional init/cleanup (2 locations)
- lib/vauth/spnego_gssapi.c: Conditional channel binding usage

Tested on macOS with Apple Heimdal (no channel binding) and Linux with
MIT Kerberos (with channel binding). Both configurations authenticate
successfully without errors.

Closes #19164
2025-11-03 18:16:54 +01:00
Stefan Eissing
cccc65f051
openssl: check CURL_SSLVERSION_MAX_DEFAULT properly
The definition of these constants does not give a numeric ordering
and MAX_DEFAULT needs to be checked in addition of ciphers and QUIC
checks to apply correctly.

Fixes #19340
Reported-by: Peter Piekarski
Closes #19341
2025-11-03 16:31:22 +01:00
Stefan Eissing
7e91f24c73
cw-out: fix EAGAIN handling on pause
The interim CURLE_AGAIN result was not always converted to a
CURLE_OK and then caused write callers to report a failure.

Fixes #19334
Reported-by: pennae on github
Closes #19338
2025-11-03 16:10:20 +01:00
Viktor Szakats
1021c52c92
REUSE: add copyright header to two files
`.mailmap` supports comments and empty lines since at least 2.31.0:
https://git-scm.com/docs/gitmailmap/2.31.0

Closes #19339
2025-11-03 16:08:52 +01:00
Viktor Szakats
254e04b702
ftpserver.pl: fix newlines in 227/229 replies, adjust tests
The test FTP server returned LF newlines for 227/229 replies, instead of
the CRLF used for the rest.

Test data added later were explicitly made to expect an LF in these
response lines.

After this patch the FTP server returns CRLF newlines, allowing
to delete this special case in test data.

Follow-up to 3bfff57e1f
Follow-up to a7937ed49c

Closes #19330
2025-11-03 12:19:03 +01:00
Viktor Szakats
aaf9522a2c
test696: decouple from test556 data
Test 696 and 556 share the same libtest code. Make sure to issue
the `GET` request to the correct runtime test number instead of using
the hard-wired "556".

It makes the `sws` test server read the response string from `test696`
`<data>` section, instead of reading it from `test556`. To avoid this
hidden interaction between test data.

AFAICS there is no other similar hard-coded string in reused libtests.

Ref: https://github.com/curl/curl/pull/19313#issuecomment-3477448933
Follow-up to be82a3605a #16003
Closes #19329
2025-11-03 12:19:03 +01:00
Daniel Stenberg
c1e3a760ba
imap: avoid integer overflow
Follow-up to e64c28e243

Spotted by OSS-Fuzz

Closes #19332
2025-11-03 08:54:51 +01:00
Daniel Stenberg
3060495830
RELEASE-NOTES: synced 2025-11-02 23:09:54 +01:00
x2018
c898da26c6
http_aws_sigv4: check the return value of curl_maprintf()
Closes #9328
2025-11-02 23:04:24 +01:00
Viktor Szakats
2ffa8307b5
GHA/dependabot: tidy-ups 2025-11-02 17:45:50 +01:00
dependabot[bot]
7203498c6a
GHA: bump the pip-dependencies group across 2 directories with 3 updates
Closes #19321
2025-11-02 17:10:39 +01:00
Viktor Szakats
428faf6d47
GHA/dependabot: fix update group names 2025-11-02 17:10:00 +01:00
Viktor Szakats
986ef77833
runtests: fix Perl warning after recent patch
```
Use of uninitialized value $hash{"crlf"} in string eq at tests/runtests.pl line 1406.
```

Follow-up to 6cf3d7b1b1 #19318
Closes #19327
2025-11-02 13:09:16 +01:00
Viktor Szakats
6cf3d7b1b1
tests: avoid more hard-coded CRLFs in protocol sections
- fix regex to not catch CR (from CRLF), in `PORT`, `EPRT`
  commands, allowing to use `crlf="yes"` more.
- add `crlf="headers"` mode for `protocol` sections.
  To call `subnewlines()` without its force option.
  This is the mode used in `data` sections when `crlf="yes"`.
  (This confusion may be subject to a future commit.)
- subnewlines: apply CRLF to `HEAD` and `CONNECT` HTTP requests.
- subnewlines: apply CRLF to RTSP requests.
- delete remaining empty `protocol` sections.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 11325 to 10295. (119984 lines total)
- files with mixed newlines from 707 to 656. (1890 files total)

Follow-up to 4d2a05d3fe #19284

Closes #19318
2025-11-01 23:52:55 +01:00
x2018
e2a12fcbdb
vtls: properly handle SSL shutdown timeout
Closes #19323
2025-11-01 23:28:40 +01:00
x2018
f6bbc2b3be
doh: cleanup resources on error paths
Closes #19310
2025-11-01 23:14:33 +01:00
Daniel Stenberg
8d0bfe74fb
httpsrr: send HTTPS query to the right target
When the target host is on a different port than 443, the name
"_[port]._https.[name]" shall be used.

Fixes #19301
Reported-by: Gunni on github
Closes #19324
2025-11-01 23:13:30 +01:00
Viktor Szakats
6a97bc2c97
tests/data: delete stray CRLFs in markup lines
Closes #19317
2025-11-01 04:36:09 +01:00
Viktor Szakats
cf4a62725d
CI: two display name tweaks
- use `AM`/`CM` where missing.
  In GHA/linux-old and AppVeyor CI.
  To denote autotools and CMake, and to align with rest of the jobs.

- rename `Old Linux` to `Linux Old` to align with the rest of Linux
  jobs on GitHub web views sorted by name.

Closes #19316
2025-11-01 02:24:17 +01:00
Viktor Szakats
2e408aa5cc
tests: replace standalone significant tabs with macro
Follow-up to d29f14b9cf #19300

Closes #19315
2025-10-31 23:44:21 +01:00
Viktor Szakats
d2f0a0e796
tests/libtest: consistent variable naming for easy/multi/share handles
Follow-up to 928363f28c #19299

Closes #19311
2025-10-31 23:44:21 +01:00
Stefan Eissing
c35a87d776
scorecard: more params for upload tests
Add --upload-parallel=n for controlling upload parallelism. Make upload
processing similar to download processing.

Closes #19302
2025-10-31 23:27:59 +01:00
x2018
27f55383fb
schannel: properly close the certfile on error
Closes #19304
2025-10-31 23:27:06 +01:00
Daniel Stenberg
d4d7139e70
openssl: combine all the x509-store flags
... intead of overwriting the previous ones in ossl_populate_x509_store()

Pointed out by ZeroPath

Closes #19306
2025-10-31 23:24:38 +01:00
Stefan Eissing
b4630ed8fa
sectrust: fix verifystatus via sectrust
When openssl does not verify the certificate, but apple sectrust
does, we also pass it the ocsp stapled response when configured and
available.

When openssl does not verify the cert chain, it will also not be able
to verify the ocsp stapling. Do not call it if sectrust is the
verifier of the cert chain.

Fixes #19307
Reported-by: Harry Sintonen
Closes #19308
2025-10-31 23:10:35 +01:00
Daniel Stenberg
d646d5a130
openssl: fix the ocsp len arg to Curl_vtls_apple_verify
If it has no data, pass in a zero.

Fixes #19303
Reported-by: Harry Sintonen
Closes #19305
2025-10-31 23:09:05 +01:00
Viktor Szakats
9c0b239ec1
spelling: fix new finds by typos-cli 1.39.0
Closes #19312
2025-10-31 21:31:32 +01:00
Viktor Szakats
70f240b2ed
tests/libtest/cli*: fix init/deinit, leaks, and more
- add global init and deinit where missing.
- check global init success.
- improve cleaning up on error codepaths.
- drop `CLI_ERR()` macro, that could quit.
  Also make error messages tell the reason.

Closes #19309
2025-10-31 20:56:05 +01:00
Viktor Szakats
d29f14b9cf
tests: replace significant invisible spaces with macros
To make them explicit, visible, avoid being accidentally trimmed.
Also prevents Git warnings, e.g. on `git am`.

Also:
- runtests: add support for `%spc%` and `%tab%` macros.
- test59: delete non-significant line-ending space.
- spacecheck.pl: drop line-ending whitespace exception for tests.

Closes #19300
2025-10-31 17:15:33 +01:00
Daniel Stenberg
928363f28c
examples: consistent variable naming across examples
- 'CURL *' handles are called 'curl'
- 'CURLM *' handles are called 'multi'
- write callbacks are called 'write_cb'
- read callbacs are called 'read_cb'
- CURLcode variables are called 'res'

It makes the examples look and feel more consistent. It allows for
easier copy and pasting between examples.

Closes #19299
2025-10-31 16:44:57 +01:00
Daniel Stenberg
0313223853
RELEASE-NOTES: synced 2025-10-31 16:28:13 +01:00
Viktor Szakats
c887a3f2f2
BINDINGS.md: point flaky URL to archive.org
To avoid linkcheck CI fails. It was failing regularly in the last months.
2025-10-31 16:21:41 +01:00
Stefan Eissing
1e85cb4b7b
scp/sftp: fix disconnect
When a SCP/SFTP connection calls the protocol handler disconnect, it
required the connections *and* the easy handles SSH meta data to be
present. When the disconnect is called with an admin handle, the easy
meta data is not present, which prevented the shutdown to run.

The easy meta data is however not necessary to run the shutdown state
machine. Calling it with a NULL `sshp` is fine. To avoid any mixups,
check `sshp` in state operations that need it.

Fixes #19293
Reported-by: And-yW on github
Closes #19295
2025-10-31 15:56:58 +01:00
Viktor Szakats
26e3f00469
test446, 1034, 1160: set US-ASCII encoding in XML header
To match the ASCII-7 requirement for curl test data files.

Follow-up to 9243ed59b3 #17329
Follow-up to 87ba80a6df

Closes #19297
2025-10-31 15:01:08 +01:00
Viktor Szakats
2147de554d
test429: use %repeat[]%
Follow-up to eb22e37060 #19281
Follow-up to 55d4767876 #19279

Closes #19296
2025-10-31 15:01:08 +01:00
Viktor Szakats
4d2a05d3fe
tests: use crlf=yes attribute more
To make special newlines more explicit and visible.
Mostly in `<protocol>` sections, some in `<data*>` and `<upload>`.

Reducing the number of `tests/data/test*`:
- CRLF newlines from 21535 to 11337.
- files with mixed newlines from 1335 to 707.

Also delete empty `<protocol>` sections.

Closes #19284
2025-10-31 15:01:08 +01:00
Viktor Szakats
869143b194
examples: fix more potential resource leaks, and more
Also:
- delete dead code.
- sync `http2-download.c` and `http2-upload.c` sources.
- simplessl: fix constant expression.
- simplessl: avoid `expression is constant` VS2010 warning, drop pragma.
- replace large stack buffers with dynamic allocation.
- http2-download: fix to fill transfer number.

Some of these were pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19292
2025-10-31 13:35:53 +01:00
Viktor Szakats
4b85e489a4
examples/http2-serverpush: fix file handle leaks
Also:
- tests/libtest/cli_h2_serverpush: re-sync formatting.

Previously fixed in tests based on a local clang-tidy v20 report.

Pointed out by TIOBE scanner via Coverity 2025.3.0.
Follow-up to 83a8818cfe #17706

Closes #19291
2025-10-31 13:14:12 +01:00
Viktor Szakats
5bf9445315
ftp: fix leaking internal buffer newhost on error
Pointed out by TIOBE scanner via Coverity 2025.3.0.

Closes #19290
2025-10-31 13:14:09 +01:00
Viktor Szakats
d2e8acfaa6
test1100: fix missing <protocol> section
To make it actually run. Also fix the NTLM expected result, also syncing
it with other tests.

Follow-up to e6b21d422e #6037

Closes #19288
2025-10-31 13:14:06 +01:00
Daniel Stenberg
1afc4bb768
tool/var: explain how the null termination byte is there
Closes #19287
2025-10-30 20:22:37 +01:00