]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
6 months agohttp_chunks: narrow variable scope for 'trlen'
Daniel Stenberg [Mon, 12 May 2025 07:07:50 +0000 (09:07 +0200)] 
http_chunks: narrow variable scope for 'trlen'

CodeSonar found a case where it would be assigned but never used and
narrowing the scope makes sense anyway.

Closes #17316

6 months agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 May 2025 05:47:34 +0000 (07:47 +0200)] 
RELEASE-NOTES: synced

6 months agomprintf: provide hex digits for escape.c to use
Daniel Stenberg [Sun, 11 May 2025 12:56:16 +0000 (14:56 +0200)] 
mprintf: provide hex digits for escape.c to use

Since they need the exact same set, use the same set. The mprintf string
was longer than it had to be.

Closes #17311

6 months agomprintf: remove outdated comment about SIZEOF_SIZE_T
Daniel Stenberg [Sun, 11 May 2025 21:40:53 +0000 (23:40 +0200)] 
mprintf: remove outdated comment about SIZEOF_SIZE_T

It was now plain wrong

Closes #17312

6 months agoinet_ntop: rename curlx_inet_ntop to Curl_inet_ntop
Daniel Stenberg [Sun, 11 May 2025 21:48:10 +0000 (23:48 +0200)] 
inet_ntop: rename curlx_inet_ntop to Curl_inet_ntop

It is not part of the curlx club.

Closes #17313

6 months agocurl_version_info.md: clarify ssl_version for MultiSSL
Jay Satiro [Sat, 10 May 2025 07:43:04 +0000 (03:43 -0400)] 
curl_version_info.md: clarify ssl_version for MultiSSL

- Clarify that the ssl_version in MultiSSL builds contains all SSL
  backend names with the inactive backend names in parentheses.

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

6 months agotimeval.c: #include fix
Daniel Stenberg [Sun, 11 May 2025 10:24:10 +0000 (12:24 +0200)] 
timeval.c: #include fix

6 months agotest1621: Improve stripcredentials tests
Dan Fandrich [Wed, 7 May 2025 06:39:22 +0000 (23:39 -0700)] 
test1621: Improve stripcredentials tests

- add more unusual input cases
- add a valid non-http protocol
- fix tests so an input that should be stripped but isn't is a failure
- fix detection of when stripcredentials() would be available to test
- avoid using a NULL pointer

Closes #17304

6 months agomime: reuse the base64 string from the base64 code
Daniel Stenberg [Sat, 10 May 2025 09:12:22 +0000 (11:12 +0200)] 
mime: reuse the base64 string from the base64 code

Avoids duplicating an identical string here.

Closes #17309

6 months agobase64: pass in the padding byte separately
Daniel Stenberg [Sat, 10 May 2025 09:05:56 +0000 (11:05 +0200)] 
base64: pass in the padding byte separately

The makes the string with base64 octets "pure" to be used elsewhere as
well.

Closes #17309

6 months agocurl: fix memory leak when -h is used in config file
Daniel Stenberg [Fri, 9 May 2025 21:43:22 +0000 (23:43 +0200)] 
curl: fix memory leak when -h is used in config file

Reported-by: antypanty on hackerone
Add test 748 to reproduce and verify fix

Closes #17306

6 months agoCURLMOPT_TIMERFUNCTION.md: correct the example
Daniel Stenberg [Fri, 9 May 2025 13:41:48 +0000 (15:41 +0200)] 
CURLMOPT_TIMERFUNCTION.md: correct the example

Fixes #17301
Reported-by: Dirk Feytons
Closes #17303

6 months agowindows: fix to preserve error code in `curlx_winapi_strerror()`
Viktor Szakats [Fri, 9 May 2025 13:18:51 +0000 (15:18 +0200)] 
windows: fix to preserve error code in `curlx_winapi_strerror()`

Drop the interim macro `PRESERVE_WINDOWS_ERROR_CODE` and always preserve
error code for `_WIN32`. To make sure this is always done in
`curlx_winapi_strerror()`.

Follow-up to c74d3e10d2935a9a37ffe6b2f7a4ecb0f81e974f #17299

Closes #17302

6 months agocurlx: move curlx_inet_pton
Daniel Stenberg [Fri, 9 May 2025 11:26:00 +0000 (13:26 +0200)] 
curlx: move curlx_inet_pton

Used by test server code.

Closes #17300

6 months agocurlx: add curlx_winapi_ functions
Daniel Stenberg [Fri, 9 May 2025 08:21:53 +0000 (10:21 +0200)] 
curlx: add curlx_winapi_ functions

Split them out from lib/strerror. Used by test code.

Closes #17299

6 months agotests: stop using libcurl's strdup
Daniel Stenberg [Thu, 8 May 2025 21:29:24 +0000 (23:29 +0200)] 
tests: stop using libcurl's strdup

It is not provided as a curlx function so should not be used outside of
libcurl.

I strongly suspect that no system we build the test suite on lack strdup
so this will not cause any harm.

The private version was added in b0936b800719f915ff2a59a for Ultrix.

Closes #17297

6 months agolib: drop curlx_getpid, use fake pid in SMB
Daniel Stenberg [Fri, 9 May 2025 07:36:05 +0000 (09:36 +0200)] 
lib: drop curlx_getpid, use fake pid in SMB

It was not a function properly exposed in the curlx set. SMB cannot
possibly need to send a real pid, now sends a made up number.

The only real users of this function are test servers, so move the logic
over there.

Closes #17298

6 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 8 May 2025 20:33:01 +0000 (22:33 +0200)] 
RELEASE-NOTES: synced

6 months agocurlx: move version_win32.[ch] to curlx/
Daniel Stenberg [Thu, 8 May 2025 09:35:37 +0000 (11:35 +0200)] 
curlx: move version_win32.[ch] to curlx/

For curlx_verify_windows_version

Closes #17290

6 months agocmake: test integration with old cmake (v3.11.4 2018-03-28)
Viktor Szakats [Thu, 8 May 2025 11:09:29 +0000 (13:09 +0200)] 
cmake: test integration with old cmake (v3.11.4 2018-03-28)

Tests with old cmake are slow. (no Ninja, no unity, and running slower
than recent versions.)

It also revealed that 3.7.2 2017-01-13 is too old to consume curl via
`find_package()` due to:
```
CMake Error at bld-curl/_pkg/lib/cmake/CURL/CURLConfig.cmake:69 (add_library):
  add_library cannot create ALIAS target "CURL::libcurl" because target
  "CURL::libcurl_shared" is IMPORTED.
Call Stack (most recent call first):
  CMakeLists.txt:48 (find_package)

CMake Error at bld-curl/_pkg/lib/cmake/CURL/CURLConfig.cmake:69 (add_library):
  add_library cannot create ALIAS target "CURL::libcurl" because target
  "CURL::libcurl_shared" is IMPORTED.
Call Stack (most recent call first):
  CMakeLists.txt:49 (find_package)
```
The mitigation for this issue requires 3.11.

Also:
- rename a few existing envs to use the `TEST_` prefix.
- make the `find_package` test provider stage verbose.
- fix issue when consuming with cmake 3.7.2 (all platforms):
  ```
  CMake Error at /home/runner/cmake-3.7.2-Linux-x86_64/share/cmake-3.7/Modules/CMakeFindDependencyMacro.cmake:25 (message):
    Invalid arguments to find_dependency.  VERSION is empty
  Call Stack (most recent call first):
    bld-curl/_pkg/lib/cmake/CURL/CURLConfig.cmake:52 (find_dependency)
    CMakeLists.txt:48 (find_package)
  ```
  Ref: https://github.com/curl/curl/actions/runs/14906066962/job/41868621979?pr=17293#step:9:1199

Closes #17293

6 months agocurlx: move nonblock.[ch] into curlx/
Daniel Stenberg [Thu, 8 May 2025 08:52:57 +0000 (10:52 +0200)] 
curlx: move nonblock.[ch] into curlx/

Closes #17288

6 months agofile: use easy handle meta for protocol struct
Stefan Eissing [Thu, 8 May 2025 09:01:24 +0000 (11:01 +0200)] 
file: use easy handle meta for protocol struct

Closes #17292

6 months agocurlx: simplify the curlx_unicodefree macro
Daniel Stenberg [Thu, 8 May 2025 08:40:17 +0000 (10:40 +0200)] 
curlx: simplify the curlx_unicodefree macro

- explain its purpose in a comment

Closes #17287

6 months agossh: move easy handle/connection protocol structs to meta
Stefan Eissing [Wed, 7 May 2025 11:45:41 +0000 (13:45 +0200)] 
ssh: move easy handle/connection protocol structs to meta

Closes #17273

6 months agosrc: drop strcase.[ch] from tool builds
Daniel Stenberg [Thu, 8 May 2025 09:15:09 +0000 (11:15 +0200)] 
src: drop strcase.[ch] from tool builds

They're not used there anymore.

Closes #17289

6 months agowinbuild: curl_get_line is not used for tool builds
Daniel Stenberg [Thu, 8 May 2025 08:00:11 +0000 (10:00 +0200)] 
winbuild: curl_get_line is not used for tool builds

Drop it from the build. Also remove it from the tests/server makefile.

Follow-up to d8618f4d8480a8aa245c14f9cf3f1bcab92846c1

Closes #17286

6 months agortmp: remove no longer used proto member
Stefan Eissing [Tue, 6 May 2025 08:17:41 +0000 (10:17 +0200)] 
rtmp: remove no longer used proto member

Add src/curlinfo to gitignore while we are here.
Add tests/server/dnsd to gitignore while we are here.

Closes #17252

6 months agosrc: include memdebug.h consistently with angle brackets <>
Daniel Stenberg [Thu, 8 May 2025 07:42:51 +0000 (09:42 +0200)] 
src: include memdebug.h consistently with angle brackets <>

Not double quotes. Since the file is never local.

Closes #17284

6 months agolib: move multibyte.[ch] to curlx/
Daniel Stenberg [Thu, 8 May 2025 07:57:15 +0000 (09:57 +0200)] 
lib: move multibyte.[ch] to curlx/

This file provides functions in the curlx set.

Closes #17285

6 months agotelnet: keep protocol struct at easy handle meta
Stefan Eissing [Wed, 7 May 2025 10:27:06 +0000 (12:27 +0200)] 
telnet: keep protocol struct at easy handle meta

Remove the member of data->req.p

Closes #17271

6 months agoheaders: enforce a max number of response header to accept
Daniel Stenberg [Wed, 7 May 2025 22:21:26 +0000 (00:21 +0200)] 
headers: enforce a max number of response header to accept

The limit is 5000 headers in a single transfer. To avoid problems caused
by mistakes or malice.

Add test 747 to verify

Reported-by: wolfsage on hackerone
Closes #17281

6 months agosrc: rename curlx_safefree to tool_safefree
Daniel Stenberg [Wed, 7 May 2025 09:36:50 +0000 (11:36 +0200)] 
src: rename curlx_safefree to tool_safefree

It is not part of the curlx function collection, just a macro that might
as well be a local version.

Closes #17270

6 months agoGHA/checksrc: check GHA rules with zizmor
Viktor Szakats [Wed, 7 May 2025 16:56:27 +0000 (18:56 +0200)] 
GHA/checksrc: check GHA rules with zizmor

The pedantic level is experimental. If it causes issues, we may just
disable it alongside the ignore comments.

Also:
- silence error:
  ```
   INFO audit: zizmor: completed label.yml
  error[dangerous-triggers]: use of fundamentally insecure workflow trigger
    --> label.yml:13:1
     |
  13 | 'on': [pull_request_target]
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ pull_request_target is almost always used insecurely
     |
     = note: audit confidence -> Medium
  ```
- fix pedantic warning:
  ```
   INFO audit: zizmor: completed label.yml
  warning[excessive-permissions]: overly broad permissions
    --> label.yml:1:1
  ...  |
  24 | |         with:
  25 | |           repo-token: '${{ secrets.GITHUB_TOKEN }}'
     | |____________________________________________________- default permissions used due to no permissions: block
     |
     = note: audit confidence -> Medium
  ```
- silence `template-injection` false positives like:
  ```
  - note: ${{ matrix.build.torture && 'test-torture' || 'test-ci' }} may expand into attacker-controllable code
  - note: ${{ contains(matrix.build.install_steps, 'pytest') && 'caddy httpd vsftpd' || '' }} may expand into attacker-controllable code
  ```
  It doesn't seem like these could be controlled by an attacker.
  Let me know if I'm missing something.

Closes #17278

6 months agoGHA/windows: set `persist-credentials: false` where missing
Viktor Szakats [Wed, 7 May 2025 16:41:21 +0000 (18:41 +0200)] 
GHA/windows: set `persist-credentials: false` where missing

Found by zizmor.

Closes #17277

6 months agonetrc: avoid NULL deref on weird input
Daniel Stenberg [Wed, 7 May 2025 14:36:08 +0000 (16:36 +0200)] 
netrc: avoid NULL deref on weird input

A dynbuf that never gets populated might return a NULL, and Coverity
could find a way through like that.

Closes #17275

6 months agoldap: move easy handle protocol struct into meta hash
Stefan Eissing [Wed, 7 May 2025 09:15:40 +0000 (11:15 +0200)] 
ldap: move easy handle protocol struct into meta hash

Removing the member of data->req.p

Closes #17269

6 months agovtls: avoid NULL deref on bad PEM input
Daniel Stenberg [Wed, 7 May 2025 14:09:55 +0000 (16:09 +0200)] 
vtls: avoid NULL deref on bad PEM input

Spotted by Coverity

Closes #17274

6 months agosmtp: use easy handle/connectin meta for proto structs
Stefan Eissing [Tue, 6 May 2025 10:38:15 +0000 (12:38 +0200)] 
smtp: use easy handle/connectin meta for proto structs

Move `struct smtp_conn` and `struct STMP` into the meta data at easy
handle/connection. Remove it from the unions at connectdata and request.

Closes #17257

6 months agoRELEASE-PROCEDURE: update the coming release dates
Daniel Stenberg [Wed, 7 May 2025 12:39:18 +0000 (14:39 +0200)] 
RELEASE-PROCEDURE: update the coming release dates

6 months agometahash: add asserts to help analyzers
Daniel Stenberg [Wed, 7 May 2025 08:49:13 +0000 (10:49 +0200)] 
metahash: add asserts to help analyzers

Where NULL pointers are not acceptable input.

Closes #17268

6 months agocurlx: move into to curlx/ 17253/head
Daniel Stenberg [Wed, 7 May 2025 09:00:59 +0000 (11:00 +0200)] 
curlx: move into to curlx/

Move curlx_ functions into its own subdir.

The idea is to use the curlx_ prefix proper on these functions, and use
these same function names both in tool, lib and test suite source code.
Stop the previous special #define setup for curlx_ names.

The printf defines are now done for the library alone. Tests no longer
use the printf defines. The tool code sets its own defines. The printf
functions are not curlx, they are publicly available.

The strcase defines are not curlx_ functions and should not be used by
tool or server code.

dynbuf, warnless, base64, strparse, timeval, timediff are now proper
curlx functions.

When libcurl is built statically, the functions from the library can be
used as-is. The key is then that the functions must work as-is, without
having to be recompiled for use in tool/tests. This avoids symbol
collisions - when libcurl is built statically, we use those functions
directly when building the tool/tests. When libcurl is shared, we
build/link them separately for the tool/tests.

Assisted-by: Jay Satiro
Closes #17253

6 months agoimap: use easy handle/connection meta for proto structs
Stefan Eissing [Tue, 6 May 2025 14:27:43 +0000 (16:27 +0200)] 
imap: use easy handle/connection meta for proto structs

Remove the imap protocol structs from connectdata->proto union
and data->req.p and use the easy handle/connection meta hash
for keeping them.

Closes #17261

6 months agocmake: set `BUILDING_LIBCURL` directly for unit test targets
Viktor Szakats [Tue, 6 May 2025 23:29:32 +0000 (01:29 +0200)] 
cmake: set `BUILDING_LIBCURL` directly for unit test targets

To avoid adding this macro to the global `CURL_DEBUG_MACROS` variable,
which may be used for targets defined after unit tests, and where this
macro may not be necessary.

As of this commit unit tests are defined last, so extending the global
variable did not cause any issue.

Follow-up to 220eda34cdfdcc4316845d2e2bbe5bd8b10305e0 #17259

Closes #17264

6 months agogenerate.bat: exclude curlinfo.c from legacy VS projects
Jay Satiro [Tue, 6 May 2025 21:47:37 +0000 (17:47 -0400)] 
generate.bat: exclude curlinfo.c from legacy VS projects

- Do not include curlinfo.c as a ClCompile unit when compiling the curl
  tool.

Prior to this change generate.bat would add curlinfo.c to the source
files for the curl tool because it is located in the src directory. That
caused ambiguous behavior in legacy versions of Visual Studio which had
to guess between two main entry points (one in curlinfo and one in
tool_main, the latter being correct).

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

6 months agotests: separate tunit tests from unit tests more
Daniel Stenberg [Tue, 6 May 2025 13:03:46 +0000 (15:03 +0200)] 
tests: separate tunit tests from unit tests more

- unit tests need no tool code as they are libcurl unit tests
- unit test 1621 is now tunit test 1621 instead, as it tests tool code
- build unit tests with BUILDING_LIBCURL as they pretent to be libcurl

Closes #17259

6 months agortsp: move easy handle/connection protoocol structs into meta data
Stefan Eissing [Tue, 6 May 2025 08:44:27 +0000 (10:44 +0200)] 
rtsp: move easy handle/connection protoocol structs into meta data

Remove the connectdata proto and data->req.p member for rtsp and manage
the structs as meta data at easy handle/connection.

Closes #17254

6 months agopop3: add null pointer check
Daniel Stenberg [Tue, 6 May 2025 09:05:30 +0000 (11:05 +0200)] 
pop3: add null pointer check

Pointed out by Coverity. A precaution to catch internal errors.

Follow-up to 76d13c721bcd992e3e19f52

Closes #17255

6 months agoftp: fix bug in failed init
Stefan Eissing [Tue, 6 May 2025 10:59:28 +0000 (12:59 +0200)] 
ftp: fix bug in failed init

torture tests revealed that memory was not released correctly when FTP's
connection setup failed an allocation.

Follow-up from a2d90d4ba5076643b5af9978c4

Closes #17258

6 months agosmb: use easy handle/connection meta hash to keep structs
Stefan Eissing [Wed, 30 Apr 2025 12:00:35 +0000 (14:00 +0200)] 
smb: use easy handle/connection meta hash to keep structs

Keep easy/connection related protoocl structs in the meta hash instead
of the unions at request and connectdata.

Closes #17238

6 months agortmp: use connection meta for RTMP* instance
Stefan Eissing [Wed, 30 Apr 2025 10:59:01 +0000 (12:59 +0200)] 
rtmp: use connection meta for RTMP* instance

Keep RTMP* instance at connection meta hash.

Closes #17237

6 months agopop3: use meta hashes at easy handle and connection
Stefan Eissing [Wed, 30 Apr 2025 10:06:53 +0000 (12:06 +0200)] 
pop3: use meta hashes at easy handle and connection

Keep the pop3 related protocol information in the meta hashes at easy
handle and connection.

Move the struct definitions inside pop3.c

Closes #17236

6 months agoftp: use easy handle and connectin meta data for protocol structs
Stefan Eissing [Mon, 5 May 2025 11:31:14 +0000 (13:31 +0200)] 
ftp: use easy handle and connectin meta data for protocol structs

- remove data->req.p.ftp and store `struct FTP` as easy meta data
- place `struct ftp_conn` instance in connection meta data

Closes #17249

6 months agotftp: use connections meta hash
Stefan Eissing [Wed, 30 Apr 2025 09:08:02 +0000 (11:08 +0200)] 
tftp: use connections meta hash

Use connection meta hash for state struct instead of union pointer at
connectdata.

Closes #17235

6 months agoopenldap: use connection meta for context struct
Stefan Eissing [Tue, 29 Apr 2025 11:09:00 +0000 (13:09 +0200)] 
openldap: use connection meta for context struct

Remove member of conn->proto union.

Closes #17224

6 months agoECH: reference the OpenSSL ECH feature branch
sftcd [Mon, 5 May 2025 21:37:49 +0000 (22:37 +0100)] 
ECH: reference the OpenSSL ECH feature branch

rather than the defo-project fork.

Closes #17251

6 months agospacecheck.pl: check for non-ASCII chars, fix fallouts
Viktor Szakats [Sat, 3 May 2025 16:11:29 +0000 (18:11 +0200)] 
spacecheck.pl: check for non-ASCII chars, fix fallouts

Reported-by: James Fuller
Assisted-by: Dan Fandrich
Closes #17247

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 1 May 2025 20:27:18 +0000 (22:27 +0200)] 
RELEASE-NOTES: synced

7 months agoGHA: Update libressl-portable/portable to v4.1.0
renovate[bot] [Wed, 30 Apr 2025 19:42:34 +0000 (19:42 +0000)] 
GHA: Update libressl-portable/portable to v4.1.0

Closes #17234

7 months agomkhelp: fix to not generate a line-ending space in some cases
Viktor Szakats [Wed, 30 Apr 2025 16:32:02 +0000 (18:32 +0200)] 
mkhelp: fix to not generate a line-ending space in some cases

Fixing gcc-15:
```
bld/src/tool_hugehelp.c:11739:1: error: trailing whitespace [-Werror=trailing-whitespace=]
```
Ref: https://github.com/curl/curl/actions/runs/14758743743/job/41433794102?pr=17239#step:10:32

Closes #17240

7 months agoTLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs
Andrei Florea [Wed, 2 Apr 2025 07:41:54 +0000 (09:41 +0200)] 
TLS: add CURLOPT_SSL_SIGNATURE_ALGORITHMS and --sigalgs

Fixes #12982
Closes #16964

7 months agoTODO: remove "nicer lacking perl message"
NeimadTL [Tue, 29 Apr 2025 22:32:23 +0000 (18:32 -0400)] 
TODO: remove "nicer lacking perl message"

The document has been updated by removing point 20.2 as it was done
some time ago.

Closes #17233

7 months agodocs/libcurl: fix type and prototype problems in examples
Daniel Stenberg [Tue, 29 Apr 2025 20:27:52 +0000 (22:27 +0200)] 
docs/libcurl: fix type and prototype problems in examples

Found by enabling the typechecks when compiling them with
verify-examples.pl

Closes #17231

7 months agoCURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example
Daniel Stenberg [Tue, 29 Apr 2025 15:47:50 +0000 (17:47 +0200)] 
CURLOPT_XFERINFOFUNCTION.md: fix the callback return type in example

Fixes #17228
Reported-by: gkarracer on github
Closes #17229

7 months agoscripts: fix perl indentation, whitespace, semicolons
Viktor Szakats [Mon, 28 Apr 2025 12:57:16 +0000 (14:57 +0200)] 
scripts: fix perl indentation, whitespace, semicolons

Ref: #17116

Closes #17209

7 months agoGHA: drop vcpkg cache and most vcpkg logic with it
Viktor Szakats [Sat, 26 Apr 2025 16:37:39 +0000 (18:37 +0200)] 
GHA: drop vcpkg cache and most vcpkg logic with it

The unplanned dropping of the granular vcpkg binary cache indeed fell
into the cracks between Microsoft's various departments. The old method
is now official dropped, without replacement either on the vcpkg side or
the GitHub cache provider side.

Without a granular cache, vcpkg is impractical for builds larger than
a small dependency tree in CI, for performance reasons.

A granular cache is critical for CI use. Building dependencies is not
a goal of this CI, so a more desirable option would be pre-built binary
downloads. This would also allow keeping job timeouts low, which is
important for quick iteration in GHA when a flaky job requiring a manual
retry needs all other jobs to finish first. (GHA often disregards
step timeouts, which is another contributing factor here.)

Windows remains tested extensively with MSYS2, curl-for-win, and via
AppVeyor CI with MSVC + OpenSSL, and also in GHA via scaled back vcpkg
jobs that perform well without caching. What's lost is the recently
added Android OpenSSL build tests.

We may consider building/cachine important dependencies manually as in
GHA/linux-http3, and/or try integrating MSVC jobs with MSYS2 UCRT DLLs.

Ref: https://github.com/microsoft/vcpkg-tool/pull/1662
Ref: https://github.com/microsoft/vcpkg/issues/45073

Follow-up to cd0ec4784c1c0f873939f33ec1a73c8739f276b9 #17089
Follow-up to e3912f0f9fac06d37cd1ab93cef4f01f33809f0b #17086
Follow-up to 15fb1dc7f86ad1832e0386ec7d92542f44ee9c44 #17069

Closes #17200

7 months agobuild: enable gcc-15 picky warnings
Viktor Szakats [Fri, 25 Apr 2025 14:39:45 +0000 (16:39 +0200)] 
build: enable gcc-15 picky warnings

Closes #17199

7 months agoopenssl: set the cipher string before doing private cert
Corinna Brandt [Tue, 29 Apr 2025 13:31:17 +0000 (15:31 +0200)] 
openssl: set the cipher string before doing private cert

... as this allows a set string to affect how OpenSSL deals with the
private keys/certs.

Closes #17227

7 months agomqtt: use conn/easy meta hash
Stefan Eissing [Tue, 29 Apr 2025 08:49:46 +0000 (10:49 +0200)] 
mqtt: use conn/easy meta hash

Remove mqtt structs from the unions at connectdata and
easy handle requests. Use meta hash at easy/connnection.

Make mqtt structs private to mqtt.c

Closes #17221

7 months agomulti_ev: remove redundant check for data
Daniel Stenberg [Tue, 29 Apr 2025 12:03:10 +0000 (14:03 +0200)] 
multi_ev: remove redundant check for data

Pointed out by CodeSonar

Closes #17226

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 29 Apr 2025 12:07:59 +0000 (14:07 +0200)] 
RELEASE-NOTES: synced

7 months agometa data handling for easy/conn fixes
Stefan Eissing [Tue, 29 Apr 2025 08:53:34 +0000 (10:53 +0200)] 
meta data handling for easy/conn fixes

- return error when adding to hash fails
- do not free passed in data, as ownership is taken by call

Closes #17219

7 months agoVULN-DISCLOSURE-POLICY: use of weak algos
Daniel Stenberg [Tue, 29 Apr 2025 09:10:19 +0000 (11:10 +0200)] 
VULN-DISCLOSURE-POLICY: use of weak algos

Not necessarily security problems.

Closes #17220

7 months agoopenssl: first unload the provider, then free the context
Daniel Stenberg [Tue, 29 Apr 2025 09:52:47 +0000 (11:52 +0200)] 
openssl: first unload the provider, then free the context

Doing it in the reversed order causes bad problems inside OpenSSL.

Closes #17223

7 months agoetag-save.md: mention how using both options is a good idea
Daniel Stenberg [Tue, 29 Apr 2025 07:27:08 +0000 (09:27 +0200)] 
etag-save.md: mention how using both options is a good idea

Ref: https://curl.se/mail/archive-2025-04/0011.html

Closes #17217

7 months agongtcp2+openssl: enable test 17_10
Stefan Eissing [Tue, 29 Apr 2025 08:20:34 +0000 (10:20 +0200)] 
ngtcp2+openssl: enable test 17_10

TLS session reuse in QUIC is also implemented for ngtcp2+openssl. Enable
the test.

Closes #17218

7 months agoopenssl: enable builds for *both* engines and providers
Daniel Stenberg [Tue, 8 Apr 2025 09:45:17 +0000 (11:45 +0200)] 
openssl: enable builds for *both* engines and providers

OpenSSL3 can in fact have both enabled at once. Load the provider and
key/cert appropriately. When loading a provider, the user can now also
set an associated "property string".

Work on this was sponsored by Valantic.

Closes #17165

7 months agolib: provide a getaddrinfo wrapper 17134/head
Daniel Stenberg [Tue, 22 Apr 2025 12:51:49 +0000 (14:51 +0200)] 
lib: provide a getaddrinfo wrapper

This uses c-ares under the hood and supports the CURL_DNS_SERVER
environment variable - for debug builds only. The getaddrinfo()
replacement function is only used if CURL_DNS_SERVER is set to make a
debug build work more like a release version without the variable set.

'override-dns' is a new feature for the test suite when curl can be told
to use a dedicated DNS server, and test 2102 is the first to require
this.

Requires c-ares 1.26.0 or later.

Closes #17134

7 months agocfilters: remove assert
Daniel Stenberg [Mon, 28 Apr 2025 15:05:14 +0000 (17:05 +0200)] 
cfilters: remove assert

The OSS-fuzz probe reaches this, so it can apparently in run-time. There
is already a run-time handling of the situation.

Closes #17211

7 months agobuildinfo: move from tests/server/ to src/, rename to curlinfo
Daniel Stenberg [Sun, 27 Apr 2025 15:35:20 +0000 (17:35 +0200)] 
buildinfo: move from tests/server/ to src/, rename to curlinfo

Since a16485a42ea5dabe6c, the test servers build with a different set of
options than the tool/lib - for example a different CURLDEBUG. To make
buildinfo better reflect the curl build, move it to src/ and build it
here using the local CURLDEBUG. Renamed to curlinfo to not get confused
with buildinfo.txt

I chose src/ and not lib/ because the file also uses tool-specific headers.

Assisted-by: Viktor Szakats
Closes #17187

7 months agoprogress: fix integer overflow check
Jay Satiro [Mon, 28 Apr 2025 17:35:44 +0000 (13:35 -0400)] 
progress: fix integer overflow check

- Fix logic typo.

Prior to this change the overflow check was reversed, meaning it did
not stop an overflow condition and also if there wasn't an overflow it
erroneously set the total expected transfer size to the maximum value.

Follow-up to 69ce9a7f from earlier today.

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

7 months agopull_request_template.md: remove again
Daniel Stenberg [Mon, 28 Apr 2025 15:07:13 +0000 (17:07 +0200)] 
pull_request_template.md: remove again

It was just super annoying and bad

Closes #17212

7 months agoprogress: avoid integer overflow when gathering total transfer size
Daniel Stenberg [Mon, 28 Apr 2025 11:41:20 +0000 (13:41 +0200)] 
progress: avoid integer overflow when gathering total transfer size

Reported by OSS-fuzz

Closes #17207

7 months agosmb: avoid integer overflow on weird input date
Daniel Stenberg [Mon, 28 Apr 2025 11:35:02 +0000 (13:35 +0200)] 
smb: avoid integer overflow on weird input date

Found by OSS-fuzz

Closes #17206

7 months agopull_request_template.md: REUSE compliance
Daniel Stenberg [Mon, 28 Apr 2025 11:44:15 +0000 (13:44 +0200)] 
pull_request_template.md: REUSE compliance

Plus move it to .github

Closes #17208

7 months agopull_request_template.md: provide basic instructions
Daniel Stenberg [Mon, 28 Apr 2025 08:28:55 +0000 (10:28 +0200)] 
pull_request_template.md: provide basic instructions

This should appear on GitHub for pull-requests and asks users to submit
their PRs as draft to begin with, to help us know when PRs are ready.

Closes #17205

7 months agows: store protocol context as connection meta data
Stefan Eissing [Wed, 23 Apr 2025 08:34:12 +0000 (10:34 +0200)] 
ws: store protocol context as connection meta data

Eliminates union member on struct connectdata. Sample of how
other procotols can handle their connection related data.

This avoids potention mix-ups of the `proto` union of a
connection with other protocol instances.

Removed ws "disconnect" callback as meta data is automatically
destroyed when a connection is destroyed.

Closes #17146

7 months agoHTTPSRR.md: clarify somewhat
Daniel Stenberg [Mon, 28 Apr 2025 06:30:16 +0000 (08:30 +0200)] 
HTTPSRR.md: clarify somewhat

Closes #17204

7 months agotests: add basic ECH tests
sftcd [Fri, 25 Apr 2025 17:26:04 +0000 (18:26 +0100)] 
tests: add basic ECH tests

Test 4000 and 4001

Closes #17192

7 months agocmake: extend integration tests
Viktor Szakats [Sun, 27 Apr 2025 10:26:41 +0000 (12:26 +0200)] 
cmake: extend integration tests

- GHA: add cmake integration tests for Windows.
- make them run faster with prefill, unity, Ninja, omitting curl tool.
- also test static libcurl.
- add old-cmake support with auto-detection.
- auto-detect Ninja.
- run consumer test apps to see if they work.
- add support for Windows.
- make it more verbose.
- re-add `ExternalProject` cmake consumer test. It's broken.
- tidy up terminology.

Cherry-picked from #16973
Closes #17203

7 months agocurl_osslq: remove a leftover debug fprintf() call
Daniel Stenberg [Sat, 26 Apr 2025 21:18:43 +0000 (23:18 +0200)] 
curl_osslq: remove a leftover debug fprintf() call

Reported-by: xiadnoring on github
Fixes #17198
Closes #17202

7 months agoGHA: update actions/download-artifact digest to d3f86a1
renovate[bot] [Thu, 24 Apr 2025 17:47:17 +0000 (17:47 +0000)] 
GHA: update actions/download-artifact digest to d3f86a1

Closes #17174

7 months agoGHA: Update awslabs/aws-lc to v1.50.0
renovate[bot] [Fri, 25 Apr 2025 15:41:09 +0000 (15:41 +0000)] 
GHA: Update awslabs/aws-lc to v1.50.0

Closes #17191

7 months agoRELEASE-PROCEDURE.md: release candidate git tagging explained
Daniel Stenberg [Thu, 24 Apr 2025 20:57:51 +0000 (22:57 +0200)] 
RELEASE-PROCEDURE.md: release candidate git tagging explained

To help anyone wanting to build/reproduce release candidates, this is
the set git tag naming scheme to use. Similar to, but different, than
the "normal" release tags to not be possible to mixup.

Closes #17177

7 months agows: fix the header replace check
Daniel Stenberg [Fri, 25 Apr 2025 21:36:05 +0000 (23:36 +0200)] 
ws: fix the header replace check

It passed in the wrong header length to the check function, which made
it do duplicated headers in cases where the user provides its own set.

Reported-by: sbernatsky on github
Fixes #17170
Closes #17194
Closes #16178

7 months agoGHA/windows: add gcc-15 job
Viktor Szakats [Fri, 25 Apr 2025 14:32:27 +0000 (16:32 +0200)] 
GHA/windows: add gcc-15 job

It's taking 2.5 minutes and planned for removal when MSYS2 gcc-15 gets
deployed in CI.

15.0.1 builds significantly faster than 9.5.0. (But still slower than
7.3.0 and 6.4.0)

Ref: https://github.com/msys2/MINGW-packages/commit/f59921184b35858d4ceb91679578de0d62475cbf
Ref: https://github.com/msys2/MINGW-packages/pull/24037

Closes #17190

7 months agocmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`
Viktor Szakats [Sat, 26 Apr 2025 07:34:55 +0000 (09:34 +0200)] 
cmake: honor individual picky option overrides found in `CMAKE_C_FLAGS`

Also to sync up with similar `./configure` feature via
`CURL_ADD_COMPILER_WARNINGS()`.

Example: `-DCMAKE_C_FLAGS=-Wno-xor-used-as-pow`

It may be useful as a workaround if a specific build combination hits
a picky warning within curl's source code. If such happens, we do
appreciate a report to fix it in curl itself.

Closes #17197

7 months agobuild: enable gcc-12/13+, clang-10+ picky warnings
Viktor Szakats [Sat, 26 Apr 2025 07:28:28 +0000 (09:28 +0200)] 
build: enable gcc-12/13+, clang-10+ picky warnings

Cherry-picked from #17190
Closes #17196

7 months agocmake: use `LIB_NAME` in `curl-config.cmake.in`
Viktor Szakats [Sat, 26 Apr 2025 07:17:32 +0000 (09:17 +0200)] 
cmake: use `LIB_NAME` in `curl-config.cmake.in`

Cherry-picked from #16973
Closes #17195

7 months agoGHA/linux: formatting nit [ci skip]
Viktor Szakats [Wed, 23 Apr 2025 18:12:42 +0000 (20:12 +0200)] 
GHA/linux: formatting nit [ci skip]

Cherry-picked from #16973

7 months agourlapi: redirecting to "" is considered fine
Daniel Stenberg [Fri, 25 Apr 2025 14:22:24 +0000 (16:22 +0200)] 
urlapi: redirecting to "" is considered fine

If the CURLU handle already holds a proper URL, otherwise it is an
error.

Verified by test 1560

Fixes #17188
Reported-by: zopsicle on github
Closes #17189