Commit graph

38864 commits

Author SHA1 Message Date
Daniel Stenberg
317bf7e8a8
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
2026-06-07 00:26:51 +02:00
Daniel Stenberg
38b72f3b56
CURLOPT_PINNEDPUBLICKEY.md: does not apply for other origins
Clarify

Closes #21885
2026-06-07 00:12:02 +02:00
Daniel Stenberg
f7f1666ee2
CURLOPT_CHUNK_BGN_FUNCTION: target is there for symlinks only
Closes #21883
2026-06-07 00:11:14 +02:00
Daniel Stenberg
c3c2cfb65d
http: reject spurious CR bytes in headers
Verified by test 2105

Closes #21882
2026-06-06 22:54:25 +02:00
Vasiliy-Kkk
3b9f0972e2 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
2026-06-06 11:27:34 -04:00
Viktor Szakats
d3e9a815c4
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
2026-06-05 16:57:38 +02:00
Viktor Szakats
982e19f231
vquic: drop stray casts for iovec.iov_len
Spotted by GitHub Code Quality

Closes #21877
2026-06-05 16:57:38 +02:00
Viktor Szakats
0c8c6f4fc0
libssh2: replace macro names with non-misspelled alternatives
They are available in libssh2 0.15+.

Closes #21876
2026-06-05 16:57:38 +02:00
Viktor Szakats
1b8f4dba28
tidy-up: drop stray casts for allocated pointers
Closes #21865
2026-06-05 12:24:01 +02:00
Viktor Szakats
cb307544ad
libssh2: sync version check with INTERNALS.md
Follow-up to cf3b9657bc

Closes #21868
2026-06-05 12:06:22 +02:00
Viktor Szakats
5c9ac36e58
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
2026-06-05 12:06:22 +02:00
Viktor Szakats
3c7d136225
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
2026-06-05 12:06:22 +02:00
Stefan Eissing
56eca2afb4
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
2026-06-05 09:14:21 +02:00
Daniel Stenberg
c32427d0c1
VULN-DISCLOSURE-POLICY.md: emphasize comm as a human
Closes #21870
2026-06-05 09:13:35 +02:00
Andreas Falkenhahn
3d721a1d41 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
2026-06-04 14:45:17 -04:00
Marcel Raad
75a94f3cd8
tests: add cookies feature to some tests
These fail without cookie support.

Closes https://github.com/curl/curl/pull/21858
2026-06-03 12:44:45 +02:00
Daniel Stenberg
fda48a5a9c
top-complexity: drop threshold to 50
Closes #21857
2026-06-03 11:05:34 +02:00
Daniel Stenberg
ef8f68568f
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
2026-06-03 10:41:15 +02:00
Daniel Stenberg
cf7919262d
tool_parsecfg: refactor parseconfig()
- introduce helper functions
- remove #ifdef'ed debug code

Closes #21855
2026-06-03 10:40:01 +02:00
Daniel Stenberg
6730081429
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
2026-06-03 09:42:52 +02:00
dependabot[bot]
fb6be547e8
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
2026-06-03 00:27:43 +02:00
Stefan Eissing
22d979400a
vquic: moving related things into subdir
Move QUIC related implementations into the vquic directory. Rename
files that implement a connection filter accordingly.

Closes #21848
2026-06-02 22:48:21 +02:00
Daniel Stenberg
5d178de986
hsts.md: mention multiple curl invokes effect
Reported-by: zhanhb on github
Ref: #21847
Closes #21851
2026-06-02 22:46:03 +02:00
Viktor Szakats
2932b7f56f
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
2026-06-02 21:59:41 +02:00
Vasiliy-Kkk
a79467343f 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
2026-06-02 13:58:21 -04:00
Jay Satiro
74f18f27a2 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
2026-06-02 13:47:01 -04:00
Daniel Stenberg
a4313f1a98
RELEASE-NOTES: synced 2026-06-02 17:01:58 +02:00
Viktor Szakats
89683e05b9
tidy-up: use test/example domains more
Closes #21849
2026-06-02 15:31:48 +02:00
Joshua Rogers
be6c4ee7fa
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
2026-06-02 13:30:35 +02:00
Joshua Rogers
d191de891a
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
2026-06-02 11:43:00 +02:00
Daniel Stenberg
9d19b47302
lib1560: verify a few more URL variations
Closes #21842
2026-06-02 11:31:46 +02:00
Daniel Stenberg
d2f8e231a7
KNOWN_BUGS: Digest does not care for 'domain'
Room for improvement.

Closes #21838
2026-06-02 11:17:48 +02:00
Daniel Stenberg
277db5490c
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
2026-06-02 11:13:50 +02:00
Viktor Szakats
4c49ed1b7b
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
2026-06-02 10:05:39 +02:00
Daniel Stenberg
b825417043
tool_operhlp: avoid NULL to %s
If the filename allocation fails.

Reported-by: Gao Liyou
Ref: #21825
Closes #21836
2026-06-02 08:48:19 +02:00
Daniel Stenberg
7d2382ebfa
tool_help: rectify a bad assert
The condition was wrong, and now it also verifies 'tlen'.

Reported-by: Gao Liyou
Ref: #21825
Closes #21837
2026-06-02 08:45:48 +02:00
Viktor Szakats
669e795e94
Makefile.am: drop test1190 listed twice
Spotted by GitHub Code Quality

Closes #21839
2026-06-02 08:44:11 +02:00
Stefan Eissing
31cb54e1fa
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
2026-06-02 08:27:00 +02:00
Josef Cejka
ba600296d2
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
2026-06-01 23:40:28 +02:00
Viktor Szakats
28341c303d
lib505: tidy up slist pointer use
Bring code closer to `curl_slist_append()` man page and clarify variable
names.

Closes #21835
2026-06-01 23:36:04 +02:00
Randall S. Becker
2a63957204
capsule: include arpa/inet.h for ntohs() declaration
Some platforms require inclusion of arpa/inet.h in order to use ntohs().

Follow-up to e78b1b3ecc #21153

Closes #21834
2026-06-01 23:36:04 +02:00
Viktor Szakats
4e98f6d225
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
2026-06-01 22:36:40 +02:00
Viktor Szakats
c5000b786b
build: say Quiche support is experimental, where missing
Follow-up to f2183f51b6 #21795

Closes #21832
2026-06-01 22:33:57 +02:00
Viktor Szakats
d229055549
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
2026-06-01 22:33:57 +02:00
Stefan Eissing
032b15c434
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
2026-06-01 16:47:24 +02:00
Daniel Stenberg
c53426231d
setopt: CURLOPT_MAXCONNECTS set to 0 restores default value
Closes #21829
2026-06-01 16:46:10 +02:00
Stefan Eissing
12869080a1
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
2026-06-01 16:42:10 +02:00
Daniel Stenberg
ff300ac4aa
setopt: defref the old referer when setting a new
Closes #21826
2026-06-01 15:23:04 +02:00
Viktor Szakats
6ff5c8ac4a
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
2026-06-01 15:07:17 +02:00
Viktor Szakats
5364e6e60e
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
2026-06-01 15:07:17 +02:00