]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
10 days agofixup simplify the url parser more bagder/smtp-strparse 19270/head
Daniel Stenberg [Tue, 28 Oct 2025 15:19:10 +0000 (16:19 +0100)] 
fixup simplify the url parser more

10 days agosmtp: use strparse functions for parsing
Daniel Stenberg [Tue, 28 Oct 2025 15:02:06 +0000 (16:02 +0100)] 
smtp: use strparse functions for parsing

10 days agoCurl_resolv: explicitly set *entry to NULL at the top
x2018 [Tue, 28 Oct 2025 05:16:36 +0000 (13:16 +0800)] 
Curl_resolv: explicitly set *entry to NULL at the top

Closes #19263

10 days agosingleuse.pl: fix string warning
Daniel Stenberg [Tue, 28 Oct 2025 08:37:39 +0000 (09:37 +0100)] 
singleuse.pl: fix string warning

"Use of uninitialized value $unittests in concatenation on line 170"

Closes #19266

10 days agotests/server/dnsd: fix potential buffer overflow
Viktor Szakats [Mon, 27 Oct 2025 18:23:37 +0000 (19:23 +0100)] 
tests/server/dnsd: fix potential buffer overflow

When handling incoming DNS packets.

Reported-by: Joshua Rogers
Closes #19261

11 days agoheader: see-also --proxy-header and vice versa
Daniel Stenberg [Mon, 27 Oct 2025 15:40:52 +0000 (16:40 +0100)] 
header: see-also --proxy-header and vice versa

Closes #19259

11 days agoCURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also
Daniel Stenberg [Mon, 27 Oct 2025 15:37:03 +0000 (16:37 +0100)] 
CURLOPT_SERVER_RESPONSE_TIMEOUT*: add default and see-also

Also move the old name mention to a HISTORY section

Closes #19258

11 days agoTLS: IP address verification, extend test
Stefan Eissing [Mon, 27 Oct 2025 11:16:59 +0000 (12:16 +0100)] 
TLS: IP address verification, extend test

Change the test certificate to carry a altname 'dns:127.0.0.1' which
should *not* match in test_17_05_bad_ip_addr.

wolfSSL: since `wolfSSL_check_domain_name()` does not differentiate
between DNS and IP names, use if only for DNS names. For IP addresses,
get the peer certificate after the handshake and check that using
wolfSSL_X509_check_ip_asc().

Unfortunately, this succeeds where it should not, as wolfSSL internally
used the same check code for both cases. So, skip the test case until
wolfSSL fixes that.

Reported-by: Joshua Rogers
Closes #19252

11 days agopingpong: change repsonse timeout to one minute
Daniel Stenberg [Mon, 27 Oct 2025 13:16:26 +0000 (14:16 +0100)] 
pingpong: change repsonse timeout to one minute

It was previously two minutes by default and sometimes one minute.
Removes a struct field.

Closes #19254

11 days agosocks: properly maintain the status of 'done'
x2018 [Mon, 27 Oct 2025 14:29:38 +0000 (22:29 +0800)] 
socks: properly maintain the status of 'done'

Closes #19255

11 days agotest1802: test --proxy-headers and --headers setting user-agent
Daniel Stenberg [Sat, 25 Oct 2025 16:58:49 +0000 (18:58 +0200)] 
test1802: test --proxy-headers and --headers setting user-agent

11 days agohttp_proxy: fix adding custom proxy headers
Daniel Stenberg [Sat, 25 Oct 2025 16:48:36 +0000 (18:48 +0200)] 
http_proxy: fix adding custom proxy headers

Reported-by: Joshua Rogers
Fixes #19227
Closes #19239

11 days agowcurl: sync to +dev snapshot
Samuel Henrique [Sun, 26 Oct 2025 17:34:46 +0000 (17:34 +0000)] 
wcurl: sync to +dev snapshot

Closes #19247

11 days agoGHA/linux: make OpenLDAP local build smaller
Viktor Szakats [Mon, 27 Oct 2025 06:02:39 +0000 (07:02 +0100)] 
GHA/linux: make OpenLDAP local build smaller

By disabling its `slapd` component, that's not needed for curl.

Cache size: 2.7 -> 1.7 MB

Also merge two `make` invocations.

Closes #19250

12 days agopop3: fix CAPA response termination detection
TheBitBrine [Sun, 26 Oct 2025 03:15:07 +0000 (03:15 +0000)] 
pop3: fix CAPA response termination detection

The code was checking if a line starts with '.', which would
incorrectly match capability names starting with dots. Per RFC 2449,
the terminator must be a line containing only a single dot.

RFC 2449 also explicitly excludes '.' from valid capability name
starting characters, so this is purely theoretical, but the code
should match the spec.

Changed to check for exact match: line length of 3 with '.\r' or
length 2 with '.\n' to handle both CRLF and LF-only servers.

(Mistake detected with ZeroPath)

Fixes #19228
Reported-by: Joshua Rogers
Closes #19245

12 days agotest776: set as 'flaky'
Daniel Stenberg [Sat, 25 Oct 2025 20:28:01 +0000 (22:28 +0200)] 
test776: set as 'flaky'

I have not figured out why, but having this test failing in CI every so often
is disturbing.

Reported-by: Viktor Szakatas
Fixes #19235
Closes #19243

12 days agosocks_gssapi: also reset buffer length after free
Viktor Szakats [Mon, 20 Oct 2025 20:23:39 +0000 (22:23 +0200)] 
socks_gssapi: also reset buffer length after free

To mimic this behavior of the previously used `gss_release_buffer()`.

Some or all of these zero assignments may be redundant.

Follow-up to e7818999dbeff5acb00c032860d2259a1c5f9c5b #19018

Closes #19167

12 days agoECH.md: make OpenSSL branch clone instructions work
Viktor Szakats [Sat, 25 Oct 2025 08:45:39 +0000 (10:45 +0200)] 
ECH.md: make OpenSSL branch clone instructions work

Closes #19237

13 days agoGHA: update nghttp2/nghttp2 to v1.68.0
renovate[bot] [Sat, 25 Oct 2025 09:42:00 +0000 (09:42 +0000)] 
GHA: update nghttp2/nghttp2 to v1.68.0

Closes #19238

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 25 Oct 2025 15:55:58 +0000 (17:55 +0200)] 
RELEASE-NOTES: synced

13 days agoschannel: lower the maximum allowed time to block to 7 seconds
Daniel Stenberg [Thu, 23 Oct 2025 14:25:24 +0000 (16:25 +0200)] 
schannel: lower the maximum allowed time to block to 7 seconds

During TLS renegotiation, the schannel_recv_renegotiate() function is
allowed to block for a short while. Reduce the maximum allowed time to
block from 10 minutes down to 7 seconds.

Closes #19205

13 days agoGHA/windows: delete MSYS2 ARM64 workaround
Viktor Szakats [Fri, 24 Oct 2025 21:21:27 +0000 (23:21 +0200)] 
GHA/windows: delete MSYS2 ARM64 workaround

Follow-up to 5249b99a70be6d5689092e3cbe1f938e98124569 #18438
Follow-up to c4e776cafa22533fe8a6113a39f6a9f624e8c467 #17103

Closes #19234

13 days agoGHA: bump GitHub artifact Actions
renovate[bot] [Fri, 24 Oct 2025 20:56:14 +0000 (20:56 +0000)] 
GHA: bump GitHub artifact Actions

- actions/download-artifact: v5.0.0 -> v6.0.0
- actions/upload-artifact: v4.6.2 -> v5.0.0

Closes #19232

13 days agolib: delete unused header includes
Viktor Szakats [Fri, 24 Oct 2025 17:21:18 +0000 (19:21 +0200)] 
lib: delete unused header includes

`escape.h`, `getinfo.h`, `strdup.h`.

Tested OK with full non-unity CI run.

Closes #19231

13 days agotidy-up: miscellaneous
Viktor Szakats [Tue, 7 Oct 2025 10:49:02 +0000 (12:49 +0200)] 
tidy-up: miscellaneous

- cmake/Find*: make double quotes consistent.
- drop redundant parenthesis.
- GHA/checksrc: sync a step name with others.
- whitespace.

Closes #19233

13 days agocurl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang
Viktor Szakats [Fri, 24 Oct 2025 19:12:37 +0000 (21:12 +0200)] 
curl_ngtcp2: fix `-Wunreachable-code` with H3 !verbose !unity clang

Not tested in default CI.

macOS / CM clang OpenSSL gsasl rtmp AppleIDN SecTrust +examples,
macOS / CM llvm@18 OpenSSL gsasl rtmp AppleIDN SecTrust +examples:
```
lib/vquic/curl_ngtcp2.c:530:5: error: code will never be executed [-Werror,-Wunreachable-code]
  530 |     const ngtcp2_transport_params *rp;
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
Ref: https://github.com/curl/curl/actions/runs/18787154442/job/53608230871?pr=19225#step:11:183

Confirmed fixed via #19225
Closes #19226

13 days agolib: delete unused crypto header includes
Viktor Szakats [Fri, 24 Oct 2025 16:46:50 +0000 (18:46 +0200)] 
lib: delete unused crypto header includes

Tested OK with full non-unity CI run.

Closes #19225

13 days agoautotools: merge `if`s in GnuTLS/OpenSSL feature detection
Viktor Szakats [Fri, 24 Oct 2025 16:03:52 +0000 (18:03 +0200)] 
autotools: merge `if`s in GnuTLS/OpenSSL feature detection

Closes #19222

2 weeks agovtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition
Viktor Szakats [Fri, 24 Oct 2025 16:41:20 +0000 (18:41 +0200)] 
vtls: drop duplicate `CURL_SHA256_DIGEST_LENGTH` definition

Closes #19224

2 weeks agombedtls: fix building with sha-256 missing from PSA
Viktor Szakats [Fri, 24 Oct 2025 16:34:35 +0000 (18:34 +0200)] 
mbedtls: fix building with sha-256 missing from PSA

Fixing:
```
lib/vtls/mbedtls.c:1505:10: error: call to undeclared function 'Curl_sha256it'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 1505 |   return Curl_sha256it(sha256sum, input, inputlen);
      |          ^
1 error generated.
```

with mbedTLS configuration:
```
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_SHA_256
tf-psa-crypto/scripts/config.py unset PSA_WANT_ALG_TLS12_ECJPAKE_TO_PMS
tf-psa-crypto/scripts/config.py unset MBEDTLS_LMS_C
```

Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077

Closes #19223

2 weeks agoGHA/dependabot: group updates
Viktor Szakats [Fri, 24 Oct 2025 12:57:52 +0000 (14:57 +0200)] 
GHA/dependabot: group updates

To avoid update spam and PR that can't be applied on top of each other.

Ref: #19217 #19218 #19219

Closes #19220

2 weeks agoGHA: bump pips
dependabot[bot] [Fri, 24 Oct 2025 12:02:18 +0000 (12:02 +0000)] 
GHA: bump pips

- cryptography from 46.0.2 to 46.0.3 in /tests
- filelock from 3.19.1 to 3.20.0 in /tests
- psutil from 7.1.0 to 7.1.1 in /tests

Closes #19217
Closes #19218
Closes #19219

2 weeks agoGHA/checksrc: extend zizmor to Dependabot, set cooldown periods
Viktor Szakats [Fri, 24 Oct 2025 11:49:51 +0000 (13:49 +0200)] 
GHA/checksrc: extend zizmor to Dependabot, set cooldown periods

Closes #19216

2 weeks agoGHA/fuzz: try fixing concurrency group deadlock
Viktor Szakats [Fri, 24 Oct 2025 11:44:44 +0000 (13:44 +0200)] 
GHA/fuzz: try fixing concurrency group deadlock

```
Fuzzer
Canceling since a deadlock was detected for concurrency group:
'Fuzzer-82fa9862dfa3083d4014d6dcfb721a7278e66f0b' between a top level workflow and 'Fuzzing'
```
https://github.com/curl/curl/actions/runs/18778617351

Follow-up to 82fa9862dfa3083d4014d6dcfb721a7278e66f0b #19215

2 weeks agoGHA: set `concurrency:` where missing
Viktor Szakats [Fri, 24 Oct 2025 11:02:55 +0000 (13:02 +0200)] 
GHA: set `concurrency:` where missing

To silence zizmor 1.16.0 warnings.

Also:
- http3-linux: replace hard-coded workflow name with variable.
  Follow-up to a8174176b5425c5692b55b78e40aef3a2331155f #13841
- codeql: set `cancel-in-progress: true`.
  zizmor apparently does not allow `false` in pedantic mode anymore:
  https://github.com/zizmorcore/zizmor/pull/1227
- codeql: sync concurrency setting with the rest of the jobs.
  (I'm not sure this is correct, or why it was previously special-cased.)

Expressions used (before and after this patch):
- `group: ${{ github.workflow }}-${{ github.event.sha }}-${{ github.event.target_url }}`
  for GHA/appveyor-status.
- `group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}`
  for all the rest.

Ref: https://github.com/curl/curl/actions/runs/18776245057/job/53571438139?pr=19209

Closes #19215

2 weeks agodes: merge curl_des into `curl_ntlm_core.c`
Viktor Szakats [Fri, 24 Oct 2025 00:28:46 +0000 (02:28 +0200)] 
des: merge curl_des into `curl_ntlm_core.c`

`curl_des.c` contained a single, short, function
`Curl_des_set_odd_parity()`, called from `curl_ntlm_core.c` alone.

Move it there, and define it only when needed.

Follow-up to 300876a7a62ff598c3be359e45a00b79cf9944ad
Follow-up to 8cc70db2db5f58e519a1bdfed266ca6514013145

Closes #19209

2 weeks agoNTLM: disable if DES support missing from OpenSSL or mbedTLS
Viktor Szakats [Thu, 23 Oct 2025 20:08:53 +0000 (22:08 +0200)] 
NTLM: disable if DES support missing from OpenSSL or mbedTLS

Make autotools and cmake detect DES support in OpenSSL and mbedTLS.
Forward feature macros to C and omit NTLM from the feature preview list.
Use the feature macros in source. This ensure that `-V` output matches
the preview.

OpenSSL doesn't support DES when built with `no-des` or `no-deprecated`.
mbedTLS 4.x no longer supports it, and it's possible to disable it in
<4 with `scripts/config.py unset MBEDTLS_DES_C`.

Before this patch this worked for
mbedTLS 4 only, and with a regression for pending PR #16973.

Also:

- drop NTLM feature check from `curl_setup.h` in favour of autotools/
  cmake feature macros. This makes `curl_setup.h` no longer need
  to include an mbedTLS header, which in turn makes tests/server build
  without depending on mbedTLS.
  Fixing, in #16973:
  ```
  In file included from tests/server/first.h:40,
                   from bld/tests/server/servers.c:3:
  lib/curl_setup.h:741:10: fatal error: mbedtls/version.h: No such file or directory
    741 | #include <mbedtls/version.h>
        |          ^~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/18689537893/job/53291322012?pr=16973
  Ref: #19181 (initial fix idea)
  Follow-up to 3a305831d1a9d10b2bfd4fa3939ed41275fee7f7 #19077

- move back mbedTLS header include and version check from
  `curl_setup.h` to each source which consumes mbedTLS.

- GHA/http3-linux: drop workaround that disabled NTLM for
  `no-deprecated` OpenSSL builds.
  Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384

- curl_ntlm_core: drop pointless macro `CURL_NTLM_NOT_SUPPORTED`.
  Follow-up to 006977859dcc4b8670878bd669276d778a2715bb #12384

Closes #19206

2 weeks agombedtls: fix building with <3.6.1
Viktor Szakats [Thu, 23 Oct 2025 22:55:37 +0000 (00:55 +0200)] 
mbedtls: fix building with <3.6.1

```
lib/vtls/mbedtls.c:786:3: error: call to undeclared function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  786 |   mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config,
      |   ^
lib/vtls/mbedtls.c:787:5: error: use of undeclared identifier 'MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED'; did you mean 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH'?
  787 |     MBEDTLS_SSL_TLS1_3_SIGNAL_NEW_SESSION_TICKETS_ENABLED);
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH
dep/mbedtls-3.4.0/_pkg/include/mbedtls/ssl.h:700:5: note: 'MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH' declared here
  700 |     MBEDTLS_SSL_TLS1_3_NEW_SESSION_TICKET_FLUSH,
      |     ^
2 errors generated.
```

Regression from d63e40f8e6298efaabae57c714ef8df57c54474d #18271 (8.16.0)

Closes #19208

2 weeks agoTODO: a fixed FTP directory listing format
Daniel Stenberg [Fri, 24 Oct 2025 07:22:40 +0000 (09:22 +0200)] 
TODO: a fixed FTP directory listing format

Closes #19212

2 weeks agocfilters: check return code from Curl_pollset_set_out_only()
Daniel Stenberg [Fri, 24 Oct 2025 06:55:01 +0000 (08:55 +0200)] 
cfilters: check return code from Curl_pollset_set_out_only()

I added WARN_UNUSED_RESULT to two of the cfilter functions to make this
mistake harder to slip in next time.

Pointed out by CodeSonar

Closes #19211

2 weeks agotool_cfgable: remove superfluous free calls
Dalei [Fri, 24 Oct 2025 08:02:47 +0000 (08:02 +0000)] 
tool_cfgable: remove superfluous free calls

Fixes #19213
Closes #19214

2 weeks agoconnect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply
Daniel Stenberg [Thu, 23 Oct 2025 14:20:01 +0000 (16:20 +0200)] 
connect: for CONNECT_ONLY, CURLOPT_TIMEOUT does not apply

Since using CONNECT_ONLY is by defintion only a connect, we make the
timeleft function return 0 after the connection is done so that it does
not - surprisingly - timeout later.

Fixes #18991
Reported-by: Pavel P
Closes #19204

2 weeks agoschannel: replace a run-time condition with an assert
Daniel Stenberg [Thu, 23 Oct 2025 14:00:46 +0000 (16:00 +0200)] 
schannel: replace a run-time condition with an assert

For detecting a bad function argument that probably also would cause a
compiler warning.

Closes #19203

2 weeks agomd4: drop mbedtls implementation (not available in mbedtls v3+)
Viktor Szakats [Thu, 23 Oct 2025 13:10:30 +0000 (15:10 +0200)] 
md4: drop mbedtls implementation (not available in mbedtls v3+)

Follow-up to 01a2308236ffd4a13a45c3d9850a66a602839af6 #18254

Closes #19202

2 weeks agohttp: only accept ';' as a separator for custom headers
Daniel Stenberg [Thu, 23 Oct 2025 09:16:03 +0000 (11:16 +0200)] 
http: only accept ';' as a separator for custom headers

When parsing incoming headers, they need to have a plain normal colon.

Previously out of convenience we used the same parser function for both
cases (incoming + custom set headers via the API) which made the
function too liberal for incoming HTTP traffic.

Closes #19200

2 weeks agovtls: remove call to PKCS12_PBE_add()
Theo Buehler [Thu, 23 Oct 2025 11:12:48 +0000 (13:12 +0200)] 
vtls: remove call to PKCS12_PBE_add()

Curl is one of the last callers of PKCS12_PBE_add(). It has been a noop
since OpenSSL 0.9.8k (2006) stubbed it out when moving the built-in PBE
algorithms to a static table:
https://github.com/openssl/openssl/commit/b8f702a0affa2087758230967b55df504a176774

Closes #19201

2 weeks agonetrc: when the cached file is discarded, unmark it as loaded
Daniel Stenberg [Thu, 23 Oct 2025 08:51:03 +0000 (10:51 +0200)] 
netrc: when the cached file is discarded, unmark it as loaded

Pointed out by ZeroPath

Closes #19199

2 weeks agosmtp: fix EOB handling
Stefan Eissing [Wed, 22 Oct 2025 13:04:53 +0000 (15:04 +0200)] 
smtp: fix EOB handling

SMTP automatically appends a \n.\n to an upload if there is not already
one at the end of the input. The implementation had a bug where this did
not happen, depending on read size and buffering.

Change test 900 to reproduce the failure. The bug only happened for mail
body input of known length, where EOS was known on the last chunk read.
Change test 900 to use an input file and make it large enough.

Fixes #18798
Closes #19193
Reported-by: madoe on github
2 weeks agotransfer: fix retry for empty downloads on reuse
Stefan Eissing [Wed, 22 Oct 2025 10:37:59 +0000 (12:37 +0200)] 
transfer: fix retry for empty downloads on reuse

When a reused connection did transfer 0 bytes, it assumed the transfer
had failed and needed a retry. Add a check for data->red.done, so we can
successfully accept the transfer of a 0-length file via SFTP.

Add test case 1583 to verfiy.

Fix SFTP disconnect debug trace when there was nothing to
disconnect (like when reusing a connection).

Fixes #19165
Reported-by: Alexander Blach
Closes #19189

2 weeks agotest776: NTLM with too long NTMLv2 ntresplen
Daniel Stenberg [Thu, 23 Oct 2025 07:22:19 +0000 (09:22 +0200)] 
test776: NTLM with too long NTMLv2 ntresplen

2 weeks agotest775: verify NTLM with too long user name set
Daniel Stenberg [Wed, 22 Oct 2025 05:57:26 +0000 (07:57 +0200)] 
test775: verify NTLM with too long user name set

2 weeks agontlm: improved error path on bad incoming NTLM TYPE3 message
Daniel Stenberg [Wed, 22 Oct 2025 05:54:33 +0000 (07:54 +0200)] 
ntlm: improved error path on bad incoming NTLM TYPE3 message

No leaks

Reported-by: Tim Becker
Closes #19198

2 weeks agovtls: unify the error handling in ssl_cf_connect().
x2018 [Wed, 22 Oct 2025 13:45:07 +0000 (21:45 +0800)] 
vtls: unify the error handling in ssl_cf_connect().

Check preference at first, then init peer and do connect. Also fixes
CF_DATA_RESTORE.

Closes #19196

2 weeks agocw-out: unify the error handling pattern in cw_out_do_write
x2018 [Wed, 22 Oct 2025 11:07:57 +0000 (19:07 +0800)] 
cw-out: unify the error handling pattern in cw_out_do_write

to proper set the error status and release resource

Closes #19195

2 weeks agoopenssl: only try engine/provider if a certificate file/name is provided
Daniel Stenberg [Wed, 22 Oct 2025 22:53:09 +0000 (00:53 +0200)] 
openssl: only try engine/provider if a certificate file/name is provided

Bug: https://issues.oss-fuzz.com/issues/435278402

Closes #19197

2 weeks agoftp: remove the retr_size_saved struct field
Daniel Stenberg [Wed, 22 Oct 2025 20:54:28 +0000 (22:54 +0200)] 
ftp: remove the retr_size_saved struct field

It was basically a duplicate of data->req.size already

Closes #19194

2 weeks agoftp: remove the state_saved struct field
Daniel Stenberg [Wed, 22 Oct 2025 12:55:32 +0000 (14:55 +0200)] 
ftp: remove the state_saved struct field

It was not necessary. Its only purpose was to know if an upload is done,
and that information is already available elsewhere.

Closes #19192

2 weeks agoGHA/labeler: add FindGnuTLS.cmake
Viktor Szakats [Wed, 22 Oct 2025 16:57:32 +0000 (18:57 +0200)] 
GHA/labeler: add FindGnuTLS.cmake

Follow-up to 1966c86d71eb90beeeb3ccbefd6321bd64992553 #19163
Cherry-picked from #16973

2 weeks agoftp: reduce size of some struct fields
Daniel Stenberg [Wed, 22 Oct 2025 11:22:21 +0000 (13:22 +0200)] 
ftp: reduce size of some struct fields

Closes #19191

2 weeks agoftp: remove 'newhost' and 'newport' from the ftp_conn struct
Daniel Stenberg [Wed, 22 Oct 2025 11:08:21 +0000 (13:08 +0200)] 
ftp: remove 'newhost' and 'newport' from the ftp_conn struct

They are only needed locally, no need to keep them around.

Closes #19190

2 weeks agoimap: parse and use UIDVALIDITY as a number
Daniel Stenberg [Wed, 22 Oct 2025 09:25:42 +0000 (11:25 +0200)] 
imap: parse and use UIDVALIDITY as a number

Instead of a string. Saves a malloc, adds earlier format check.

RFC 3501 section 2.3.1.1 documents the value as a 32-bit value.

Closes #19188

2 weeks agovquic: fix recvmsg loop for max_pkts
Stefan Eissing [Wed, 22 Oct 2025 08:12:54 +0000 (10:12 +0200)] 
vquic: fix recvmsg loop for max_pkts

The parameter `max_pkts` was not checked in the recvmsg() implementation
of vquic_recv_packets() as the packter counter was never increased. This
led to the loop running until an EAGAIN was encountered. Which, in any
real case scenario, does no harm as long as libcurl is ingesting packets
faster than a server is able to send them.

However on a slow device and a fast network this could happen and allow
a denial of serice.

Not a real regression as the vulnerable code has never been released.
libcurl 8.16.0 does not have this bug.

Closes #19186

2 weeks agognutls: fix re-handshake comments
Stefan Eissing [Wed, 22 Oct 2025 08:39:58 +0000 (10:39 +0200)] 
gnutls: fix re-handshake comments

With GnuTLS, a GNUTLS_E_REHANDSHAKE can be a renegotiate in TLSv1.2 or a
key update in TLSv1.3. This had been made non-blocking in
a1850ad7debe33fded6367e34d5c06be4d51f58e but the comment warning about a
blocking call was not updated.

Closes #19187

2 weeks agoftp: check errors on remote ip for data connection
Stefan Eissing [Wed, 22 Oct 2025 08:00:53 +0000 (10:00 +0200)] 
ftp: check errors on remote ip for data connection

Obtaining the remote ip of the control connection to be used for the
data connection can fail. Check that and fail the transfer when that
does not work.

Triggered by an OSS-Fuzz issue.
Closes #19185

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 22 Oct 2025 07:55:34 +0000 (09:55 +0200)] 
RELEASE-NOTES: synced

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