]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
6 days agopsl: require libpsl 0.16.0 (2016-12-10) or greater
Viktor Szakats [Tue, 9 Jun 2026 12:02:32 +0000 (14:02 +0200)] 
psl: require libpsl 0.16.0 (2016-12-10) or greater

Debian Stretch offers 0.17.0.

Ref: https://github.com/rockdaboot/libpsl/releases/tag/libpsl-0.16.0
Ref: https://sources.debian.org/src/libpsl/

Closes #21933

6 days agohttp-proxy: verify CONNECT response headers
alhudz [Tue, 9 Jun 2026 10:56:14 +0000 (16:26 +0530)] 
http-proxy: verify CONNECT response headers

Verifed by test 2107

Closes #21927

6 days agosigv4: URL encode the user name in the header
Daniel Stenberg [Tue, 9 Jun 2026 09:40:41 +0000 (11:40 +0200)] 
sigv4: URL encode the user name in the header

- split into sub functions
- add 'aws-sigv4' as keyword for many tests

Verify with test 3222

Reported-by: Trail of Bits
Closes #21923

6 days agosmbserver: check impacket presence differently
Viktor Szakats [Tue, 9 Jun 2026 10:58:24 +0000 (12:58 +0200)] 
smbserver: check impacket presence differently

To silence ruff and GitHub CodeQL warnings.

Closes #21929

6 days agopytest: use `Optional[]`, adjust whitespace
Viktor Szakats [Tue, 9 Jun 2026 10:46:17 +0000 (12:46 +0200)] 
pytest: use `Optional[]`, adjust whitespace

Reported by GitHub Code Quality

Closes #21928

6 days agotidy-up: use uppercase `TRUE`/`FALSE` where missing
Viktor Szakats [Tue, 9 Jun 2026 10:09:46 +0000 (12:09 +0200)] 
tidy-up: use uppercase `TRUE`/`FALSE` where missing

Keep it only in external API calls and C++ code.

Also:
- curlx/fopen: replace with `!!`.

Spotted by GitHub Code Quality in cf-socket.c.

Closes #21925

6 days agopytest: add comment to empty except branch
Viktor Szakats [Tue, 9 Jun 2026 10:33:24 +0000 (12:33 +0200)] 
pytest: add comment to empty except branch

To silence GitHub CodeQL.

Follow-up to 4aa8cc3c4ad567ba5e96d9901ff22238fbe01a0c #21924

6 days agounit1675: fix potential memory leak on dynbuf fail path
Viktor Szakats [Tue, 9 Jun 2026 09:28:06 +0000 (11:28 +0200)] 
unit1675: fix potential memory leak on dynbuf fail path

Spotted by GitHub Code Quality

Closes #21922

6 days agopytest: fix remaining code checker warnings
Viktor Szakats [Tue, 9 Jun 2026 09:14:17 +0000 (11:14 +0200)] 
pytest: fix remaining code checker warnings

- curl.py: delete commented no-op code.
- certs.py, curl.py: narrow down exceptions to fix:
  Except block handles 'BaseException'
- test_20_websockets: add comment to empty except branch.

Reported by GitHub CodeQL

Closes #21924

6 days agocf-socket: store errno from do_connect in ctx->error
Yedaya Katsman [Mon, 8 Jun 2026 19:48:45 +0000 (22:48 +0300)] 
cf-socket: store errno from do_connect in ctx->error

This fixes a misleading log in verbose mode when ipv6 connectivity isn't
available, presumably also in other cases:

```
* Immediate connect fail for 2a00:1450:4028:806::200e: Network is unreachable
* connect to 2a00:1450:4028:806::200e port 443 from :: port 0 failed: Success
```

Closes #21914

6 days agocookie: tailmatch the domains for secure override
Daniel Stenberg [Mon, 8 Jun 2026 14:37:44 +0000 (16:37 +0200)] 
cookie: tailmatch the domains for secure override

If a SECURE cookie is set for a sub-domain (`example.com`) and is then
attempted to get set again for more specific part of that domain
(`www.example.com`) without the SECURE property, the second occurance
should not be allowed.

Reported-by: Trail of Bits
Verified by test 3305
Closes #21910

6 days agotidy-up: miscellaneous
Viktor Szakats [Fri, 5 Jun 2026 21:02:11 +0000 (23:02 +0200)] 
tidy-up: miscellaneous

- badwords: replace stray synonyms with 'null-terminator'.
- tests/FILEFORMAT.md: tidy up feature descriptions.
- printf: replace stray `%i` masks with `%d` for consistency.
- pytest: add comments for empty excepts to try silencing GitHub CodeQL
  warnings.
- tool1394, unit1675: merge nested `if`s.
- dnscache: fix typo in comment.
- fix whitespace, indent and newlines.

Closes #21921

6 days agows: make pong sending lazy
Stefan Eissing [Mon, 8 Jun 2026 14:57:01 +0000 (16:57 +0200)] 
ws: make pong sending lazy

Do not send PONG frames unless there is sufficient space left in the
websocket send buffer. A server might be lazy in reading our data and
intermediary PONG frames can be skipped by a client (RFC 6455, ch.
5.5.3).

Add test case measuring no real RSS increase on a server blasting with
PING frames.

Closes #21911

6 days agopeer.h: fix typo in comment
Daniel Stenberg [Tue, 9 Jun 2026 08:38:18 +0000 (10:38 +0200)] 
peer.h: fix typo in comment

Closes #21920

6 days agodocs: returned header size reflects HTTP/1-style format
Viktor Szakats [Mon, 8 Jun 2026 16:39:27 +0000 (18:39 +0200)] 
docs: returned header size reflects HTTP/1-style format

Ref: #21889

Closes #21912

6 days agopytest: close file handles after use (cont.), and tidy-ups
Viktor Szakats [Tue, 9 Jun 2026 00:08:30 +0000 (02:08 +0200)] 
pytest: close file handles after use (cont.), and tidy-ups

- dante.py, dnsd.py, sshd.py: drop redundant conditions.
  Spotted in sshd by GitHub Code Quality.
- curl.py: comment out `if` to silence CodeQL warning.

Reported by GitHub CodeQL

Follow-up to 8145476d5dd97d0ec704e9ea65b2f2028b8a945c #21916

Closes #21917

6 days agoresolve: Mention in error that IP address is expected
Yedaya Katsman [Fri, 5 Jun 2026 14:15:59 +0000 (17:15 +0300)] 
resolve: Mention in error that IP address is expected

If you try using a DNS name like connect-to supports it can be confusing that
it is illegal. Also make it a bit more readable

Closes #21913

6 days agodigest: escape control codes too
Daniel Stenberg [Mon, 8 Jun 2026 21:21:55 +0000 (23:21 +0200)] 
digest: escape control codes too

Since the username is decoded when used and control codes are accepted
in HTTP usernames in general, the username encoding for the Digest auth
needs to percent encode such bytes.

Verified by test 3221

Reported-by: Trail of Bits
Closes #21915

7 days agourlapi: URL decode hostname before IP address normalization
Daniel Stenberg [Tue, 9 Jun 2026 06:18:18 +0000 (08:18 +0200)] 
urlapi: URL decode hostname before IP address normalization

With this, IPv6 addresses that end with '%25' with no following zone id are
considered invalid.

Extend test 1560 to verify

Reported-by: Hem Parekh
Closes #21918

7 days agopytest: close file handles after use, and two minor tidy-ups
Viktor Szakats [Mon, 8 Jun 2026 21:27:32 +0000 (23:27 +0200)] 
pytest: close file handles after use, and two minor tidy-ups

Also:
- drop two unreachable return statements.
- test_17_ssl_use: avoid implicit string concatenations in lists.

Reported by GitHub CodeQL

Closes #21916

7 days agochecksrc-all.pl: do not check files multiple times rc-8_21_0-2
Viktor Szakats [Mon, 8 Jun 2026 11:56:49 +0000 (13:56 +0200)] 
checksrc-all.pl: do not check files multiple times

Restrict `git ls-files` to return `*.[ch]` files within `$dir` only.
Before this patch it returned files in subdirectories too, which did
double work and may have made `checksrc.pl` pick `.checksrc` from the
first such subdirectory, masking the one in `$dir`. (current curl tree
is not affected)

Ref: https://git-scm.com/docs/gitglossary#Documentation/gitglossary.txt-aiddefpathspecapathspec

Follow-up to 33f606cd51995b68a0f68ac478f7395d8acda17b #20439

Closes #21909

7 days agochunked: reject invalid bytes in trailer
alhudz [Mon, 8 Jun 2026 05:07:34 +0000 (10:37 +0530)] 
chunked: reject invalid bytes in trailer

Trailers are delivered to the application as headers via
CLIENTWRITE_TRAILER, but unlike regular response headers they skipped
the verify_header() checks, so a server could smuggle a nul byte (or
stray CR) into a header reaching CURLOPT_HEADERFUNCTION and
curl_easy_header().

Run each assembled trailer line through Curl_verify_header(), the same
validation used for normal headers.

Covered by the new test 2106.

Closes #21896

7 days agossl native_ca_store: always reinit
Stefan Eissing [Mon, 8 Jun 2026 08:11:30 +0000 (10:11 +0200)] 
ssl native_ca_store: always reinit

Add bit `native_ca_store_opt` to keep the setting of
CURLOPT_(PROXY_)SSL_OPTIONS and use that to calculate every easy
transfer if a native CA store shall be used or not.

This avoids `native_ca_store` getting stuck on TRUE after being set
once.

Closes #21902

7 days agonetrc: remember and check filename loaded
Stefan Eissing [Mon, 8 Jun 2026 09:28:57 +0000 (11:28 +0200)] 
netrc: remember and check filename loaded

Remember the filename of a loaded netrc file to detect changed
configurations in a reused easy handle.

Closes #21903

7 days agoCURLOPT_DOH_URL.md: does not inherit proxy options
Daniel Stenberg [Mon, 8 Jun 2026 10:55:40 +0000 (12:55 +0200)] 
CURLOPT_DOH_URL.md: does not inherit proxy options

Closes #21904

7 days ago_ENVIRONMENT.md. Windows does case insensitive env variables
Daniel Stenberg [Mon, 8 Jun 2026 10:40:55 +0000 (12:40 +0200)] 
_ENVIRONMENT.md. Windows does case insensitive env variables

Closes #21907

7 days agoGHA: update dependency pizlonator/fil-c to v0.679
renovate[bot] [Mon, 8 Jun 2026 05:13:07 +0000 (05:13 +0000)] 
GHA: update dependency pizlonator/fil-c to v0.679

Closes #21897

7 days agoruntests: allow skipping tests on torture, use for test 357
Viktor Szakats [Mon, 8 Jun 2026 10:37:48 +0000 (12:37 +0200)] 
runtests: allow skipping tests on torture, use for test 357

Some tests may take a long time in torture mode. Make it possible
to skip individual tests when runtests in running in torture mode.

Also:
- skip test 357 for the reason above.
  Saved 1-3 minutes for the Linux CI torture job, 1-1.5m on Windows.
  No savings on macOS.

Reported-by: Stefan Eissing
Fixes #21873

Closes #21906

7 days agolibssh2: save non-standard port to `known_hosts`
Viktor Szakats [Fri, 5 Jun 2026 13:56:17 +0000 (15:56 +0200)] 
libssh2: save non-standard port to `known_hosts`

Reported-by: dyingc on github
Fixes #21863

Closes #21874

7 days agosetopt: claer the "custom" CA booleans when set to NULL
Daniel Stenberg [Mon, 8 Jun 2026 07:29:24 +0000 (09:29 +0200)] 
setopt: claer the "custom" CA booleans when set to NULL

Mark them as custom choices only when pointer is passed, and clear them
again when set to NULL.

Closes #21901

7 days agovar: use a dedicated pointer for the alloc
Daniel Stenberg [Mon, 8 Jun 2026 06:11:34 +0000 (08:11 +0200)] 
var: use a dedicated pointer for the alloc

As the 'c' pointer might actually get modified before it is time to free
the memory.

Verify in test 2310

Reported-by: Eunsoo Kim
Fixes #21898
Closes #21900

8 days agoRevert "url: remove ssh_config_matches"
Daniel Stenberg [Mon, 8 Jun 2026 05:54:50 +0000 (07:54 +0200)] 
Revert "url: remove ssh_config_matches"

This reverts commit 3e9817cd1bb6aa53d3d3bf10572bb245d064870c.

The change was incorrect as the check was not for the options the commit
message mentions.

Reported-by: ByteRay on hackerone
Closes #21899

8 days agourlapi: fix memleaks on error in `parse_hostname_login()`
Viktor Szakats [Fri, 5 Jun 2026 14:39:20 +0000 (16:39 +0200)] 
urlapi: fix memleaks on error in `parse_hostname_login()`

Detected by GitHub Code Quality

Follow-up to acd82c8bfd743d0f743a1c1296890738832ac83e #11006
Follow-up to 4183b8fe9a8558b8f62c9dbf8271deed75bff28b #8049

Closes #21879

8 days agolib1587: drop redundant includes
Viktor Szakats [Sun, 7 Jun 2026 22:28:41 +0000 (00:28 +0200)] 
lib1587: drop redundant includes

Closes #21892

8 days agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 7 Jun 2026 21:19:55 +0000 (23:19 +0200)] 
RELEASE-NOTES: synced

8 days agoCURLOPT_DISALLOW_USERNAME_IN_URL: is for CURLOPT_URL only
Daniel Stenberg [Sun, 7 Jun 2026 12:48:50 +0000 (14:48 +0200)] 
CURLOPT_DISALLOW_USERNAME_IN_URL: is for CURLOPT_URL only

Closes #21890

8 days agotool: warn when --ssl and --ftp-ssl-control override each other
Daniel Stenberg [Sat, 6 Jun 2026 22:22:53 +0000 (00:22 +0200)] 
tool: warn when --ssl and --ftp-ssl-control override each other

and mention this properly in the docs.

Closes #21887

8 days agoCURLOPT_PORT.md: use stronger language
Daniel Stenberg [Sat, 6 Jun 2026 22:09:30 +0000 (00:09 +0200)] 
CURLOPT_PORT.md: use stronger language

This option should not be used.

Closes #21886

8 days agoprogress: fx CURLINFO time reporting
Stefan Eissing [Tue, 2 Jun 2026 09:10:10 +0000 (11:10 +0200)] 
progress: fx CURLINFO time reporting

Whack the times reported for a transfer (see
https://curl.se/libcurl/c/curl_easy_getinfo.html#TIMES) into order for
all variations of up-/download, http/ftp etc. Make sure they are
reported in the documented order.

There is still the *possibility* of PRETRANSFER being longer then
POSTTRANSFER, if a server sends a response before an upload is done.
POST is the time the first response byte is received, and PRE is the
time the last byte was sent by curl.

This may happen with more likelihood on HTTP/2 and 3 for a server
rejected upload. But for successful uploads, the answer will almost over
come afterwards.

Undo the previous twists in lib500.c tests, adjust pytest timeline
checks.

Fixes #21828
Reported-by: BazaarAcc32 on github
Closes #21843

9 days agoftplistparser: clear strings.target if not symlink
Daniel Stenberg [Sat, 6 Jun 2026 21:38:22 +0000 (23:38 +0200)] 
ftplistparser: clear strings.target if not symlink

When the struct is passed to the CURLOPT_CHUNK_BGN_FUNCTION callback,
clear the pointer if the provided data is not a symlink.

Closes #21884

9 days agoCURLOPT_PINNEDPUBLICKEY.md: does not apply for other origins
Daniel Stenberg [Sat, 6 Jun 2026 21:50:47 +0000 (23:50 +0200)] 
CURLOPT_PINNEDPUBLICKEY.md: does not apply for other origins

Clarify

Closes #21885

9 days agoCURLOPT_CHUNK_BGN_FUNCTION: target is there for symlinks only
Daniel Stenberg [Sat, 6 Jun 2026 21:34:15 +0000 (23:34 +0200)] 
CURLOPT_CHUNK_BGN_FUNCTION: target is there for symlinks only

Closes #21883

9 days agohttp: reject spurious CR bytes in headers
Daniel Stenberg [Sat, 6 Jun 2026 15:27:52 +0000 (17:27 +0200)] 
http: reject spurious CR bytes in headers

Verified by test 2105

Closes #21882

9 days agoschannel_verify: simplify CryptQueryObject use
Vasiliy-Kkk [Tue, 26 May 2026 13:55:39 +0000 (16:55 +0300)] 
schannel_verify: simplify CryptQueryObject use

- Specify that the content is base64 encoded, rather than rely on
  auto-detect.

- Remove unnecessary sanity check of the returned content type.

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

10 days agotidy-up: miscellaneous
Viktor Szakats [Mon, 1 Jun 2026 22:44:17 +0000 (00:44 +0200)] 
tidy-up: miscellaneous

- fix typos.
- badword: add two new words.
- cpp: drop parentheses from standalone `#if` expressions.
- libssh: vertical-align comment block with others.
- clang-format.

Closes #21880

10 days agovquic: drop stray casts for `iovec.iov_len`
Viktor Szakats [Fri, 5 Jun 2026 14:31:09 +0000 (16:31 +0200)] 
vquic: drop stray casts for `iovec.iov_len`

Spotted by GitHub Code Quality

Closes #21877

10 days agolibssh2: replace macro names with non-misspelled alternatives
Viktor Szakats [Fri, 5 Jun 2026 14:22:43 +0000 (16:22 +0200)] 
libssh2: replace macro names with non-misspelled alternatives

They are available in libssh2 0.15+.

Closes #21876

10 days agotidy-up: drop stray casts for allocated pointers
Viktor Szakats [Thu, 4 Jun 2026 23:23:06 +0000 (01:23 +0200)] 
tidy-up: drop stray casts for allocated pointers

Closes #21865

10 days agolibssh2: sync version check with INTERNALS.md
Viktor Szakats [Fri, 5 Jun 2026 03:09:45 +0000 (05:09 +0200)] 
libssh2: sync version check with INTERNALS.md

Follow-up to cf3b9657bcb7acd3525ca081b4ed16e860604d6d

Closes #21868

10 days agolibssh2: do not use deprecated macros when unavailable
Viktor Szakats [Fri, 5 Jun 2026 00:45:53 +0000 (02:45 +0200)] 
libssh2: do not use deprecated macros when unavailable

To support building with `LIBSSH2_NO_DEPRECATED` macro defined, a future
libssh2 that may have dropped these macros.

Ref: https://github.com/libssh2/libssh2/pull/1977

Closes #21867

10 days agolibssh2: use non-deprecated `libssh2_knownhost_addc()`
Viktor Szakats [Fri, 5 Jun 2026 00:35:58 +0000 (02:35 +0200)] 
libssh2: use non-deprecated `libssh2_knownhost_addc()`

Supported since libssh2 v1.2.5. Replacing `libssh2_knownhost_add()`,
which was deprecated in that same version.

The new API supports a comment field.

Ref: https://github.com/libssh2/libssh2/pull/1977

Closes #21866

11 days agoquic: count zero length packets against max
Stefan Eissing [Fri, 5 Jun 2026 06:34:46 +0000 (08:34 +0200)] 
quic: count zero length packets against max

With a flood of zero lenght UDP packets to curl, the receive loop might
run longer than intended to. Count such packets against the max to
terminate the loop as intended.

URL: https://hackerone.com/reports/3783438
Reported-by: vectorqueue on hackerone
Closes #21869

11 days agoVULN-DISCLOSURE-POLICY.md: emphasize comm as a human
Daniel Stenberg [Fri, 5 Jun 2026 06:58:14 +0000 (08:58 +0200)] 
VULN-DISCLOSURE-POLICY.md: emphasize comm as a human

Closes #21870

11 days agoBINDINGS: Update Hollywood link
Andreas Falkenhahn [Wed, 3 Jun 2026 21:03:51 +0000 (23:03 +0200)] 
BINDINGS: Update Hollywood link

- Change link from archive.org back to hollywood-mal.com since the site
  is up and running.

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

12 days agotests: add `cookies` feature to some tests 21858/head
Marcel Raad [Wed, 3 Jun 2026 06:58:08 +0000 (08:58 +0200)] 
tests: add `cookies` feature to some tests

These fail without cookie support.

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

12 days agotop-complexity: drop threshold to 50
Daniel Stenberg [Wed, 3 Jun 2026 08:42:26 +0000 (10:42 +0200)] 
top-complexity: drop threshold to 50

Closes #21857

12 days agourlapi: simplify urlget_url somewhat
Daniel Stenberg [Wed, 3 Jun 2026 08:20:02 +0000 (10:20 +0200)] 
urlapi: simplify urlget_url somewhat

- make file_url() a separate function that returns a file:// URL
- group the checks that need scheme info

Closes #21856

12 days agotool_parsecfg: refactor parseconfig()
Daniel Stenberg [Wed, 3 Jun 2026 07:43:41 +0000 (09:43 +0200)] 
tool_parsecfg: refactor parseconfig()

- introduce helper functions
- remove #ifdef'ed debug code

Closes #21855

12 days agocookie: refactor parse_cookie_header
Daniel Stenberg [Wed, 3 Jun 2026 06:10:14 +0000 (08:10 +0200)] 
cookie: refactor parse_cookie_header

- introduce a few static helper functions
- simplify the bad octet checks
- simplify the too long cookie/value check

Closes #21854

13 days agoGHA: bump 2 GitHub Actions
dependabot[bot] [Tue, 2 Jun 2026 20:20:31 +0000 (20:20 +0000)] 
GHA: bump 2 GitHub Actions

- updates `actions/labeler` from 6.0.1 to 6.1.0
- updates `github/codeql-action` from 4.35.2 to 4.36.0

Closes #21852

13 days agovquic: moving related things into subdir
Stefan Eissing [Tue, 2 Jun 2026 11:27:22 +0000 (13:27 +0200)] 
vquic: moving related things into subdir

Move QUIC related implementations into the vquic directory. Rename
files that implement a connection filter accordingly.

Closes #21848

13 days agohsts.md: mention multiple curl invokes effect
Daniel Stenberg [Tue, 2 Jun 2026 15:40:48 +0000 (17:40 +0200)] 
hsts.md: mention multiple curl invokes effect

Reported-by: zhanhb on github
Ref: #21847
Closes #21851

13 days agogtls: minor fixes and improvements
Viktor Szakats [Tue, 2 Jun 2026 13:33:14 +0000 (15:33 +0200)] 
gtls: minor fixes and improvements

- fix GnuTLS function name reference in `Curl_gtls_shared_creds_create()`
  error message.
  Spotted by GitHub Code Quality.
- unfold a line.
- in `Curl_gtls_verifyserver()`:
  - report the failure of `gnutls_x509_crt_import()`.
    Spotted by GitHub Code Quality.
  - fix a minor inconsistency in error strings.
  - drop redundant NULL checks for `config->issuercert`.

Closes #21850

13 days agoschannel: use fopen instead CreateFile
Vasiliy-Kkk [Wed, 27 May 2026 12:40:13 +0000 (15:40 +0300)] 
schannel: use fopen instead CreateFile

- Refactor CA file reading to use the typical fopen/fread instead of
  CreateFile/ReadFile.

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

13 days agogithub: Add AI usage warning to issue, doc and PR templates
Jay Satiro [Thu, 28 May 2026 18:42:03 +0000 (14:42 -0400)] 
github: Add AI usage warning to issue, doc and PR templates

- Explain to contributors that though AI use is acceptable they must
  not file unless they can understand and explain their work without AI.

Assisted-by: Viktor Szakats
Ref: https://github.com/curl/curl/discussions/21792

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

13 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 2 Jun 2026 15:01:32 +0000 (17:01 +0200)] 
RELEASE-NOTES: synced

13 days agotidy-up: use test/example domains more
Viktor Szakats [Tue, 2 Jun 2026 11:51:35 +0000 (13:51 +0200)] 
tidy-up: use test/example domains more

Closes #21849

13 days agogtls: verify OCSP response signature in gtls_verify_ocsp_status
Joshua Rogers [Tue, 19 May 2026 13:54:30 +0000 (15:54 +0200)] 
gtls: verify OCSP response signature in gtls_verify_ocsp_status

Since aeb1a281ca ("gtls: fix OCSP stapling management"), the function
parses the stapled OCSP response and reads the certificate status via
gnutls_ocsp_resp_get_single(), but never calls gnutls_ocsp_resp_verify()
or gnutls_ocsp_resp_verify_direct(). A response with a forged or
corrupted signature is accepted without question.

Fix by calling gnutls_ocsp_resp_verify() against the trust list obtained
from the session credentials immediately after gnutls_ocsp_resp_import().
This handles both directly-signed responses and delegated OCSP responders
without requiring the issuer certificate to be present in the peer chain.

The missing check only affects the CURLOPT_SSL_VERIFYSTATUS code path
when CURLOPT_SSL_VERIFYPEER is disabled. With peer verification enabled,
gnutls_certificate_verify_peers2() independently catches the invalid
response via GNUTLS_CERT_INVALID_OCSP_STATUS before
gtls_verify_ocsp_status() is reached. As a result, no attack is possible
that is not already trivially achievable without OCSP stapling when peer
verification is off. This is a correctness and consistency fix, not a
security vulnerability.

Reported-by: Joshua Rogers
Closes #21677

13 days agotelnet: honor CURLOPT_TIMEOUT in send_telnet_data()
Joshua Rogers [Tue, 19 May 2026 22:37:27 +0000 (00:37 +0200)] 
telnet: honor CURLOPT_TIMEOUT in send_telnet_data()

The poll-before-write loop used -1 (infinite) as the Curl_poll timeout,
so a peer that stops reading could stall the transfer indefinitely,
bypassing CURLOPT_TIMEOUT. Use Curl_timeleft_ms() instead and return
CURLE_OPERATION_TIMEDOUT when the deadline is reached or exceeded.

Closes #21685

13 days agolib1560: verify a few more URL variations
Daniel Stenberg [Tue, 2 Jun 2026 08:58:15 +0000 (10:58 +0200)] 
lib1560: verify a few more URL variations

Closes #21842

13 days agoKNOWN_BUGS: Digest does not care for 'domain'
Daniel Stenberg [Tue, 2 Jun 2026 06:31:00 +0000 (08:31 +0200)] 
KNOWN_BUGS: Digest does not care for 'domain'

Room for improvement.

Closes #21838

13 days agoURL-SYNTAX: document more URL parsing details
Daniel Stenberg [Tue, 2 Jun 2026 08:56:37 +0000 (10:56 +0200)] 
URL-SYNTAX: document more URL parsing details

- IPv4 numerical address
- IPv6 numerical address + zone id mention
- No IPvFuture support
- Some path parsing details

Closes #21841

13 days agoos400sys: fix theoretical length overflows
Viktor Szakats [Tue, 2 Jun 2026 07:10:44 +0000 (09:10 +0200)] 
os400sys: fix theoretical length overflows

When converting a `size_t` to `unsigned int`.

Another instance spotted by Copilot.

Reported-by: Gao Liyou
Ref: #21825
Closes #21840

2 weeks agotool_operhlp: avoid NULL to %s
Daniel Stenberg [Tue, 2 Jun 2026 06:10:47 +0000 (08:10 +0200)] 
tool_operhlp: avoid NULL to %s

If the filename allocation fails.

Reported-by: Gao Liyou
Ref: #21825
Closes #21836

2 weeks agotool_help: rectify a bad assert
Daniel Stenberg [Tue, 2 Jun 2026 06:18:53 +0000 (08:18 +0200)] 
tool_help: rectify a bad assert

The condition was wrong, and now it also verifies 'tlen'.

Reported-by: Gao Liyou
Ref: #21825
Closes #21837

2 weeks agoMakefile.am: drop test1190 listed twice
Viktor Szakats [Tue, 2 Jun 2026 06:31:40 +0000 (08:31 +0200)] 
Makefile.am: drop test1190 listed twice

Spotted by GitHub Code Quality

Closes #21839

2 weeks agocfilters: remove close method
Stefan Eissing [Mon, 1 Jun 2026 13:31:40 +0000 (15:31 +0200)] 
cfilters: remove close method

closing a filter chain and reconnecting it again is a complication
that only the HTTP/1.x proxy filter used. Remove it from all filters.

Instead, a filter can return CURLE_AGAIN during the connect phase
and the cf-setup filter will tear down all "sub filters" and restart
over.

With this, a filter never resets to the initial phase but progresses
through connect -> connected -> shutdown -> destroy once.

Closes #21831

2 weeks agohttp: prefer chunked encoding over Content-Length: 0
Josef Cejka [Wed, 20 May 2026 16:07:16 +0000 (18:07 +0200)] 
http: prefer chunked encoding over Content-Length: 0

Call http_size() before checking the request for empty body to prefer
Transfer-Encoding: chunked even if Content-Length is 0.

Closes #21706

2 weeks agolib505: tidy up slist pointer use
Viktor Szakats [Mon, 1 Jun 2026 21:12:56 +0000 (23:12 +0200)] 
lib505: tidy up slist pointer use

Bring code closer to `curl_slist_append()` man page and clarify variable
names.

Closes #21835

2 weeks agocapsule: include `arpa/inet.h` for `ntohs()` declaration
Randall S. Becker [Mon, 1 Jun 2026 20:18:00 +0000 (21:18 +0100)] 
capsule: include `arpa/inet.h` for `ntohs()` declaration

Some platforms require inclusion of arpa/inet.h in order to use ntohs().

Follow-up to e78b1b3eccfa6a2e367a1225ea1b66dafcdac3c4 #21153

Closes #21834

2 weeks agounits: drop redundant pointer check and workaround
Viktor Szakats [Sun, 31 May 2026 23:29:14 +0000 (01:29 +0200)] 
units: drop redundant pointer check and workaround

All users of the `verify_memory()` macro used a fixed-length buffer for
the test output, which then needed a workaround to silence GCC
`-Waddress` warnings.

```
tests/unit/unit1615.c: In function 'test_unit1615':
tests/libtest/unitcheck.h:51:8: error: the address of 'output_buf' will always evaluate as 'true' [-Werror=address]
   51 |     if((dynamic) && memcmp(dynamic, check, len)) {                          \
      |        ^
tests/unit/unit1615.c:114:3: note: in expansion of macro 'verify_memory'
  114 |   verify_memory(output_buf, precomp_hash1, CURL_SHA512_256_DIGEST_LENGTH);
      |   ^~~~~~~~~~~~~
```

Drop redundant address check and the workarounds with it.

Closes #21833

2 weeks agobuild: say Quiche support is experimental, where missing
Viktor Szakats [Mon, 1 Jun 2026 16:53:20 +0000 (18:53 +0200)] 
build: say Quiche support is experimental, where missing

Follow-up to f2183f51b6651dae759164d064c62fa075d8f695 #21795

Closes #21832

2 weeks agotidy-up: miscellaneous
Viktor Szakats [Thu, 28 May 2026 21:50:52 +0000 (23:50 +0200)] 
tidy-up: miscellaneous

- drop more uses of the word "just". (not enforced here)
- drop some uses of the "will" word.
- "then" -> "than".
- tests/http/testenv/curl.py: fix copy-paste typo in error message.
- pytest: replace `shutdownh` with `shutdown` in test names.
  Spotted by GitHub Code Quality.
- comment typos.
- whitespace and newlines fixes.

Closes #21830

2 weeks agocf-setup: improve readability
Stefan Eissing [Mon, 1 Jun 2026 12:23:30 +0000 (14:23 +0200)] 
cf-setup: improve readability

Restructure the code in cf-setup connect to make it better readable what
is happening for establishing the connection's filter chain.

Closes #21827

2 weeks agosetopt: CURLOPT_MAXCONNECTS set to 0 restores default value
Daniel Stenberg [Mon, 1 Jun 2026 14:01:17 +0000 (16:01 +0200)] 
setopt: CURLOPT_MAXCONNECTS set to 0 restores default value

Closes #21829

2 weeks agodata creds: detect change
Stefan Eissing [Tue, 26 May 2026 13:01:09 +0000 (15:01 +0200)] 
data creds: detect change

Reshuffle code a little to detect when the transfer's credentials
actually change. Otherwise, leave the existing creds in place.

This gives the precise location where we may want to reset other
states that become invalid with change credentials. Also, by
keeping a creds instance as long as it is valid, we can associate
meta data with it.

Closes #21755

2 weeks agosetopt: defref the old referer when setting a new
Daniel Stenberg [Mon, 1 Jun 2026 11:31:11 +0000 (13:31 +0200)] 
setopt: defref the old referer when setting a new

Closes #21826

2 weeks agobadwords: exclude wordlist input file from search
Viktor Szakats [Sun, 31 May 2026 20:47:54 +0000 (22:47 +0200)] 
badwords: exclude wordlist input file from search

To avoid hitting all lines in it. It doesn't happen in curl at the
moment, but may happen in the future or in other projects using this
script.

Closes #21819

2 weeks agocmake: add basic way to select pytests to run
Viktor Szakats [Sun, 31 May 2026 18:44:57 +0000 (20:44 +0200)] 
cmake: add basic way to select pytests to run

Not documented and experimental, example:
`-D_CURL_PYTEST=/test_60_h3_proxy.py`

Ideally, this should be an env like `TFLAGS` and it should allow
selecting any test ID or a group of them, but so far could not figure
out how even a basic env could work.

Closes #21818

2 weeks agopytest: pass `--disable` to curl
Viktor Szakats [Sun, 31 May 2026 16:31:17 +0000 (18:31 +0200)] 
pytest: pass `--disable` to curl

To avoid a local `.curlrc` interfering with tests.

Closes #21816

2 weeks agopytest: fixes and tidy-ups to h3-proxy tests
Viktor Szakats [Sat, 30 May 2026 08:53:21 +0000 (10:53 +0200)] 
pytest: fixes and tidy-ups to h3-proxy tests

- merge tests into a single class.
  For shorter names, to fix sort order by test number, and to align with
  other tests.
- fix preconditions to make `test_60_04_guard_proxy_http3_unsupported`
  actually run.
- replace local precondition with constant of the same effect.
- drop redundant non-`ngtcp2` requirement for
  `test_60_04_guard_proxy_http3_unsupported`.
  (seemed relevant for no longer supported openssl-quic builds.)
- drop unused `NGTCP2_ONLY_MSG` constant.
  Follow-up to e4139a73c82d2035142f5ae36196adb4e9831dae #21798
- avoid creating unnecessary test data blobs, and minimize their scopes.

Follow-up to 91facd7bb3bb366525b7cb41221f6359c5e936db #21791
Follow-up to e78b1b3eccfa6a2e367a1225ea1b66dafcdac3c4 #21153

Closes #21811

2 weeks agolib1560: drop unused variable 'url' rc-8_21_0-1
Daniel Stenberg [Mon, 1 Jun 2026 06:55:37 +0000 (08:55 +0200)] 
lib1560: drop unused variable 'url'

Spotted by Copilot

Closes #21821

2 weeks agovtls_config: adjust to origin
Stefan Eissing [Wed, 20 May 2026 11:25:49 +0000 (13:25 +0200)] 
vtls_config: adjust to origin

When a transfer goes against another origin than the initial one, do not
add the following to the ssl configuration: client cert, client key, srp
user/pass, pinned key.

Closes #21695

2 weeks agoRevert "tool: add a retry delay for transfers to same origin on 429"
Daniel Stenberg [Mon, 1 Jun 2026 07:15:50 +0000 (09:15 +0200)] 
Revert "tool: add a retry delay for transfers to same origin on 429"

This reverts commit c5fb460e7c7a57bf3e3a985d10a8b175bbd61500.

This needs some further work before we can do this.

Fixes #21822
Closes #21824

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 1 Jun 2026 06:50:11 +0000 (08:50 +0200)] 
RELEASE-NOTES: synced

2 weeks agotool: add a retry delay for transfers to same origin on 429
htasta [Fri, 17 Apr 2026 10:35:33 +0000 (12:35 +0200)] 
tool: add a retry delay for transfers to same origin on 429

Closes #21355

2 weeks agourlapi: accept 0X prefix in IPv4 address as well
Daniel Stenberg [Sun, 31 May 2026 21:23:45 +0000 (23:23 +0200)] 
urlapi: accept 0X prefix in IPv4 address as well

Extend test 1560 accordingly

Closes #21820

2 weeks agourlapi: drop base fragment on empty redirect
tiymat [Wed, 27 May 2026 02:02:32 +0000 (23:32 -0230)] 
urlapi: drop base fragment on empty redirect

Extended test 1560 to verify

Fixes #21745
Closes #21763

2 weeks agourl: connection reuse fixes for starttls
Stefan Eissing [Tue, 19 May 2026 08:57:53 +0000 (10:57 +0200)] 
url: connection reuse fixes for starttls

Add test_31_13 to check connection reuse on mixed --ssl-reqd setting.
For that add debug env var CURL_DBG_NO_USE_SSL_ON_FIRST to disable
--ssl-reqd for the first url. Check that the connection without SSL
from the first url is not reused on the second URL that requires it.

Tweak special ftp: protocol check to fail a DEBUGASSERT on mismatched
`use_ssl` settings as that should have been caught before in the
connection reuse matching (imap/smtp etc. do not have this extra check
and rely on the general part doing its job).

Closes #21665

2 weeks agobadwords: prefer 'workaround' (without hyphen)
Viktor Szakats [Fri, 29 May 2026 11:39:48 +0000 (13:39 +0200)] 
badwords: prefer 'workaround' (without hyphen)

Closes #21807