]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 weeks agoruntests: check for Debug case sensitively
Daniel Stenberg [Thu, 26 Mar 2026 08:19:08 +0000 (09:19 +0100)] 
runtests: check for Debug case sensitively

For both TrackMemory and Debug

Closes #21099

4 weeks agotool: fix memory mixups
Daniel Stenberg [Tue, 24 Mar 2026 15:44:48 +0000 (16:44 +0100)] 
tool: fix memory mixups

memory allocated by libcurl must be freed with curl_free() and vice versa,
memory allocated by the tool itself must be freed with curlx_free().

- dynbuf: free libcurl data with curl_free()
- tool_operate: make sure we get URL using the right memory
- tool_operhlp: free libcurl memory with curl_free()
- tool_operate: free curl_maprintf() pointer with curl_free
- var: data from curlx_base64_decode needs curlx_free
- tool_operate: fix memory juggling in etag handling
- tool_cb_hdr: fix memory area mixups
- tool_operate: another mixup in etag management
- tool_cb_hdr: more memory mixup fixes
- tool_cfgable.c: document some details
- tool_help: show global-mem-debug in -V output

Closes #21099

4 weeks agoGHA: add a 'curl_global_init_mem debug' job
Daniel Stenberg [Thu, 26 Mar 2026 07:14:40 +0000 (08:14 +0100)] 
GHA: add a 'curl_global_init_mem debug' job

Closes #21099

4 weeks agosrc: add curl_global_init_mem testing
Daniel Stenberg [Tue, 24 Mar 2026 15:25:03 +0000 (16:25 +0100)] 
src: add curl_global_init_mem testing

Build with "configure --enable-init-mem-debug" to make the tool use
curl_global_init_mem() and a set of private memory funtion callbacks for
libcurl's memory management.

Using this setup, memory mixups in tool code is more likely to cause
crashes and thus get discovered while running tests.

This curl_global_init_mem debug mode can only be done when building
libcurl shared (not static) and without debugging enabled - since it
needs to use the custom memory funtion callbacks.

Closes #21099

4 weeks agosrc: use ftruncate() unconditionally
Daniel Stenberg [Thu, 26 Mar 2026 22:03:53 +0000 (23:03 +0100)] 
src: use ftruncate() unconditionally

Systems without it need to provide a custom alternative just like we
have have for Windows. This adds an MSDOS version that fails if trying
to truncate a too large file.

Closes #21109

4 weeks agotool_cb_hdr: only truncate etags output when regular file
Daniel Stenberg [Thu, 26 Mar 2026 13:45:37 +0000 (14:45 +0100)] 
tool_cb_hdr: only truncate etags output when regular file

When sending the output to stdout it cannot truncate.

Add test1619 to verify --etag-save to stdout

Spotted by Codex Security

Closes #21103

4 weeks agohsts: when a dupe host adds subdomains, use that
Daniel Stenberg [Thu, 26 Mar 2026 16:28:34 +0000 (17:28 +0100)] 
hsts: when a dupe host adds subdomains, use that

Otherwise a weaker earlier entry is allowed to override a later more
restrictive one.

Add test 1638 to verify.

Closes #21108

4 weeks agoGHA: try workaround for slow Azure Ubuntu distro server
Viktor Szakats [Thu, 26 Mar 2026 14:59:23 +0000 (15:59 +0100)] 
GHA: try workaround for slow Azure Ubuntu distro server

It's been going on for almost a year, chances seem slim to have this
fixed upstream.

The observed issue is that on GitHub-supplied CI runner images,
sometimes, `apt-get install` using the stock distro server
`http://azure.archive.ubuntu.com/ubuntu` sees extreme slowness while
downloading data, then reaching the job timeout and aborting, making CI
red and necessitating a manual restart of the failed job(s).

In majority of cases the install step takes no longer than 8-40 seconds
(download + install), while in the failing case it takes 10-20+ minutes
just to download.

Earlier I slimmed down installs to avoid unnecessary packages, which
mitigated, but did not completely fix the issue.

Example:
https://github.com/curl/curl/actions/runs/23599596928/job/68725576899?pr=21105

Follow-up to 0455d8772a1af20ce63c46c5738582aa9b1b8441 #18509

Closes #21107

4 weeks agoGHA/curl-for-win: pass GH token to the containers
Viktor Szakats [Thu, 26 Mar 2026 14:23:10 +0000 (15:23 +0100)] 
GHA/curl-for-win: pass GH token to the containers

To avoid rate limits when accessing GH APIs during the build.

Aiming to avoid (while trying to retrieve a file timestamp):
```
++ [[ 2026-02-11-1a84aee6387d2f9c9531c655edeea4a80aa0fcfa =~ (.+)-([a-f0-9]{40,}) ]]
++ ver=2026-02-11
++ commit=1a84aee6387d2f9c9531c655edeea4a80aa0fcfa
++ set +x
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
curl: (22) The requested URL returned error: 403
[...]
```
Ref: https://github.com/curl/curl/actions/runs/23598912140/job/68723120977?pr=21104

Follow-up to:
https://github.com/curl/curl-for-win/commit/a26898fe489e2721b709d1eebc3b5e95c7332417
https://github.com/curl/curl-for-win/commit/17f2fb3ead747d375ea1d6c08e649efd17017c8b
https://github.com/curl/curl-for-win/commit/6dd6e47e9876ffe615544977ff6cfd684e6d421b
https://github.com/curl/curl-for-win/commit/b461404b5a800bcfebe34d524d9c6a32bc08b9a5

Closes #21105

4 weeks agoperl: harden external command invocations
Viktor Szakats [Sun, 22 Mar 2026 01:42:17 +0000 (02:42 +0100)] 
perl: harden external command invocations

In `adddocsref.pl`, `checksrc-all.pl`, `singleuse.pl` and tests 307, 1013,
1022, 1275, 1707, 1708, 1710.

Closes #21097

4 weeks agocmake: add CMake Config-based dependency detection for c-ares, wolfSSL
Viktor Szakats [Wed, 25 Mar 2026 19:05:32 +0000 (20:05 +0100)] 
cmake: add CMake Config-based dependency detection for c-ares, wolfSSL

For wolfSSL it requires v5.2.1+, and with 5.9.0+ it's also supported when
wolfSSL was built with autotools.

Follow-up to 8fce3e17e6cb310cd6dbe38ff14869b8fe5827d2 #20814

Closes #21098

4 weeks agoDEPRECATE.md: fix copy-and-paste mistaken subtitles
Daniel Stenberg [Thu, 26 Mar 2026 09:46:44 +0000 (10:46 +0100)] 
DEPRECATE.md: fix copy-and-paste mistaken subtitles

Closes #21102

4 weeks agodocs/VERIFY.md: verify curl
Daniel Stenberg [Tue, 24 Mar 2026 11:58:21 +0000 (12:58 +0100)] 
docs/VERIFY.md: verify curl

Don't trust, verify!

Closes #21085

4 weeks agocleancmd.pl: remove markdown links before spellcheck
Daniel Stenberg [Tue, 24 Mar 2026 14:51:15 +0000 (15:51 +0100)] 
cleancmd.pl: remove markdown links before spellcheck

Closes #21085

4 weeks agolocation/follow: mention netrc
Daniel Stenberg [Wed, 25 Mar 2026 09:31:11 +0000 (10:31 +0100)] 
location/follow: mention netrc

Closes #21091

4 weeks agomd4, md5: switch to wolfCrypt API in wolfSSL builds
Viktor Szakats [Tue, 24 Mar 2026 23:49:38 +0000 (00:49 +0100)] 
md4, md5: switch to wolfCrypt API in wolfSSL builds

Replacing the OpenSSL-like compatibility interface, and syncing with other
hashes, when building with wolfSSL.

Also: stop stomping on OpenSSL public MD4 symbols. This makes the wolfSSL
coexist workaround unnecessary, while also syncing up with MD5 sources.

After this patch the only remaining reference to wolfSSL's OpenSSL
compatibility layer is in `lib/curl_ntlm_core.c`.

Closes #21093

4 weeks agocurl_ntlm_core: drop redundant PP condition
Viktor Szakats [Wed, 25 Mar 2026 14:46:32 +0000 (15:46 +0100)] 
curl_ntlm_core: drop redundant PP condition

`LIBWOLFSSL_VERSION_HEX` is always present in supported wolfSSL
versions.

Closes #21096

4 weeks agospacecheck: verify filename lengths and characters
Viktor Szakats [Wed, 25 Mar 2026 12:19:09 +0000 (13:19 +0100)] 
spacecheck: verify filename lengths and characters

Maximum filename length 64, of which 48 maximum for the filename part.
Allowed characters: `A-Za-z0-9/._-`.

Also:
- rename a file to pass the check.
- init max constants outside the loop.
- minor fix to an error message.
  Follow-up to 62d77b12fce55d3481bb0b2e70e0f921c8cbfe5e #21087

Closes #21095

4 weeks agomulti: multi_wait fixes after #20832
Stefan Eissing [Mon, 23 Mar 2026 10:05:07 +0000 (11:05 +0100)] 
multi: multi_wait fixes after #20832

The refactoring in #20832 introduced some inconsistencies between
windows and posix handling, pointed out by reviews. Fix them:

- rename `wait_on_nop` back to `extrawait` as it was called before
- use multi_timeout() to shorten the user supplied timeout for
  both windows/posix in the same way
- remove the extra multi_timeout() check in the posix function
- Add the multi's wakeup socket for monitoring only when there
  are other sockets to poll on or when the caller wants the
  extra waiting time.

Closes #21072

4 weeks agoproxy: chunked response, error code
Stefan Eissing [Tue, 24 Mar 2026 09:03:18 +0000 (10:03 +0100)] 
proxy: chunked response, error code

Add test1715 to check proper handling of chunked transfer
encoding in CONNECT responses. Change proxy error code from
56 (RECV_ERROR) for everything to 7 (COULDNT_CONNECT) when
the server response could be read successfully, but establishing
the connection is not possible (http status code wrong).

Adapt several test expectations from 56 to 7.

Closes #21084

4 weeks agoasync-thrdd: use thread queue for resolving
Stefan Eissing [Tue, 24 Mar 2026 11:50:53 +0000 (12:50 +0100)] 
async-thrdd: use thread queue for resolving

Use a thread queue and pool for asnyc threaded DNS resolves.
Add pytest test_21_* for verification.

Add `CURLMOPT_RESOLVE_THREADS_MAX` to allow applications to
resize the thread pool used.

Add `CURLMOPT_QUICK_EXIT` to allow applications to skip thread
joins when cleaning up a multi handle. Multi handles in
`curl_easy_perform()` inherit this from `CURLOPT_QUICK_EXIT`.

Add several debug environment variables for testing.

Closes #20936

4 weeks agourl: do not reuse a non-tls starttls connection if new requires TLS
Daniel Stenberg [Tue, 24 Mar 2026 07:35:08 +0000 (08:35 +0100)] 
url: do not reuse a non-tls starttls connection if new requires TLS

Reported-by: Arkadi Vainbrand
Closes #21082

4 weeks agospacecheck: check long lines and repeat spaces, fix fallouts
Viktor Szakats [Tue, 24 Mar 2026 13:42:39 +0000 (14:42 +0100)] 
spacecheck: check long lines and repeat spaces, fix fallouts

Verify if lines are not longer than 192 characters. Also verify if lines
have less than 79 repeat spaces (and fix one fallout).

To improve readability by avoiding long lines and to prevent adding
overly long lines with text that may go unnoticed in an editor or diff
viewer.

In addition to pre-existing line length limits: 79 for C, 132 for CMake
sources.

Also:
- spacecheck: fix/harden allowlist regexes.
- spacecheck: tidy-up quotes and simplify escaping.
- spacecheck: allow folding strings with repeat spaces.
- GHA: fix a suppressed shellcheck warning.
- GHA/macos: simplify by dropping brew bundle.
- test1119.pl: precompile a regex.
- FAQ.md: delete very long link to a Windows 7/2008 support article
  that's lost it relevance.

Closes #21087

4 weeks agosha256, sha512_256: switch to wolfCrypt API
Viktor Szakats [Tue, 24 Mar 2026 22:00:02 +0000 (23:00 +0100)] 
sha256, sha512_256: switch to wolfCrypt API

Replacing the OpenSSL-like compatibility interface, and syncing with
existing API use within lib/wolfssl.c for SHA-256.

Ref: https://www.wolfssl.com/documentation/manuals/wolfssl/group__SHA.html

Follow-up to 28f0932073bfbcb977e2638e137e2519cb2b14e2 #21077
Follow-up to 988b352f917151452c4f1483214ba7012299b1e2 #21078

Closes #21090

5 weeks agosha256: support delegating to wolfSSL API
Viktor Szakats [Mon, 23 Mar 2026 21:35:24 +0000 (22:35 +0100)] 
sha256: support delegating to wolfSSL API

Offered by wolfSSL v3.11.0+ (2017-05-04).

Closes #21078

5 weeks agocurl_sha512_256: support delegating to wolfSSL API
Viktor Szakats [Mon, 23 Mar 2026 17:23:39 +0000 (18:23 +0100)] 
curl_sha512_256: support delegating to wolfSSL API

Offered by wolfSSL v5.0.0+ (2021-11-01).

Closes #21077

5 weeks agoratelimit: reset on start
Stefan Eissing [Tue, 24 Mar 2026 12:41:51 +0000 (13:41 +0100)] 
ratelimit: reset on start

On any `Curl_rlimit_start()` the rate limit needs to reset its
values before calculating the effective step duration and adjust
the tokens/burst per step.

Add two fields to the struct to remember the original values.

Closes #21086

5 weeks agowolfssl: document v5.0.0 (2021-11-01) as minimum required
Viktor Szakats [Mon, 23 Mar 2026 21:57:40 +0000 (22:57 +0100)] 
wolfssl: document v5.0.0 (2021-11-01) as minimum required

The previously documented version was based on version checks made in
the source. In practice though, curl doesn't build with <5.0.0.

Also:
- bump main internal version check.
- drop superfluous internal version checks.

Closes #21080

5 weeks agotool_setopt: return error on OOM correctly
Daniel Stenberg [Tue, 24 Mar 2026 08:35:39 +0000 (09:35 +0100)] 
tool_setopt: return error on OOM correctly

When generating mime code for the --libcurl option.

Follow-up to acdb48272a53fe97f63e5

Spotted by Codex Security

Closes #21083

5 weeks agoOS400: add new definitions to the ILE/RPG binding.
Patrick Monnerat [Sun, 22 Feb 2026 10:37:16 +0000 (11:37 +0100)] 
OS400: add new definitions to the ILE/RPG binding.

Also update supported protocols list in README.OS400.

Fixes #20672
Closes #21066

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 24 Mar 2026 08:09:30 +0000 (09:09 +0100)] 
RELEASE-NOTES: synced

5 weeks agoDEPRECATE: remove NTLM, SMB and local crypto implementations
Daniel Stenberg [Mon, 23 Mar 2026 21:34:39 +0000 (22:34 +0100)] 
DEPRECATE: remove NTLM, SMB and local crypto implementations

Closes #21079

5 weeks agotool_getparam: use correct free function for libcurl memory
Daniel Stenberg [Mon, 23 Mar 2026 14:04:21 +0000 (15:04 +0100)] 
tool_getparam: use correct free function for libcurl memory

Memory returned from curl_easy_escape() should be fred with curl_free()
to avoid surprises.

Follow-up to f37840a46e5eddaf109c16fa7

Spotted by Codex Security
Closes #21075

5 weeks agocurl_version_info.md: clarify age details
Daniel Stenberg [Sun, 22 Mar 2026 10:50:33 +0000 (11:50 +0100)] 
curl_version_info.md: clarify age details

The argument is not used.

Fixes #21052
Reported-by: Dan Fandrich
Closes #21059

5 weeks agolib: add thread pool and queue
Stefan Eissing [Fri, 13 Mar 2026 09:22:07 +0000 (10:22 +0100)] 
lib: add thread pool and queue

- new source files for thread pool and queue
- test cases 3217 and 3218 for them
- internal documentation

Closes #20916

5 weeks agotest2405: require wakeup
Daniel Stenberg [Mon, 23 Mar 2026 13:55:03 +0000 (14:55 +0100)] 
test2405: require wakeup

To get the correct file descriptor count

Reported-by: Marcel Raad
Fixes #21069
Closes #21074

5 weeks agolib1560: verify more URLs
Daniel Stenberg [Mon, 23 Mar 2026 12:56:12 +0000 (13:56 +0100)] 
lib1560: verify more URLs

- control codes at various places in URL, even when URL encoding
  is requested

- verify zone id extraction more

Closes #21071

5 weeks agoconfig2setopts: make --capath work in proxy disabled builds
Daniel Stenberg [Sun, 22 Mar 2026 17:17:53 +0000 (18:17 +0100)] 
config2setopts: make --capath work in proxy disabled builds

Follow-up to 95e8515ca0801c2b1aacbdad0

Spotted by Codex Security

Closes #21063

5 weeks agotest1714: verify telnet download with --max-filesize
Daniel Stenberg [Fri, 20 Mar 2026 09:33:12 +0000 (10:33 +0100)] 
test1714: verify telnet download with --max-filesize

(disabled on Windows because of hangs)

Closes #21023

5 weeks agogenserv.pl: make external calls safe
Viktor Szakats [Wed, 18 Mar 2026 00:39:18 +0000 (01:39 +0100)] 
genserv.pl: make external calls safe

By passing command-line as separate arguments instead of using a single
string. This needs skipping the shell, so rework redirections to use
Perl `open3()`.

Also explored to use `-out` to avoid redirections, but it makes the
command-line incompatible with some OpenSSL implementations/versions
(e.g. on default macOS), and would still need a solution for
`2>/dev/null`.

Ref: https://perldoc.perl.org/IPC::Open3

Closes #20971

5 weeks agourldata: make hstslist only present in HSTS builds
Daniel Stenberg [Mon, 23 Mar 2026 07:56:44 +0000 (08:56 +0100)] 
urldata: make hstslist only present in HSTS builds

Closes #21068

5 weeks agonetrc: remove unused parsenetrc() macro for netrc-disabled
Daniel Stenberg [Mon, 23 Mar 2026 07:51:02 +0000 (08:51 +0100)] 
netrc: remove unused parsenetrc() macro for netrc-disabled

When netrc is disabled, this macro is unused (and wrong).

Closes #21067

5 weeks agourlapi: fix handling of "file:///"
Daniel Stenberg [Mon, 23 Mar 2026 08:19:45 +0000 (09:19 +0100)] 
urlapi: fix handling of "file:///"

When the path is exactly one byte, a single slash.

Extended test 1560 to verify.

Found by Codex Security

Closes #21070

5 weeks agourlapi: remove redundant condition in dedotdotify
Daniel Stenberg [Sun, 22 Mar 2026 22:53:35 +0000 (23:53 +0100)] 
urlapi: remove redundant condition in dedotdotify

Bonus: remove two variables, clear up some comments.

Poined out by CodeSonar

Closes #21065

5 weeks agotool_operate: fix memory-leak on failed uploads
Daniel Stenberg [Sun, 22 Mar 2026 12:08:43 +0000 (13:08 +0100)] 
tool_operate: fix memory-leak on failed uploads

Add test case 1673 to do repeated upload failures and verify there is no
leak. This proved a previous leak and now it verifies the fix.

Reported-by: James Fuller
Closes #21062

5 weeks agoasyn-thrdd: fix clang-tidy unused value warning
Viktor Szakats [Sun, 22 Mar 2026 11:55:42 +0000 (12:55 +0100)] 
asyn-thrdd: fix clang-tidy unused value warning

with `-DCURL_DISABLE_SOCKETPAIR=ON`.

```
lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~
```

Closes #21061

5 weeks agognutls: fix clang-tidy warning with !verbose
Viktor Szakats [Sun, 22 Mar 2026 11:40:23 +0000 (12:40 +0100)] 
gnutls: fix clang-tidy warning with !verbose

with
`-DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_USE_GNUTLS=ON -DCURL_CLANG_TIDY=ON`.

```
lib/vtls/gtls.c:268:7: error: Value stored to 'strerr' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  268 |       strerr = gnutls_strerror(rc);
      |       ^        ~~~~~~~~~~~~~~~~~~~
```

Closes #21060

5 weeks agomulti.h: add CURLMNWC_CLEAR_ALL
Daniel Stenberg [Sat, 21 Mar 2026 22:06:02 +0000 (23:06 +0100)] 
multi.h: add CURLMNWC_CLEAR_ALL

The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS were
duplicates (both set to 1), so they cannot be distinguished and both
actions fire.

This shipped in public releases since 8.16.0 to and include 8.19.0.

This fix adds CURLMNWC_CLEAR_ALL to be the new 1, and it now implies all
bits. The DNS and CONNS defines get two new bits (2, 4).

Follow-up to 55c045c86338bfcc1de676c496f

Found by Codex Security
Closes #20968

5 weeks agoRevert "md5/md4: enable unaligned access fast path on powerpc64"
Daniel Stenberg [Sun, 22 Mar 2026 10:38:05 +0000 (11:38 +0100)] 
Revert "md5/md4: enable unaligned access fast path on powerpc64"

This reverts commit 21fc17b265ca32c8a5a768dc7cd730754a104740.

That was not properly thought through. PowerPC can run in either endian
and the preprocessor does not know which.

Ref: #20985
Closes #21058

5 weeks agoFAQ.md: point archive.org link to the original, no-JS, revision [ci skip]
Viktor Szakats [Sun, 22 Mar 2026 12:25:34 +0000 (13:25 +0100)] 
FAQ.md: point archive.org link to the original, no-JS, revision [ci skip]

To make it pass mdlinkcheck, open faster, w/o cookie banner, and not
need special URL format to make JS happy.

Ref: 1dc0ce956226186f40fdda072e7bd6c0cc035597

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 22 Mar 2026 11:02:49 +0000 (12:02 +0100)] 
RELEASE-NOTES: synced

5 weeks agolib: make SMB support opt-in
Daniel Stenberg [Sat, 21 Mar 2026 14:37:58 +0000 (15:37 +0100)] 
lib: make SMB support opt-in

The SMB protocol has weak security and is rarely used these days.

Note that SMB also requires NTLM enabled.

Closes #20846

5 weeks agoGHA/curl-for-win: enable c-ares with HTTPS-RR in an existing job
Viktor Szakats [Fri, 20 Mar 2026 13:08:22 +0000 (14:08 +0100)] 
GHA/curl-for-win: enable c-ares with HTTPS-RR in an existing job

c-ares builds have been sped up within curl-for-win using, pre-fills. It
allows building it with acceptable performance, making it practical to
use it, alongside HTTPS-RR, in curl CI and possibly in curl-for-win. It
has been enabled in its dev branch for a while.

Ref: https://github.com/curl/curl-for-win/commit/61a73541201692136af12548737781f79f1ecd64

Closes #21032

5 weeks agocf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR + clang 21
Viktor Szakats [Fri, 20 Mar 2026 12:41:25 +0000 (13:41 +0100)] 
cf-https-connect: silence `-Wimplicit-int-enum-cast` with HTTPS-RR + clang 21

Fixing (seen in curl-for-win dev branch):
```
In file included from _a64-linux-gnu-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:34:
lib/cf-https-connect.c:681:28: error: implicit conversion from 'unsigned char' to enumeration type 'enum alpnid' is invalid in C++ [-Werror,-Wimplicit-int-enum-cast]
  681 |         enum alpnid alpn = rr->alpns[i];
      |                     ~~~~   ^~~~~~~~~~~~e
```

Ref: #21032

Closes #21057

5 weeks agolib: drop support for < c-ares 1.16.0
Daniel Stenberg [Sat, 21 Mar 2026 13:15:53 +0000 (14:15 +0100)] 
lib: drop support for < c-ares 1.16.0

Closes #20911

5 weeks agomd5/md4: enable unaligned access fast path on powerpc64
Scott Boudreaux [Wed, 18 Mar 2026 15:56:09 +0000 (10:56 -0500)] 
md5/md4: enable unaligned access fast path on powerpc64

PowerPC64 (both big-endian and little-endian) supports efficient
unaligned memory access, similar to x86. This extends the existing
fast path that avoids byte-by-byte loads in the MD5 and MD4 SET/GET
macros.

On POWER8 ppc64le, this eliminates 3 shifts + 3 ORs per 32-bit word
load, replacing them with a single lwz (or lwbrx on big-endian).

Co Authored By Claude Opus 4.6 (1M context)

Closes #20985

5 weeks agoprogress: count amount of data "delivered" to application
Daniel Stenberg [Mon, 2 Mar 2026 10:02:03 +0000 (11:02 +0100)] 
progress: count amount of data "delivered" to application

... and apply the CURLOPT_MAXFILESIZE limit (if set) on that as well.
This effectively protects the user against "zip bombs".

Test case 1618 verifies using a 14 byte brotli payload that otherwise
explodes to 102400 zero bytes.

Closes #20787

5 weeks agonetrc: skip malformed macdef lines
Daniel Stenberg [Sat, 21 Mar 2026 14:23:28 +0000 (15:23 +0100)] 
netrc: skip malformed macdef lines

When skipping macdef lines inside netrc files, ignore it completely and
do not tokenize or bail out on bad quotes.

Verify in test 1672

Follow-up to 3b43a05e000aa8f65bda51

Spotted by Codex Security
Closes #21049

5 weeks agotest1668: unit test the FTP 213 time response parser
Daniel Stenberg [Sat, 21 Mar 2026 17:18:53 +0000 (18:18 +0100)] 
test1668: unit test the FTP 213 time response parser

Should make it harder to introduce regressions.

Closes #21051

5 weeks agobadwords-all: stop checking source code comments
Daniel Stenberg [Sat, 21 Mar 2026 13:43:38 +0000 (14:43 +0100)] 
badwords-all: stop checking source code comments

The code runs under different rules than documentation and these checks
cause too much friction with too little gain.

Leave checking of the public include files since they are almost
documentation.

Closes #21048

5 weeks agohostip: drop guard from `Curl_resolver_error()` definition
Viktor Szakats [Sat, 21 Mar 2026 20:58:36 +0000 (21:58 +0100)] 
hostip: drop guard from `Curl_resolver_error()` definition

To sync with its declaration.

Fixing (seen when building trurl in curl-for-win):
```
ld.lld: error: undefined symbol: Curl_resolver_error
```
Ref: https://github.com/curl/curl-for-win/actions/runs/23388349475/job/68038915761#step:3:7469

Closes #21054

5 weeks agotestcurl.pl: replace shell commands with Perl `rmtree()`
Viktor Szakats [Sat, 21 Mar 2026 18:36:10 +0000 (19:36 +0100)] 
testcurl.pl: replace shell commands with Perl `rmtree()`

Ref: https://perldoc.perl.org/5.8.2/File::Path
Follow-up to e992aa6a54f87f33eafd124cf09f0f70d7d24928

Closes #21053

5 weeks agotool: add check for curlinfo->age when determining if ssh backend is libssh2
Harry Sintonen [Sat, 21 Mar 2026 15:17:57 +0000 (17:17 +0200)] 
tool: add check for curlinfo->age when determining if ssh backend is libssh2

The code failed to check for the version, and could thus read memory
past the existing curl_version_info_data structure. This could lead to a
crash.

Closes #21050

5 weeks agocmake: add CMake Config-based dependency detection
Viktor Szakats [Tue, 3 Mar 2026 13:48:32 +0000 (14:48 +0100)] 
cmake: add CMake Config-based dependency detection

After limiting `find_package()`/`find_dependency()` calls to curl local
Find modules via the `MODULES` keyword, it became possible to detect
dependencies via CMake Configs from within those local Find modules, by
calling `find_package()` again with the `CONFIG` keyword. This patch
implements this. Then maps detection results to the result variables and
curl-specific imported targets the rest of the build expects.

Also honor recently introduced `*_USE_STATIC_LIBS` (experimental) flags
to map to the static target when requested.

This adds CMake Configs as an alternative to the existing `pkg-config`
and `find_path()`/`find_library()` auto-detection methods.

Enabled by default for MSVC, outside vcpkg and when not cross-building.
To enable for other cases, or override the default, you can use
`-DCURL_USE_CMAKECONFIG=ON` or `OFF`.

When enabled, Config detection happens after `pkg-config` and before
`find_path()`/`find_library()`. Using CMake's built-in options, you may
also manually point to the absolute directory holding Config files:

`Libssh2_DIR`, `MbedTLS_DIR`, `NGHTTP2_DIR`, `NGHTTP3_DIR`,
`NGTCP2_DIR` v1.19.0+ (with non-fork OpenSSL only), `Zstd_DIR` v1.4.5+

E.g. `-DMbedTLS_DIR=/path/to/mbedtls/lib/cmake/MbedTLS`

These dependencies typically need to be built with CMake to support
this.

Tagged as experimental.

Refs:
#20013 #19156 #19117
https://github.com/curl/curl/pull/20784#issuecomment-3984318492

Depends-on: fad1ebaecc0c489d38c0a9a155f63fdfd9086907 #20840
Follow-up to 91e06fde1b520bc29c7996749734451e03cd549f #20784
Follow-up to 26c39d8df182a63d28d81ed2b044e6a343519d1a #20015

Closes #20814

5 weeks agoGHA: add NTLM to lots of builds
Daniel Stenberg [Sat, 21 Mar 2026 11:30:31 +0000 (12:30 +0100)] 
GHA: add NTLM to lots of builds

5 weeks agobuild: make NTLM disabled by default
Daniel Stenberg [Sat, 21 Mar 2026 11:30:31 +0000 (12:30 +0100)] 
build: make NTLM disabled by default

NTLM has weak security and does not work over HTTP/2 or HTTP/3.

Enable in cmake or configure to get support for it.

Closes #20698

5 weeks agoDEPRECATE: remove last empty line
Daniel Stenberg [Sat, 21 Mar 2026 14:18:33 +0000 (15:18 +0100)] 
DEPRECATE: remove last empty line

5 weeks agortmp: drop support
Daniel Stenberg [Sat, 21 Mar 2026 11:14:21 +0000 (12:14 +0100)] 
rtmp: drop support

- librtmp has no test cases, makes no proper releases and has not had a
  single commit within the last year

- librtmp parses the URL itself and requires non-compliant URLs for this

- we have no RTMP tests

- RTMP was used by 2.2% of curl users (self-identified in the 2025
  survey)

Closes #20673

5 weeks agoDEPRECATE: fix minor release number typo
Daniel Stenberg [Sat, 21 Mar 2026 13:49:36 +0000 (14:49 +0100)] 
DEPRECATE: fix minor release number typo

5 weeks agocurlx_now(), prevent zero timestamp
Stefan Eissing [Fri, 20 Mar 2026 13:55:53 +0000 (14:55 +0100)] 
curlx_now(), prevent zero timestamp

As code checks `curltime` values for zero and interprets this
as not-initialized or "forever" in several places, make sure
`curlx_now()` never returns a zero timestamp.

Closes #21034

5 weeks agoCURLOPT_HAPROXY_CLIENT_IP.md: mention assuption on data format
Daniel Stenberg [Fri, 20 Mar 2026 22:41:11 +0000 (23:41 +0100)] 
CURLOPT_HAPROXY_CLIENT_IP.md: mention assuption on data format

The user is assumed to pass in correct data. I think we should start
clarifying this in more places.

Closes #21042

5 weeks agoshare: concurrency handling, easy updates
Stefan Eissing [Mon, 9 Mar 2026 14:40:34 +0000 (15:40 +0100)] 
share: concurrency handling, easy updates

Replace the `volatile int dirty` with a reference counter
protected by a mutex when available.

Solve the problem of when to call application's lock function
by adding a volatile flag that indicates a share has been added
to easy handles in its lifetime. That flag ever goes from
FALSE to TRUE, so volatile might work (in the absence of a mutex).

(The problem is that the lock/unlock functions need 2-3
`curl_share_setopt()` invocations to become usable and there
is no way of telling if the third will ever happen. Calling
the lock function before the 3rd setopt may crash the
application.)

When removing a share from an easy handle (or replacing it with
another share), detach the easy connection on a share with a
connection pool.

When cleaning up a share, allow this even if it is still used in
easy handles. It will be destroyed when the reference count
drops to 0.

Closes #20870

5 weeks agohostip: fix !no_signal mixup in resolve refaactor
Stefan Eissing [Sat, 21 Mar 2026 12:49:12 +0000 (13:49 +0100)] 
hostip: fix !no_signal mixup in resolve refaactor

When extracting the resolve case using alarm timers, the check for "we
are not allowed to use signals" was refactored wrong.

Follow-up to 96d5b5c688c48a8f58ded1563ed0c

Closes #21047

5 weeks agoGHA: update dependency rustls/rustls-ffi to v0.15.1
renovate[bot] [Sat, 21 Mar 2026 10:59:13 +0000 (10:59 +0000)] 
GHA: update dependency rustls/rustls-ffi to v0.15.1

Closes #21044

5 weeks agobuild: assume `snprintf()` in `mprintf`, drop feature check
Viktor Szakats [Fri, 27 Feb 2026 15:10:59 +0000 (16:10 +0100)] 
build: assume `snprintf()` in `mprintf`, drop feature check

- it was already required for `curl_*printf()` float/double support.
- some curl tests always fail without it.
- it was already assumed to be present to build test servers.
  Source code did not check for `HAVE_SNPRINTF` detection variable.
- it was already required to build examples.

Windows builds stopped using this detection and the function via earlier
commits.

Follow-up to 64f28b8f8859fc80816f7db3b5c4b6f2fd84bd27 #20765
Follow-up to 935b1bd4544a23a91d68ffb9f86983e92747e9a5 #9570 #9569

Closes #20763

5 weeks agocmake: drop support for CMake 3.17 and older
Viktor Szakats [Wed, 26 Nov 2025 18:07:19 +0000 (19:07 +0100)] 
cmake: drop support for CMake 3.17 and older

Require CMake 3.18 (2020-07-15) or newer, up from 3.7 (2016-11-11)
prior to this patch.

This requirement also applies to the distributed `curl-config.cmake`.

To allow dropping compatibility code maintained for old versions, and to
use features which were unpractical in separate code paths. Also to make
testing, documentation and development easier, CI builds faster due to
CMake performance improvements over time. (e.g. integration tests on
macOS run 8x faster (10 minutes is now under 1.5m) in CI, 2.5x faster on
Windows.)

CMake offers pre-built binaries for major platforms. They work without
an install step, just by unpacking and pointing the cmake command to
them. Making upgrades easy in many cases:
https://cmake.org/download/
https://cmake.org/files/
https://github.com/Kitware/CMake/releases

CMake 3.18 brings these feature as generally available when building or
consuming curl/libcurl:

LTO support, improved performance, `pkg-config` and interface target
support, `OBJECT` target (for faster libcurl builds), modern invocation
with `-S`/`-B` options, better support for custom linker options,
FetchContent, `GnuTLS::GnuTLS` target, `--verbose` and `--install`
options, `CMAKE_GENERATOR` env, last but not least unity mode and Ninja
generator.

For maximum build speed, use:
`-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON`

As for deprecations, C++11 is required to build CMake itself, which may
be a limit on some platforms. autotools continues to cover them.

Follow-up to 9bcdfb3809a41327054421368bdea77ea17e6f90 #20408
Follow-up to a7c974e038572bd1d4a653afbd6de5fad5a10215 #19902
Follow-up to dfbe035c8b39b056a234bc76df3f384f7a7a24af #10161
Discussion: https://github.com/curl/curl/discussions/18704

Closes #20407

5 weeks agoscripts: drop redundant double-quotes: `"$var"` -> `$var` (Perl)
Viktor Szakats [Thu, 19 Mar 2026 00:15:43 +0000 (01:15 +0100)] 
scripts: drop redundant double-quotes: `"$var"` -> `$var` (Perl)

Closes #21009

5 weeks agocurl/curl.h: replace recursive macros with C++-friendly method to enforce 3 args
Viktor Szakats [Tue, 24 Feb 2026 11:45:59 +0000 (12:45 +0100)] 
curl/curl.h: replace recursive macros with C++-friendly method to enforce 3 args

Certain uses may still trigger a C compiler warning
`-Wdisabled-macro-expansion` after this, e.g. when the call is wrapped
in the `CURL_IGNORE_DEPRECATION()` macro as seen in docs/examples.

Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/issues/20682#issuecomment-3949788664

Follow-up to ee9b000438bd6e4cecc8a933804397a55ad0f7b8 #20686
Follow-up to daa6b27b4d998d62c8198b4fe167199cc7bf0064 #20597

Closes #20709

5 weeks agolibtest: drop duplicate include
Viktor Szakats [Sat, 21 Mar 2026 11:52:53 +0000 (12:52 +0100)] 
libtest: drop duplicate include

Include moved to `unitcheck.h` earlier.

Follow-up to 96d5b5c688c48a8f58ded1563ed0c5c47c877e32 #20864
Ref: 8a1f361716ab0bbf1e15f8a9914b9f1f07855bae #21024

Closes #21046

5 weeks agotool_operhlp: propagate low-level OOM in `add_file_name_to_url()`
Viktor Szakats [Sat, 21 Mar 2026 00:31:29 +0000 (01:31 +0100)] 
tool_operhlp: propagate low-level OOM in `add_file_name_to_url()`

Bug: https://github.com/curl/curl/pull/21011#discussion_r2961678069

Closes #21043

5 weeks agolib: move all UNITTEST prototypes to C files (cont.)
Viktor Szakats [Fri, 20 Mar 2026 11:55:46 +0000 (12:55 +0100)] 
lib: move all UNITTEST prototypes to C files (cont.)

Follow-up to 98d8e82c7471232639841eb63e16bb979a30acb4 #21014

Closes #21040

5 weeks agodnscache.h: include curlx/timeval.h for struct curltime
Daniel Stenberg [Sat, 21 Mar 2026 11:20:16 +0000 (12:20 +0100)] 
dnscache.h: include curlx/timeval.h for struct curltime

Follow-up to 96d5b5c688c48a8f5

Closes #21045

5 weeks agoftp: make the MDTM date parser stricter (again)
Daniel Stenberg [Fri, 20 Mar 2026 22:27:55 +0000 (23:27 +0100)] 
ftp: make the MDTM date parser stricter (again)

A previous refactor made the parser more lenient and this takes it back
to making sure only ascii digits are accepted.

Added test 1684 to verify

Follow-up to 304b5183fda43b5c5be

Pointed out by Codex Security

Closes #21041

5 weeks agodnscache: own source file, improvements
Stefan Eissing [Fri, 6 Mar 2026 08:22:26 +0000 (09:22 +0100)] 
dnscache: own source file, improvements

- Rename `Curl_resolv_unlink()` to `Curl_dns_entry_unlink()`.
- Change `Curl_dnscache_get()` to return CURLcode result. Returns
  now `CURLE_COULDNT_RESOLVE_HOST` for "negative" cache entries.
- Add `Curl_dnscache_add_negative()` to put a "negative" entry
  into the cache.

Closes #20864

5 weeks agoopenssl channel_binding: lookup digest algorithm without NID
Stefan Eissing [Thu, 26 Feb 2026 09:21:31 +0000 (10:21 +0100)] 
openssl channel_binding: lookup digest algorithm without NID

Use an alternate OpenSSL API to get the digest algorithm tied
to a certificate signature to compute the channel binding.

Fixes #20590
Reported-by: Rob Crittenden
Closes #20734

5 weeks agomulti: improve wakeup and wait code
Stefan Eissing [Fri, 6 Mar 2026 09:10:55 +0000 (10:10 +0100)] 
multi: improve wakeup and wait code

- Split WINSOCK and POSIX code in `multi_wait()` as the ifdef'ery
  was becoming unreadable
- define `ENABLE_WAKEUP` to mean the wakeup socketpair is enabled,
  no additional USE_WINSOCK check needed. Under WINSOCK
  `ENABLE_WAKEUP` is not defined, so it's availability is as before
  under the double defined() checks
- When the multi handle has "alive" transfers, the admin handle's
  pollset include the wakeup receive socket. This results in the
  admin handle running when someone uses `curl_multi_wakeup()`.
- Without any "alive" transfers, the wakeup socket is removed from
  the pollset. Otherwise, event based processing would never finish,
  eg. leave the event loop.
- The wakeup socket was never registered for event processing before,
  e.g. `curl_multi_wakeup()` never worked in that mode.
- Adjust test exepectations on socket callback invocations and
  number of sockets appearing in waitfds sets.

Closes #20832

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 20 Mar 2026 21:28:50 +0000 (22:28 +0100)] 
RELEASE-NOTES: synced

Bump curlver to 8.20.0 for pending release

5 weeks agoGHA/windows: disable `taskkill` in torture jobs
Viktor Szakats [Fri, 20 Mar 2026 18:00:44 +0000 (19:00 +0100)] 
GHA/windows: disable `taskkill` in torture jobs

As an experiment.

Also:
- processhelp.pm: log when `taskkill` is force-skipped.

Ref: #21035

Follow-up to f450f3801b6b9dff0ea280f5fb4bf28203f7b313 #19897
Follow-up to 2701ac6a4d16a62130dad05be1c484903b8545c7 #19421

Closes #21039

5 weeks agowolfssl: fix handling of abrupt connection close
Stefan Eissing [Thu, 19 Mar 2026 09:33:08 +0000 (10:33 +0100)] 
wolfssl: fix handling of abrupt connection close

A closed connection without TLS notify shutdowns, has been reported as a
correct EOF instead of an error. Fix the error handling in wolfSSL
backend receive handling.

Spotted by Codex Security

Closes #21002

5 weeks agotransfer: enable custom methods again on next transfer
Daniel Stenberg [Fri, 20 Mar 2026 16:28:03 +0000 (17:28 +0100)] 
transfer: enable custom methods again on next transfer

`http_ignorecustom` is set on redirect handling but was not reset
between transfers, so once a redirect occurs in the new follow modes,
custom request methods were ignored for later transfers on the same
handle.

Follow-up to fb13923dd67d5196c47e8d

Detected by Codex Security

Closes #21037

5 weeks agoprotcol.h: fix the CURLPROTO_MASK
Daniel Stenberg [Fri, 20 Mar 2026 12:55:47 +0000 (13:55 +0100)] 
protcol.h: fix the CURLPROTO_MASK

It had an 'f' too few. Also provide CURLPROTO_WS* unconditionally
internally, so that code can depend on them in all builds.

Follow-up to cd5ca80f00d2d9f0fe7

Spotted by Codex Security

Test case 3219 added to catch this next time.

Closes #21031

5 weeks agotool_operhlp: fix `add_file_name_to_url()` result on OOM
Viktor Szakats [Thu, 19 Mar 2026 14:47:05 +0000 (15:47 +0100)] 
tool_operhlp: fix `add_file_name_to_url()` result on OOM

Return `CURLE_OUT_OF_MEMORY` instead of `CURLE_URL_MALFORMAT` when
`curl_url()`, `curl_easy_escape()`, or `curl_maprintf()` calls failed.

Found by Codex Security

Also reuse deinit code from a success branch.

Closes #21011

5 weeks agourldata: make speeder_c uint32
Daniel Stenberg [Fri, 20 Mar 2026 14:55:33 +0000 (15:55 +0100)] 
urldata: make speeder_c uint32

This counter is meant to virtually never wrap.

Follow-up to e3691612ea1

Spotted by Codex Security

Closes #21036

5 weeks agounit1627.c: remove a newline
Daniel Stenberg [Fri, 20 Mar 2026 15:55:19 +0000 (16:55 +0100)] 
unit1627.c: remove a newline

5 weeks agoprotocol: use scheme names lowercase
Daniel Stenberg [Fri, 20 Mar 2026 13:28:51 +0000 (14:28 +0100)] 
protocol: use scheme names lowercase

When composing the <scheme>_proxy environment variable, we assume the
handler->scheme name is already lowercase.

This makes unit test 1627 verify that is the case.

Follow-up to c294f9cb564a2d550826cd5

Spotted by Codex Security

Closes #21033

5 weeks agofile: init fd to -1 to prevent close fd 0 on early failure
Daniel Stenberg [Fri, 20 Mar 2026 12:39:02 +0000 (13:39 +0100)] 
file: init fd to -1 to prevent close fd 0 on early failure

Spotted by Codex Security

Closes #21029

5 weeks agogetinfo: initialize `PureInfo` field `used_proxy`
Viktor Szakats [Fri, 20 Mar 2026 00:56:09 +0000 (01:56 +0100)] 
getinfo: initialize `PureInfo` field `used_proxy`

Found by Codex Security

Follow-up to cc04c7367740bb6db0e47368247b8b0c70c376cb #12719

Closes #21020

5 weeks agourl: use the socks type for socks proxy
Daniel Stenberg [Fri, 20 Mar 2026 10:06:47 +0000 (11:06 +0100)] 
url: use the socks type for socks proxy

Reported by Codex Security

Closes #21025

5 weeks agox509asn1: fixed and adapted for ASN1tostr unit testing
Daniel Stenberg [Thu, 19 Mar 2026 15:51:07 +0000 (16:51 +0100)] 
x509asn1: fixed and adapted for ASN1tostr unit testing

- move defines to header file
- make bit2str require < 8 unused bits
- make bool strings stricter
- make UTime2str show + or - for custom time zones
- removed unused 'type' argument to ASN1tostr() function
- fix int2str for negative values. All values below 10000 are now shown
  in decimal properly, also possibly negative values.

Add unit test 1667 to verify ASN1tostr

Closes #21013

5 weeks agotool_operate: drop the scheme-guessing in the -G handling
Daniel Stenberg [Wed, 18 Mar 2026 23:12:33 +0000 (00:12 +0100)] 
tool_operate: drop the scheme-guessing in the -G handling

Prior to this, -G would override the scheme set with --proto-default and
revert back to guessing the scheme based on the hostname.

Add test 2008 to verify the fix

Spotted by Codex Security

Closes #20992