]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 weeks agoHTTP3: clarify the status for "old" OpenSSL, not current bagder/HTTP3-old-ossl 19153/head
Daniel Stenberg [Mon, 20 Oct 2025 06:47:43 +0000 (08:47 +0200)] 
HTTP3: clarify the status for "old" OpenSSL, not current

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

2 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

3 weeks agourldata: make redirect counter 16 bit
Daniel Stenberg [Wed, 15 Oct 2025 08:56:47 +0000 (10:56 +0200)] 
urldata: make redirect counter 16 bit

Instead of long (up to 64-bit) as the maximum allowed value set since
b059f7deaf3 is 0x7fff. Saves 2 or 6 bytes.

Closes #19072

3 weeks agourldata: make 'retrycount' a single byte
Daniel Stenberg [Wed, 15 Oct 2025 08:48:42 +0000 (10:48 +0200)] 
urldata: make 'retrycount' a single byte

Since it only counts up to 5

Closes #19071

3 weeks agolib: stop NULL-checking conn->passwd and ->user
Daniel Stenberg [Tue, 14 Oct 2025 12:43:46 +0000 (14:43 +0200)] 
lib: stop NULL-checking conn->passwd and ->user

They always point to a string. The string might be zero length.

Closes #19059

3 weeks agotransfer: reset retry count on each request
Emre Çalışkan [Tue, 14 Oct 2025 18:35:54 +0000 (21:35 +0300)] 
transfer: reset retry count on each request

Reported-by: plv1313 on github
Fixes #18926
Closes #19066

3 weeks agoquic: remove data_idle handling
Stefan Eissing [Tue, 14 Oct 2025 13:53:37 +0000 (15:53 +0200)] 
quic: remove data_idle handling

The transfer loop used to check the socket and if no poll events
were seen, triggered a "DATA_IDLE" event into the filters to let
them schedule times/do things anyway.

Since we no longer check the socket, the filters have been called
already and the DATA_IDLE event is unnecessary work. Remove it.

Closes #19060

3 weeks agotftp: check for trailing ";mode=" in URL without strstr
Daniel Stenberg [Wed, 15 Oct 2025 06:42:20 +0000 (08:42 +0200)] 
tftp: check for trailing ";mode=" in URL without strstr

RFC 3617 defines two specific modes, "netascii" and "octet". This code
now checks only for those trailing ones - and not in the hostname since
they can't be there anymore.

Assisted-by: Jay Satiro
Closes #19070

3 weeks agoftp: replace strstr() in ;type= handling
Daniel Stenberg [Wed, 15 Oct 2025 06:27:48 +0000 (08:27 +0200)] 
ftp: replace strstr() in ;type= handling

Since it needs to be a trailing piece of the path avoiding strstr() is
faster and more reliable.

Also stopped checking the host name since it cannot actually be there
since quite a long while back. The URL parser doesn't allow such a
hostname.

Moved the check into its own subfunction too.

Closes #19069

3 weeks agolib: reduce use of data->conn->
Daniel Stenberg [Tue, 14 Oct 2025 15:40:18 +0000 (17:40 +0200)] 
lib: reduce use of data->conn->

If there are more than two of them in a function, use a local 'conn'
variable instead.

Closes #19063

3 weeks agohttp: look for trailing 'type=' in ftp:// without strstr
Daniel Stenberg [Tue, 14 Oct 2025 16:08:27 +0000 (18:08 +0200)] 
http: look for trailing 'type=' in ftp:// without strstr

- it could find a wrong string
- this is faster

Closes #19065

3 weeks agows: fix type conversion check
Jay Satiro [Sun, 12 Oct 2025 22:35:22 +0000 (18:35 -0400)] 
ws: fix type conversion check

- Fix logic that checks whether a size_t will fit in a curl_off_t.

Reported-by: Viktor Szakats
Fixes https://github.com/curl/curl/issues/19017
Closes https://github.com/curl/curl/pull/19036

3 weeks agotool_operate: retry on HTTP response codes 522 and 524
Jay Satiro [Fri, 10 Oct 2025 19:42:27 +0000 (15:42 -0400)] 
tool_operate: retry on HTTP response codes 522 and 524

- Treat HTTP response codes 522 and 524 as a transient error since
  Cloudflare may use them instead of 504 to signal timeout.

For example here is a 522 error message from Cloudflare:

"The initial connection between Cloudflare's network and the origin web
server timed out. As a result, the web page can not be displayed."

Prior to this change the curl tool did not retry on HTTP response codes
522 and 524 when --retry was used.

Fixes https://github.com/curl/curl/discussions/16143
Closes https://github.com/curl/curl/pull/19011

3 weeks agoexamples: check more errors, fix cleanups, scope variables
Viktor Szakats [Mon, 13 Oct 2025 20:57:01 +0000 (22:57 +0200)] 
examples: check more errors, fix cleanups, scope variables

Inspired by Joshua's report on examples.

Closes #19055

3 weeks agoopenldap: explain a const removing typecast
Daniel Stenberg [Tue, 14 Oct 2025 08:49:53 +0000 (10:49 +0200)] 
openldap: explain a const removing typecast

Closes #19056

3 weeks agoscorecard: add perf support on linux
Stefan Eissing [Tue, 14 Oct 2025 12:39:50 +0000 (14:39 +0200)] 
scorecard: add perf support on linux

When calling scorecard with --flame to produce a flamegraph, use
"perf" on linux platforms to do the measurements. Update the scorecard
documentation about it.

Closes #19058

3 weeks agoexamples: improve global init, error checks and returning errors
Viktor Szakats [Mon, 13 Oct 2025 14:30:18 +0000 (16:30 +0200)] 
examples: improve global init, error checks and returning errors

- add `curl_global_init()` and `curl_global_cleanup()` where missing.
- check the result of `curl_global_init()` where missing.
- return the last curl error from `main()`.
- drop Win32-specific socket initialization in favor of `curl_global_init()`.
- rename some outliers to `res` for curl result code.
- fix cleanup in some error cases.

Inspired by Joshua's report on examples.

Closes #19053

3 weeks agoexamples: return `curl_easy_perform()` results
Viktor Szakats [Mon, 13 Oct 2025 14:18:40 +0000 (16:18 +0200)] 
examples: return `curl_easy_perform()` results

Where missing. Or explicitly `(void)` it where we ignore it on purpose.

Reported-by: Joshua Rogers (for `sepheaders.c`)
Closes #19052

3 weeks agoexamples: call `curl_global_cleanup()` where missing
Viktor Szakats [Mon, 13 Oct 2025 14:08:42 +0000 (16:08 +0200)] 
examples: call `curl_global_cleanup()` where missing

Reported-by: Joshua Rogers (for `sepheaders.c`)
Closes #19051

3 weeks agochecksrc: allow disabling warnings on FIXME/TODO comments
Viktor Szakats [Mon, 13 Oct 2025 11:44:23 +0000 (13:44 +0200)] 
checksrc: allow disabling warnings on FIXME/TODO comments

Follow-up to 71ace9f3c16a434385fc27b3e8bffb52deb6ccd1

Closes #19048

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 13 Oct 2025 14:03:46 +0000 (16:03 +0200)] 
RELEASE-NOTES: synced

3 weeks agolibssh2: avoid risking using an uninitialized local struct field
Daniel Stenberg [Mon, 13 Oct 2025 07:40:38 +0000 (09:40 +0200)] 
libssh2: avoid risking using an uninitialized local struct field

Reported-by: Joshua Rogers
Closes #19043

3 weeks agolibssh: catch a resume point larger than the size
Daniel Stenberg [Mon, 13 Oct 2025 07:45:28 +0000 (09:45 +0200)] 
libssh: catch a resume point larger than the size

As it would otherwise trigger broken math

Reported-by: Joshua Rogers
Closes #19044

3 weeks agoREUSE: move copyright headers to `.checksrc`
Viktor Szakats [Sat, 11 Oct 2025 08:48:23 +0000 (10:48 +0200)] 
REUSE: move copyright headers to `.checksrc`

To make it simpler to move them around, create and delete them without
syncing with `REUSE.toml`.

Also:
- checksrc: allow empty lines in `.checksrc`.
- comment on why curl printfs are disallowed in examples.

Closes #19024

3 weeks agolibssh2: fix EAGAIN return in ssh_state_auth_agent
Daniel Stenberg [Mon, 13 Oct 2025 07:36:08 +0000 (09:36 +0200)] 
libssh2: fix EAGAIN return in ssh_state_auth_agent

Reported-by: Joshua Rogers
Closes #19042

3 weeks agosocks_sspi: remove the enforced mode clearing
Daniel Stenberg [Mon, 13 Oct 2025 07:24:57 +0000 (09:24 +0200)] 
socks_sspi: remove the enforced mode clearing

Reported-by: Joshua Rogers
Closes #19040

3 weeks agopop3: function could get the ->transfer field wrong
Daniel Stenberg [Mon, 13 Oct 2025 06:41:38 +0000 (08:41 +0200)] 
pop3: function could get the ->transfer field wrong

In pop3_perform(), pop3->transfer was derived from the old
data->req.no_body. Then, pop3_perform_command() re-computed
data->req.no_body.

Now we instead call pop3_perform_command() first.

Reported-by: Joshua Rogers
Closes #19039

3 weeks agotool_getparam: make --fail and --fail-with-body override each other
Daniel Stenberg [Sun, 12 Oct 2025 13:58:43 +0000 (15:58 +0200)] 
tool_getparam: make --fail and --fail-with-body override each other

This allows users to put one of them in their .curlrc and still easily
use the other one at will in command lines.

The --no-* versions disable both of them.

Reported-by: Mitchell Blank Jr
Fixes #19029
Closes #19034

3 weeks agotool_msgs: make errorf() show if --show-error
Daniel Stenberg [Sun, 12 Oct 2025 21:48:14 +0000 (23:48 +0200)] 
tool_msgs: make errorf() show if --show-error

Assisted-by: Mitchell Blank Jr
Ref: #19029
Closes #19035

3 weeks agoKNOWN_BUGS: We do not support auth-int for Digest using PUT or POST
Daniel Stenberg [Mon, 13 Oct 2025 06:27:01 +0000 (08:27 +0200)] 
KNOWN_BUGS: We do not support auth-int for Digest using PUT or POST

Closes #19038

3 weeks agotftp: error requests for blank filenames
Daniel Stenberg [Sun, 12 Oct 2025 09:38:39 +0000 (11:38 +0200)] 
tftp: error requests for blank filenames

Reported-by: Joshua Rogers
Closes #19033