]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 weeks agocurl_path: add curlx_dyn_free() on an error path
x2018 [Wed, 22 Oct 2025 05:24:55 +0000 (13:24 +0800)] 
curl_path: add curlx_dyn_free() on an error path

Follow-up to 976333dd4052855c22369e89

Closes #19183

2 weeks agohostip: fix infof() output for non-ipv6 builds using IPv6 address
Daniel Stenberg [Tue, 21 Oct 2025 21:43:30 +0000 (23:43 +0200)] 
hostip: fix infof() output for non-ipv6 builds using IPv6 address

Pointed out by ZeroPath

Closes #19184

2 weeks agohttp: unify error handling in Curl_http()
x2018 [Tue, 21 Oct 2025 18:03:29 +0000 (02:03 +0800)] 
http: unify error handling in Curl_http()

Closes #19182

2 weeks agoDockerfile: update debian:bookworm-slim Docker digest to 78d2f66
renovate[bot] [Tue, 21 Oct 2025 05:33:33 +0000 (05:33 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to 78d2f66

Closes #19173

2 weeks agospelling: subdirectories
Viktor Szakats [Tue, 21 Oct 2025 13:22:43 +0000 (15:22 +0200)] 
spelling: subdirectories

Closes #19180

2 weeks agoINSTALL-CMAKE.md: add manual configuration examples
Viktor Szakats [Tue, 21 Oct 2025 13:08:53 +0000 (15:08 +0200)] 
INSTALL-CMAKE.md: add manual configuration examples

Closes #19179

2 weeks agocookie: only count accepted cookies in Curl_cookie_add
Daniel Stenberg [Mon, 20 Oct 2025 09:34:25 +0000 (11:34 +0200)] 
cookie: only count accepted cookies in Curl_cookie_add

The counter used to stop accepting cookies after a certain amount has
been received in a single response would previously also count some
cookies that were not actually accepted as they were discarded after the
counter was increased.

Starting now, the counter is increased only for cookies that were
accepted.

Pointed out by ZeroPath
Closes #19157

2 weeks agomime: fix unpausing of readers
Stefan Eissing [Tue, 21 Oct 2025 11:51:10 +0000 (13:51 +0200)] 
mime: fix unpausing of readers

When unpausing a transfer, check if the reader pause state differs
in addition to the "keepon" flags.

Reported-by: 包布丁
Fixes #18848
Closes #19178

2 weeks agohmac: free memory properly on errors
Daniel Stenberg [Tue, 21 Oct 2025 11:33:18 +0000 (13:33 +0200)] 
hmac: free memory properly on errors

If one of the hmac init calls fail, Curl_HMAC_init previously would
return without first freeing the allocated HMAC_context.

Fixes #19176
Reported-by: WangDaLei on github
Closes #19177

2 weeks agocmake: say 'absolute path' in option descriptions and docs
Viktor Szakats [Mon, 20 Oct 2025 21:11:53 +0000 (23:11 +0200)] 
cmake: say 'absolute path' in option descriptions and docs

To not have to guess. Also to sync with autotools, which already uses
this wording.

Also:
- replace the stray term 'folder' with 'directory' for consistency.
- store help text in a temp variable to avoid overly long strings
  (mandatory in CMake <4.2.0 and can't be trivially split), also
  to avoid repeating this string 4 times.

Ref: https://cmake.org/cmake/help/v4.2/command/set.html

Closes #19169

2 weeks agocmake: add and use local FindGnuTLS module
Viktor Szakats [Mon, 20 Oct 2025 13:51:39 +0000 (15:51 +0200)] 
cmake: add and use local FindGnuTLS module

Replacing a combination of custom logic in the main script and relying
on CMake's built-in Find module, with code and behavior used for
the rest of dependencies.

Also to:
- add version detection in the non-pkg-config path.
- make `GNUTLS_INCLUDE_DIR` and `GNUTLS_LIBRARY` take precedence over
  pkg-config. As with other dependencies.
- document the above two configuration options.
- prepare for #16973, which originally introduced this local Find
  module.

The local module is doing largely the same as CMake's built-in
FindGnuTLS. Differences:
- honors `CURL_USE_PKGCONFIG`.
- returns GnuTLS version for non-pkg-config detection.
- consistently returns `GNUTLS_VERSION`.
  (CMake's built-in uses s different name in <3.16.)
- CMake 3.16+ returns an imported target. curl supports 3.7,
  therefore we may only use it conditionally, which isn't worth it.

Cherry-picked from #16973

Closes #19163

2 weeks agotool_parsecfg: detect and error on recursive --config use
Daniel Stenberg [Mon, 20 Oct 2025 20:46:56 +0000 (22:46 +0200)] 
tool_parsecfg: detect and error on recursive --config use

The config file parser now has a maximum level of inclusions allowed (5)
to detect and prevent recursive inclusions of itself leading to badness.

Bonus: clean up return code handling from the config parser.

Test 774 verifies
Closes #19168

2 weeks agocmake: inline linter instructions
Viktor Szakats [Mon, 20 Oct 2025 23:26:58 +0000 (01:26 +0200)] 
cmake: inline linter instructions

To avoid it applying to all the rest of the script.

Follow-up to b761eb5addb9e29b2ee0e5841633c09d1fd77704 #17576

Closes #19172

2 weeks agoINSTALL-CMAKE.md: fix descriptions for LDAP dependency options
Viktor Szakats [Mon, 20 Oct 2025 22:11:00 +0000 (00:11 +0200)] 
INSTALL-CMAKE.md: fix descriptions for LDAP dependency options

After introducing the local FindLDAP module, these options work the same
way as with other dependencies.

Follow-up to 49f2a23d509645d534cbb2e2ffbd6347fac6e59e #15273

Closes #19170

2 weeks agocmake: two minor tidy-ups
Viktor Szakats [Mon, 20 Oct 2025 22:22:49 +0000 (00:22 +0200)] 
cmake: two minor tidy-ups

- flatten an if tree.
- fix a typo in comment.

Closes #19171

2 weeks agocf-socket: give information when unable to open socket
Stefan Eissing [Mon, 20 Oct 2025 09:51:20 +0000 (11:51 +0200)] 
cf-socket: give information when unable to open socket

Give ERRNO explanation in a failf() when unable to open a socket.
Helps in finding out what the issue preventing your curl to work
really is. Just had a wrong ulimit after a sys update.

Closes #19158

2 weeks agohttp: accept duplicate location with same value
Stefan Eissing [Mon, 20 Oct 2025 10:17:31 +0000 (12:17 +0200)] 
http: accept duplicate location with same value

When a server sends a Location: header repeat with the same location,
ignore the repeats silently.

Follow-up to 9596c4a2587a9e512ea46f
Closes #19159

2 weeks agosocks_gssapi: replace `gss_release_buffer()` with curl free for buffers owned by...
Viktor Szakats [Fri, 10 Oct 2025 15:44:25 +0000 (17:44 +0200)] 
socks_gssapi: replace `gss_release_buffer()` with curl free for buffers owned by libcurl

Before this patch, this code used to call `gss_release_buffer()` on
objects with buffers allocated via curl's allocator.
`gss_release_buffer()` calls system (or Win32) free on these buffers,
which may mismatch with curl's allocator. To fix it, align these calls
with the pattern used in vauth modules, by replacing
`gss_release_buffer()` with curl free to release the buffers.

Use `Curl_safefree()` to set the freed pointer to NULL, as
`gss_release_buffer()` did.

Also: use object length var when allocating.

Reported-by: Joshua Rogers
Closes #19018

2 weeks agoGHA/curl-for-win: drop libssh
Viktor Szakats [Mon, 20 Oct 2025 12:02:06 +0000 (14:02 +0200)] 
GHA/curl-for-win: drop libssh

Switch back to default libssh2.

The distribution server has reliability issues (this time it works
locally though):
```
++ curl [...] --output pkg.bin https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz --output pkg.sig https://www.libssh.org/files/0.11/libssh-0.11.3.tar.xz.asc
curl: (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2) [4x]
```
Ref: https://github.com/curl/curl/actions/runs/18651134321/job/53169147048#step:3:2391

There is also no official mirror that I know of.

Ref: af8e1aa4b06e9dc78a559b485348e5464bd5cff5 #18257

Closes #19162

2 weeks agoMakefile.example: make default options more likely to work
Viktor Szakats [Mon, 20 Oct 2025 11:23:34 +0000 (13:23 +0200)] 
Makefile.example: make default options more likely to work

- replace default libpaths with more common ones.
- drop Solaris network libs.

Closes #19161

2 weeks agoMakefile.example: bump default example from FTP to HTTPS
Viktor Szakats [Mon, 20 Oct 2025 10:57:51 +0000 (12:57 +0200)] 
Makefile.example: bump default example from FTP to HTTPS

To have a chance to work out of the box, securely. (assuming a TLS
backend with CA certs setup.)

Closes #19160

2 weeks agocf-socket: make set_local_ip void, and remove failf()
Daniel Stenberg [Sun, 19 Oct 2025 09:38:30 +0000 (11:38 +0200)] 
cf-socket: make set_local_ip void, and remove failf()

No callers of this function checked the return code, meaning failures
are not lethal == using failf was wrong, and it can just as well return
void.

Closes #19137

2 weeks agoINSTALL.md: add another OS (Azure Sphere)
Daniel Stenberg [Mon, 20 Oct 2025 08:02:33 +0000 (10:02 +0200)] 
INSTALL.md: add another OS (Azure Sphere)

Closes #19155

2 weeks agocurl_get_line: the final return cannot be reached
Daniel Stenberg [Mon, 20 Oct 2025 07:12:09 +0000 (09:12 +0200)] 
curl_get_line: the final return cannot be reached

Follow-up to 769ccb4d4261a75c8a4236f

Pointed out by CodeSonar
Closes #19154

2 weeks agohttp: return error for a second Location: header
Daniel Stenberg [Sun, 19 Oct 2025 08:59:38 +0000 (10:59 +0200)] 
http: return error for a second Location: header

Unless it is identical to the previous one.

Follow-up to dbcaa0065719acc0383

Adjusted test 580, added test 772 and 773

Fixes #19130
Reported-by: Jakub Stasiak
Closes #19134

2 weeks agoRELEASE-NOTES: fix typo
Daniel Stenberg [Mon, 20 Oct 2025 07:09:50 +0000 (09:09 +0200)] 
RELEASE-NOTES: fix typo

2 weeks agoHTTP3: clarify the status for "old" OpenSSL, not current
Daniel Stenberg [Mon, 20 Oct 2025 06:47:43 +0000 (08:47 +0200)] 
HTTP3: clarify the status for "old" OpenSSL, not current

Closes #19153

2 weeks agoRELEASE-NOTES: synced rc-8_17_0-2
Daniel Stenberg [Mon, 20 Oct 2025 06:53:49 +0000 (08:53 +0200)] 
RELEASE-NOTES: synced

2 weeks agocurl_easy_setopt.md: add missing CURLOPT_POSTFIELDS
Daniel Stenberg [Sun, 19 Oct 2025 22:34:56 +0000 (00:34 +0200)] 
curl_easy_setopt.md: add missing CURLOPT_POSTFIELDS

It was mistakenly removed in 8dab7465a594b1fb4b (shipped in 8.9.0)

Also fix test 1139 which should have detected this but didn't due to a
bad regex check.

Reported-by: Jonathan Cardoso
Fixes #19151
Closes #119152

2 weeks agoGHA/windows: delete remains of Perl `Win32-Process*` caching
Viktor Szakats [Sun, 19 Oct 2025 22:24:15 +0000 (00:24 +0200)] 
GHA/windows: delete remains of Perl `Win32-Process*` caching

Follow-up to c8d6643df212791edee705a94c890335dac8762b #19083

2 weeks agotool_filetime: cap crazy filetimes instead of erroring
Daniel Stenberg [Sun, 19 Oct 2025 15:00:06 +0000 (17:00 +0200)] 
tool_filetime: cap crazy filetimes instead of erroring

Also cap the minimum allowed timestamp now.

Closes #19147

2 weeks agotool_cb_rea: use poll instead of select if available
Daniel Stenberg [Sun, 19 Oct 2025 13:59:09 +0000 (15:59 +0200)] 
tool_cb_rea: use poll instead of select if available

- poll doesn't have the FD_SETSIZE problem

- select: if socket >= FD_SETSIZE, skip the call

Closes #19143

2 weeks agoopenssl: remove dead code
Daniel Stenberg [Sun, 19 Oct 2025 13:25:52 +0000 (15:25 +0200)] 
openssl: remove dead code

A condition in infof_certstack() would always equal true after a
previous change.

Follow-up to e2a4de8a607d3c7f52918ef50ab6411c75

Pointed out by Coverity
Closes #19142

2 weeks agorustls: exit on error
Daniel Stenberg [Sat, 18 Oct 2025 21:34:52 +0000 (23:34 +0200)] 
rustls: exit on error

In init_config_builder_verifier() the call to
rustls_root_cert_store_builder_build() set result on failure but did not
return.

Pointed out by ZeroPath
Closes #19125

2 weeks agotool_operate: return error on strdup() failure
Daniel Stenberg [Sun, 19 Oct 2025 14:12:56 +0000 (16:12 +0200)] 
tool_operate: return error on strdup() failure

In src/tool_operate.c inside the Windows safe-search branch (#ifdef
CURL_CA_SEARCH_SAFE), the code assigns config->cacert = strdup(cacert);
at line 2076 without checking whether strdup returned NULL.

This would allow the code to continue with the wrong value set, causing
possible confusion.

Pointed out by ZeroPath
Closes #19145

2 weeks agolib: add asserts that hostname has content
Daniel Stenberg [Sun, 19 Oct 2025 14:40:11 +0000 (16:40 +0200)] 
lib: add asserts that hostname has content

For all network related protocols there must be a non-blank hostname
used. This change adds a few asserts in some places to make debug/tests
catch mistakes if any such would slip in.

Closes #19146

2 weeks agoopenssl: fix unable do typo in failf() calls
Yedaya Katsman [Sun, 19 Oct 2025 18:26:17 +0000 (21:26 +0300)] 
openssl: fix unable do typo in failf() calls

Closes #19149

2 weeks agoGHA/windows: drop `git config core.autocrlf input` steps
Viktor Szakats [Sun, 19 Oct 2025 19:15:55 +0000 (21:15 +0200)] 
GHA/windows: drop `git config core.autocrlf input` steps

CI works without it now. For an inexplicable reason, this single `git`
command took 9 seconds per job, making this patch save more than
2 minutes per workflow run. It was also the only step using PowerShell.

Closes #19150

2 weeks agocurl_path: make sure just whitespace is illegal
Daniel Stenberg [Sun, 19 Oct 2025 13:06:39 +0000 (15:06 +0200)] 
curl_path: make sure just whitespace is illegal

This function could previously accidentally return true and a NULL path
if only whitespace was provided as argument.

Also, make it stricter and do not allow CR or LF within the string.

Use more strparse parsing.

Drop the comment saying this is from OpenSSH as it has now been
rewritten since then.

Closes #19141

2 weeks agocurl_get_line: enhance the API
Daniel Stenberg [Sun, 19 Oct 2025 11:09:42 +0000 (13:09 +0200)] 
curl_get_line: enhance the API

To make sure callers can properly differentiate between errors and know
cleanly when EOF happens. Updated all users and unit test 3200.

Triggered by a remark by ZeroPath

Closes #19140

2 weeks agolibssh: return the proper error for readdir problems
Daniel Stenberg [Sun, 19 Oct 2025 09:24:46 +0000 (11:24 +0200)] 
libssh: return the proper error for readdir problems

The code would return without setting sshc->actualcode or returning the
CURLcode error.

Reported by ZeroPath
Closes #19135

2 weeks agomod_curltest: tidy-ups and small fixes
Viktor Szakats [Mon, 13 Oct 2025 20:46:49 +0000 (22:46 +0200)] 
mod_curltest: tidy-ups and small fixes

- honor request id (`id=<number>`) in `curltest/put` and
  `curltest/sslinfo` handlers.
- do not truncate `max_upload` input parameter.
- delete unused variables.
- formatting.

Inspired by Joshua's report on tests.

Closes #19061

2 weeks agosmtp: return value ignored
Daniel Stenberg [Sun, 19 Oct 2025 09:28:15 +0000 (11:28 +0200)] 
smtp: return value ignored

Return value from Curl_client_write was overwritten by
smtp_perform_command making errors ignored.

Pointed out by ZeroPath

Closes #19136

2 weeks agoexamples: replace casts with `curl_off_t` printf masks
Viktor Szakats [Sun, 19 Oct 2025 08:53:16 +0000 (10:53 +0200)] 
examples: replace casts with `curl_off_t` printf masks

Follow-up to e4ec666a3d742202c06e76a97934f97f2bc7588c #19112

Closes #19133

2 weeks agosocks: avoid UAF risk in error path
Daniel Stenberg [Sun, 19 Oct 2025 10:17:45 +0000 (12:17 +0200)] 
socks: avoid UAF risk in error path

The code obtained a pointer resp via Curl_bufq_peek(), but called
Curl_bufq_skip() before it would access them in the failf() call.

The Curl_bufq_skip() call can trigger prune_head which may free or
recycle the chunk that resp points into.

Pointed out by ZeroPath
Closes #19139

2 weeks agoopenldap: fix limit max incoming size test logic
Jochen Sprickerhof [Sun, 19 Oct 2025 07:40:35 +0000 (09:40 +0200)] 
openldap: fix limit max incoming size test logic

Use LDAP_OPT_SUCCESS for ldap_get_option, as done in the other calls.
ber_sockbuf_ctrl returns 1 on success so reverse the logic.

Follow-up to f91be14bfb
Closes #19138

2 weeks agowolfssl: clear variable to avoid uninitialized use
Daniel Stenberg [Sat, 18 Oct 2025 21:41:26 +0000 (23:41 +0200)] 
wolfssl: clear variable to avoid uninitialized use

Pointed out by ZeroPath
Closes #19126

2 weeks agongtcp2: adopt ngtcp2_conn_get_stream_user_data if available
Tatsuhiro Tsujikawa [Sun, 19 Oct 2025 04:44:37 +0000 (13:44 +0900)] 
ngtcp2: adopt ngtcp2_conn_get_stream_user_data if available

Adopt ngtcp2_conn_get_stream_user_data which has been available since
ngtcp2 v1.17.0. This improves the time complexity of searching
h3_stream_ctx from O(n) to O(1) where n is the number of stream.

Closes #19132

2 weeks agoschannel: fix memory leak
Joshua Rogers [Sat, 18 Oct 2025 16:25:45 +0000 (00:25 +0800)] 
schannel: fix memory leak

- Do not leak memory on failed setting algorithm cipher list.

Discovered by ZeroPath.

- Do not free backend->cred after failed AcquireCredentialsHandle.

backend->cred is always freed later, during cleanup.

Closes https://github.com/curl/curl/pull/19118

2 weeks agoGHA/curl-for-win: update container image envs
Viktor Szakats [Sat, 18 Oct 2025 23:24:49 +0000 (01:24 +0200)] 
GHA/curl-for-win: update container image envs

Follow-up to https://github.com/curl/curl-for-win/commit/1f31ff06ad389f48059641ffb995af8261ba0233

Closes #19129

2 weeks agoexamples/chkspeed: portable printing when outputting curl_off_t values
JimFuller-RedHat [Sat, 18 Oct 2025 09:21:15 +0000 (11:21 +0200)] 
examples/chkspeed: portable printing when outputting curl_off_t values

Closes #19112

2 weeks agolib: remove newlines from failf() calls
Daniel Stenberg [Sat, 18 Oct 2025 20:33:46 +0000 (22:33 +0200)] 
lib: remove newlines from failf() calls

Closes #19124

2 weeks agotool_paramhlp: remove outdated comment in str2tls_max()
Daniel Stenberg [Sat, 18 Oct 2025 11:09:50 +0000 (13:09 +0200)] 
tool_paramhlp: remove outdated comment in str2tls_max()

The function does not take positive number as input. It takes TLS
version strings.

Pointed out by ZeroPath
Closes #19115

2 weeks agoopenldap: do not pass newline to infof()
Joshua Rogers [Sat, 18 Oct 2025 16:47:11 +0000 (00:47 +0800)] 
openldap: do not pass newline to infof()

Discovered by ZeroPath
Closes #19120

2 weeks agosrc/var: remove dead code
Joshua Rogers [Sat, 18 Oct 2025 16:42:52 +0000 (00:42 +0800)] 
src/var: remove dead code

Discovered by ZeroPath
Closes #19119

2 weeks agoldap: do not pass a \n to failf()
Joshua Rogers [Sat, 18 Oct 2025 18:00:52 +0000 (02:00 +0800)] 
ldap: do not pass a \n to failf()

Discovered by ZeroPath
Closes #19122

2 weeks agoschannel_verify: do not call infof with an appended \n
Joshua Rogers [Sat, 18 Oct 2025 18:37:18 +0000 (02:37 +0800)] 
schannel_verify: do not call infof with an appended \n

Discovered by ZeroPath
Closes #19123

2 weeks agocmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`)
Viktor Szakats [Sat, 18 Oct 2025 12:25:08 +0000 (14:25 +0200)] 
cmake: fix Linux pre-fill `HAVE_POSIX_STRERROR_R` (when `_CURL_PREFILL=ON`)

It depends on C library.

Follow-up to f30f1307c1d9d70a96557359f039ba7ef9b077fb #19116

2 weeks agocmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`)
Viktor Szakats [Sat, 18 Oct 2025 11:08:53 +0000 (13:08 +0200)] 
cmake: fix Linux pre-fills for non-glibc (when `_CURL_PREFILL=ON`)

- do not pre-fill `HAVE_LINUX_TCP_H` on Linux.
  `linux/tcp.h` is a Linux kernel userspace header. It's likely
  installed when using glibc and likely missing by default when using
  something else, e.g. MUSL (e.g. on Alpine).

  Therefore always detect it for Linux targets, and only pre-fill it for
  non-Linux ones.

- do not pre-fill `HAVE_GLIBC_STRERROR_R` on Linux.
  To fix it for non-glibc envs, e.g. MUSL (e.g. on Alpine).

Note, the pre-fill option is a disabled by default, internal option and
strongly not recommended outside of curl development.

Closes #19116

2 weeks agoopenssl: free UI_METHOD on exit path
Daniel Stenberg [Sat, 18 Oct 2025 10:11:09 +0000 (12:11 +0200)] 
openssl: free UI_METHOD on exit path

In providercheck(), when failing to open the "store", the exit path
would not previously free the created UI_METHOD and instead leak this
resource.

Pointed out by ZeroPath

Closes #19114

2 weeks agotool_formparse: rewrite the headers file parser
Daniel Stenberg [Sat, 18 Oct 2025 09:58:36 +0000 (11:58 +0200)] 
tool_formparse: rewrite the headers file parser

The -F option allows users to provide a file with a set of headers for a
specific formpost section. This code used old handcrafted parsing logic
that potentially could do wrong.

Rewrite to use my_get_line() and dynbuf. Supports longer lines and
should be more solid parsing code.

Gets somewhat complicated by the (unwise) feature that allows "folding"
of header lines in the file: if a line starts with a space it should be
appended to the previous.

The previous code trimmed spurious CR characters wherever they would
occur in a line but this version does not. It does not seem like
something we want or that users would expect.

Test 646 uses this feature.
Closes #19113

2 weeks agocurlx: promote `Curl_fseeko()` to `curlx_fseek()`, use it in `src`
Viktor Szakats [Fri, 17 Oct 2025 16:31:52 +0000 (18:31 +0200)] 
curlx: promote `Curl_fseeko()` to `curlx_fseek()`, use it in `src`

- tool_formparse: replace truncated `fseek` with `curlx_fseek`.
- tool_operate: replace truncated `fseek` with `curlx_fseek`.
- tool_paramhlp: replace local duplicate `myfseek`, with `curlx_fseek`.

Follow-up to 4fb12f289189e8113967e9c9da09958fd8bfa4cb #19100

Closes #19107

3 weeks agoopenssl: fix resource leak in provider error path
Daniel Stenberg [Fri, 17 Oct 2025 22:01:26 +0000 (00:01 +0200)] 
openssl: fix resource leak in provider error path

Pointed out by ZeroPath

Closes #19111

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 17 Oct 2025 21:39:16 +0000 (23:39 +0200)] 
RELEASE-NOTES: synced

3 weeks agowolfssl: fix resource leak in verify_pinned error paths
Daniel Stenberg [Fri, 17 Oct 2025 21:14:37 +0000 (23:14 +0200)] 
wolfssl: fix resource leak in verify_pinned error paths

Pointed out by ZeroPath

Closes #19110

3 weeks agombedtls: move the crypto init into the vtls init function
Daniel Stenberg [Fri, 17 Oct 2025 20:47:28 +0000 (22:47 +0200)] 
mbedtls: move the crypto init into the vtls init function

Follow-up to 3a305831d1a9d10b2bfd4fa3939

Closes #19108

3 weeks agocurl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY
Daniel Stenberg [Fri, 17 Oct 2025 15:55:15 +0000 (17:55 +0200)] 
curl.h: remove incorrect comment about CURLOPT_PINNEDPUBLICKEY

Bug: https://curl.se/mail/lib-2025-10/0018.html
Reported-by: curl.stunt430
Closes #19105

3 weeks agoINSTALL: update the list of known operating systems
Daniel Stenberg [Fri, 17 Oct 2025 16:23:11 +0000 (18:23 +0200)] 
INSTALL: update the list of known operating systems

curl has run on

Closes #19106

3 weeks agokrb5: fix `output_token` allocators in the GSS debug stub (Windows)
Viktor Szakats [Tue, 14 Oct 2025 15:43:48 +0000 (17:43 +0200)] 
krb5: fix `output_token` allocators in the GSS debug stub (Windows)

Before this patch system `malloc()`/`free()` were used to allocate
the buffer returned in the `output_token` object from the debug stub
of `gss_init_sec_context()` when enabled via `CURL_STUB_GSS_CREDS` in
debug-enabled libcurl builds. This object is later released via stock
`gss_release_buffer()`, which, in the Windows builds of MIT Kerberos,
doesn't use the system `free()`, but the Win32 `HeapFree()`.

Fix it by using the GSS alloc/free macros: `gssalloc_malloc()` and
`gssalloc_free()` from `gssapi_alloc.h`.

To make this work without MIT Kerberos feature detection, use a canary
macro to detect a version which installs `gssapi_alloc.h` for Windows.
For <1.15 (2016-11-30) releases, that do not install it, disable the GSS
debug stub in libcurl.

Strictly speaking, non-Windows builds would also need to use GSS
allocators, but, detecting support for `gssapi_alloc.h` is impossible
without build-level logic. Built-level logic is complex and overkill,
and MIT Kerberos, as of 1.22.1, uses standard malloc/free on
non-Windows platforms anyway. (except in GSS debug builds.)

Follow-up to 73840836a51c443e6b5d385014ce1c8f5be3e02b #17752

Closes #19064

3 weeks agoKNOWN_BUGS: SOCKS-SSPI discards the security context
Daniel Stenberg [Fri, 17 Oct 2025 14:54:57 +0000 (16:54 +0200)] 
KNOWN_BUGS: SOCKS-SSPI discards the security context

Also make the verbose log say it

Pointed out by ZeroPath

Closes #19103

3 weeks agorustls: make read_file_into not reject good files
Daniel Stenberg [Fri, 17 Oct 2025 15:05:08 +0000 (17:05 +0200)] 
rustls: make read_file_into not reject good files

For files with sizes using an exact multiple of 256 bytes, the final
successful read(s) filled the buffer(s) and the subsequent fread
returned 0 for EOF, which caused read_file_into to fail.

Now, it needs to return 0 and not be EOF to be an error.

Follow-up to dd95a49d493d55db38b352fdbda2

Pointed out by ZeroPath
Closes #19104

3 weeks agoGHA/curl-for-win: add minimal Linux build
Viktor Szakats [Fri, 17 Oct 2025 15:26:45 +0000 (17:26 +0200)] 
GHA/curl-for-win: add minimal Linux build

A bit more minimal build than the one used for trurl. To stress test
a build with most features disabled.

Costs 40 seconds, of which 6 is the build, rest is installing tools.

Ref: https://github.com/curl/curl-for-win/commit/5b385001d5f89886553cf83aa3f2f24476a865f4
Ref: https://github.com/curl/curl-for-win/commit/3ee10692c73a61522cabb3a4d2e94eb228249250

Follow-up to 5af2457848357141b3b3c67f7a45a4964ec25233 #17818

Closes #17961

3 weeks agoquic: improve UDP GRO receives
Stefan Eissing [Fri, 17 Oct 2025 11:50:49 +0000 (13:50 +0200)] 
quic: improve UDP GRO receives

Closes #19101

3 weeks agosocks_sspi: use the correct free function
Stefan Eissing [Mon, 13 Oct 2025 09:32:17 +0000 (11:32 +0200)] 
socks_sspi: use the correct free function

When freeing buffers allocated by SSPI, use its own function, not free().

Reported-by: Joshua Rogers
Closes #19046

3 weeks agosetopt: fix unused variable warning in minimal build
Viktor Szakats [Fri, 17 Oct 2025 13:52:15 +0000 (15:52 +0200)] 
setopt: fix unused variable warning in minimal build

Found via: #17961

Closes #19102

3 weeks agoGHA: update dependency ruff to v0.14.1
renovate[bot] [Thu, 16 Oct 2025 18:19:42 +0000 (18:19 +0000)] 
GHA: update dependency ruff to v0.14.1

Closes #19085

3 weeks agomime: fix use of fseek()
Daniel Stenberg [Fri, 17 Oct 2025 12:41:08 +0000 (14:41 +0200)] 
mime: fix use of fseek()

Avoid the possible 64-bit offset truncation when used on systems with
small 'long', like Windows.

bonus: make mime_open_file() return bool

Pointed out by ZeroPath
Closes #19100

3 weeks agocf-socket: if FD_CLOEXEC fails on accepted socket, cleanup
Daniel Stenberg [Fri, 17 Oct 2025 11:23:46 +0000 (13:23 +0200)] 
cf-socket: if FD_CLOEXEC fails on accepted socket, cleanup

Follow-up to 9d7b532404181568de1611084bd9f

Pointed out by ZeroPath

Closes #19098

3 weeks agoopenssl: avoid overwriting 'result' after error
Daniel Stenberg [Fri, 17 Oct 2025 12:27:58 +0000 (14:27 +0200)] 
openssl: avoid overwriting 'result' after error

Follow-up to eefd03c572996e5de4dec4fe295ad6f

Pointed out by ZeroPath https://zeropath.com/
Closes #19099

3 weeks agotool_ipfs: simplify the ipfs gateway logic
Daniel Stenberg [Fri, 17 Oct 2025 11:05:58 +0000 (13:05 +0200)] 
tool_ipfs: simplify the ipfs gateway logic

- make sure memory allocated by libcurl is freed with curl_free()

- drop the ensure_trailing_slash complexity

Closes #19097

3 weeks agoGHA: update ngtcp2/ngtcp2 to v1.17.0
renovate[bot] [Fri, 17 Oct 2025 08:41:40 +0000 (08:41 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.17.0

Closes #19092

3 weeks agoopenssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs
Daniel Stenberg [Fri, 17 Oct 2025 08:12:50 +0000 (10:12 +0200)] 
openssl: fail if more than MAX_ALLOWED_CERT_AMOUNT certs

Detect and prevent abuse or mistakes. Limit set to 100.

Closes #19091

3 weeks agongtcp2: add a comment explaining write result handling
Stefan Eissing [Fri, 17 Oct 2025 08:59:11 +0000 (10:59 +0200)] 
ngtcp2: add a comment explaining write result handling

The choice to continue processing incoming data although the
writeout of the headers/data failed is not obvious. Add a comment
explaining why this is done.

Closes #19093

3 weeks agotest_16: adjust timing expectations
Stefan Eissing [Fri, 17 Oct 2025 09:48:35 +0000 (11:48 +0200)] 
test_16: adjust timing expectations

In MOST protocols and runs, the 'pretransfer' time is less than the
'starttransfer'. E.g. request being sent before response comes in.

However, when curl is starved of cpu a server response might start
streaming in before the multi-state transitioned to DID (and recorded
the 'pretransfer' time).

Do no longer check that 'pretransfer' is less or equal 'starttransfer'.
Check that is is less or equal to the total time instead.

Closes #19096

3 weeks agoopenssl: better return code checks when logging cert data
Daniel Stenberg [Fri, 17 Oct 2025 09:18:49 +0000 (11:18 +0200)] 
openssl: better return code checks when logging cert data

Pointed out by ZeroPath

Closes #19094

3 weeks agorustls: limit snprintf proper in cr_keylog_log_cb()
Daniel Stenberg [Fri, 17 Oct 2025 09:24:36 +0000 (11:24 +0200)] 
rustls: limit snprintf proper in cr_keylog_log_cb()

It should limit the size to the size of the target array, not the
incoming data.

Pointed out by ZeroPath
Closes #19095

3 weeks agombedtls: add support for 4.0.0
Viktor Szakats [Wed, 15 Oct 2025 19:01:46 +0000 (21:01 +0200)] 
mbedtls: add support for 4.0.0

After this patch libcurl requires (as already documented)
the `curl_global_init()` call when using the `curl_formadd()` API with
mbedTLS.

Note: NTLM is not supported with mbedTLS 4+, because it lacks
the necessary crypto primitive: DES.

Also:
- lib: de-dupe mbedTLS minimum version checks into `curl_setup.h`.
- lib: initialize PSA Crypto as part of `curl_global_init()`.
  For MD5, SHA-256, `curl_formadd()`, and MultiSSL builds with mbedTLS
  but where mbedTLS isn't the default backend.
- lib1308: fix to call `curl_global_init()` (for the Form API).
- curl_ntlm_core: disable with mbedTLS 4+.
- md4: disable mbedTLS implementation when building against 4.x.
- md5: use mbedTLS PSA Crypto API when available, otherwise use
  the default local implementation.
- sha256: use mbedTLS PSA Crypto API when available, otherwise use
  the default local implementation.
- vtls/mbedtls: drop PSA Crypto initialization in favor of
  `curl_global_init()`.
- vtls/mbedtls: use PSA Crypto random API with all mbedTLS versions.
- vtls/mbedtls: do the same for the SHA-256 callback.
- autotools: detect mbedTLS 4+, and disable NTLM for 3.x.
- cmake: disable NTLM for mbedTLS 3.x.
- GHA/linux: keep building mbedTLS 3.x manually and use it in
  an existing job, while also enabling pytest in it.
- GHA/linux: bump to mbedTLS 4.0.0.
  Closes #19075
  Closes #19074

Refs:
https://github.com/Mbed-TLS/mbedtls/releases/tag/mbedtls-4.0.0
https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/docs/4.0-migration-guide.md
https://github.com/Mbed-TLS/mbedtls/blob/mbedtls-4.0.0/tf-psa-crypto/docs/1.0-migration-guide.md [404]
https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/1.0-migration-guide.md
https://github.com/Mbed-TLS/TF-PSA-Crypto/blob/tf-psa-crypto-1.0.0/docs/psa-transition.md
https://github.com/Mbed-TLS/TF-PSA-Crypto/tree/627f727bbed3d9319ed548f1c0839a29c223414e/docs/4.0-migration-guide

Closes #19077

3 weeks agoimap: treat capabilities case insensitively
Daniel Stenberg [Fri, 17 Oct 2025 07:58:20 +0000 (09:58 +0200)] 
imap: treat capabilities case insensitively

Reported-by: Joshua Rogers
Fixes #19089
Closes #19090

3 weeks agoexamples/websocket: fix use of uninitialized rlen
Daniel Stenberg [Fri, 17 Oct 2025 07:31:55 +0000 (09:31 +0200)] 
examples/websocket: fix use of uninitialized rlen

Pointed out by ZeroPath

Closes #19088

3 weeks agoopenldap: limit max incoming size
Daniel Stenberg [Thu, 16 Oct 2025 19:47:42 +0000 (21:47 +0200)] 
openldap: limit max incoming size

Set the maximum allowed size of an incoming LDAP message, which to
OpenLDAP means that it allows malloc() up to this size. If not set,
there is no limit and we instead risk a malloc() failure.

The limit is arbitrarily set to 256K as I can't figure out what a
reasonable value should be.

OpenLDAP docs: https://openldap.org/software/man.cgi?query=lber-sockbuf&apropos=0&sektion=0&manpath=OpenLDAP+2.6-Release&arch=default&format=html

Bug: https://issues.oss-fuzz.com/issues/432441303
Closes #19087

3 weeks agofirefox-db2pem.sh: add macOS support, tidy-ups
Viktor Szakats [Wed, 15 Oct 2025 17:46:35 +0000 (19:46 +0200)] 
firefox-db2pem.sh: add macOS support, tidy-ups

Cherry-picked from #19076
Closes #19086

3 weeks agoscripts: pass `--` before passing xargs
Viktor Szakats [Wed, 15 Oct 2025 17:45:48 +0000 (19:45 +0200)] 
scripts: pass `--` before passing xargs

Also:
- GHA/checkdocs: escape `.` in -E regex expression.

Closes #19076

3 weeks agoGHA: sync up `curl -V` step descriptions
Viktor Szakats [Wed, 15 Oct 2025 18:22:20 +0000 (20:22 +0200)] 
GHA: sync up `curl -V` step descriptions

Also to make it easier to recognize.

Also:
- GHA/linux-old: split steps to match other jobs.
- GHA: add `--disable` where missing.

Closes #19084

3 weeks agoGHA/windows: stop installing Perl `Win32-Process*` modules
Viktor Szakats [Thu, 16 Oct 2025 16:10:41 +0000 (18:10 +0200)] 
GHA/windows: stop installing Perl `Win32-Process*` modules

It's complex and did not help stabilizing CI runs.

Hard to say, but I'm suspicious it's related to the CI errors
-1073741502, 0xC0000142, seen in the 'build examples' and
'disk space used' steps.

Ref: #18526
Reverts 52775a7fb4ba63d66d60067dea4a5293fb7c55a1 #18296
Closes #19083

3 weeks agoGHA: bump LibreSSL to 4.2.0
Viktor Szakats [Thu, 16 Oct 2025 14:29:56 +0000 (16:29 +0200)] 
GHA: bump LibreSSL to 4.2.0

Also move back URLs to GitHub, sources are available there again.

Ref: https://github.com/libressl/portable/releases/tag/v4.2.0
Ref: https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-4.2.0-relnotes.txt
Ref: #19050
Ref: #19081

Closes #19082

3 weeks agoversion: add GSS backend name and version
Viktor Szakats [Wed, 15 Oct 2025 13:06:08 +0000 (15:06 +0200)] 
version: add GSS backend name and version

MIT Kerberos version detection is implemented for autotools and cmake.

Examples:
```
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... mbedTLS/3.6.4 libidn2/2.3.7 nghttp2/1.59.0 libgss/1.0.4 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 libidn2/2.3.7 nghttp2/1.59.0 mit-krb5 OpenLDAP/2.6.7
curl 8.17.0-DEV (x86_64-pc-linux-gnu) ... LibreSSL/4.1.1 nghttp2/1.59.0 mit-krb5/1.20.1 OpenLDAP/2.6.7
curl 8.17.0-DEV (aarch64e-apple-darwin24.6.0) ... GnuTLS/3.8.10 libidn2/2.3.8 libssh2/1.11.1 nghttp2/1.67.1 mit-krb5/1.22.1
```

Also:
- cmake/FindGSS: strip project name ("Kerberos 5 release") from
  the version string when detected via `krb5-config`.

Closes #19073

3 weeks agoautotools: drop detection of ancient OpenSSL libs `RSAglue` and `rsaref`
Viktor Szakats [Thu, 16 Oct 2025 03:33:12 +0000 (05:33 +0200)] 
autotools: drop detection of ancient OpenSSL libs `RSAglue` and `rsaref`

Closes #19078

3 weeks agoapple sectrust: add to features
Stefan Eissing [Tue, 14 Oct 2025 10:13:24 +0000 (12:13 +0200)] 
apple sectrust: add to features

It should be visible in the feature list that libcurl is build with
Apple SecTrust enabled.

Closes #19057

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 16 Oct 2025 07:01:17 +0000 (09:01 +0200)] 
RELEASE-NOTES: synced

3 weeks agoconnect: remove redundant condition in shutdown start
Daniel Stenberg [Thu, 16 Oct 2025 06:32:57 +0000 (08:32 +0200)] 
connect: remove redundant condition in shutdown start

Pointed out by CodeSonar

Closes #19079