Commit Graph

35949 Commits

Author SHA1 Message Date
Stefan Eissing
bcf8a84881
mbedtls: call psa_crypt_init() in global init
Run mbedtls' psa_crypt_init() in the general global init, optionally
protected by mbedtls locks when available.

CI: when building mbedtls, enabled thread safety

Reported-by: wxiaoguang on github
Fixes #15500
Closes #15505
2024-11-07 13:14:41 +01:00
Daniel Stenberg
f5c616930b
duphandle: also init netrc
The netrc init was only done in the Curl_open, meaning that a duplicated
handle would not get inited properly.

Added test 2309 to verify. It does netrc auth with a duplicated handle.

Regression from 3b43a05e00

Reported-by: tranzystorekk on github
Fixes #15496
Closes #15503
2024-11-07 09:47:53 +01:00
Daniel Stenberg
9919149aef
cookie: treat cookie name case sensitively
Extend test 31 to verify

Reported-by: delogicsreal on github
Fixes #15492
Closes #15493
2024-11-06 13:09:20 +01:00
Daniel Stenberg
b1ef0e1a01
RELEASE-NOTES: synced
Release time
2024-11-06 08:05:56 +01:00
Daniel Stenberg
62020546cc
THANKS: contributors from the 8.11.0 release 2024-11-06 08:05:56 +01:00
Viktor Szakats
380790b244
GHA/non-native: fix installing OpenLDAP on OpenBSD
Also:
- drop failing manual install of perl. It's there by default now.
- add link to OpenBSD package management FAQ page.

Closes #15491
2024-11-06 02:42:09 +01:00
Viktor Szakats
087f77d855
GHA/macos: drop WebSockets from job names
It's enabled in all jobs by default now.

Follow-up to cd63629733 #15076
2024-11-06 01:43:55 +01:00
Viktor Szakats
1b4897f3c8
RELEASE-NOTES: update cmake LDAP-related entry [ci skip]
Reported-by: Kai Pastor
Bug: https://github.com/curl/curl/pull/15255#issuecomment-2457558219
Follow-up to 2c90f7f69e #15255
2024-11-05 21:17:30 +01:00
Daniel Stenberg
e1ed6b8e29
mbedtls: remove failf() use from mbedtls_random
Since data can be NULL in here, calling failf() can be bad. This should
also be a terribly rare error so the lack of error message for this
should be manageable.

Reported-by: wxiaoguang on github
Fixes #15485
Closes #15486
2024-11-05 11:54:55 +01:00
Stefan Eissing
3a35901a11
wolfssl: coexist with openssl, further work
Build wolfSSL master with

./configure --prefix=/path --enable-ip-alt-name --enable-quic
--enable-earlydata --enable-psk --enable-opensslcoexist

and configure curl with openssl + wolfssl. Normal tests run.

pytest session resumption fails, as wolfssl does not handle the
new_session callback without opensslextra right now.

Closes #15481
2024-11-04 14:48:30 +01:00
Daniel Stenberg
f81abcbfeb
RELEASE-NOTES: synced 2024-11-04 10:40:42 +01:00
Daniel Stenberg
4133007798
wolfssl: no more use of the OpenSSL API
Allows curl to build with a wolfSSL built without its OpenSSL API.

It should allow curl to (soon?) build with *both* wolfSSL and OpenSSL

This change makes curl use its own sha256 implementaion when built with
wolfSSL: room for improvement.

Closes #15480
2024-11-04 10:23:05 +01:00
renovate[bot]
46bd595b77
ci: update dependency wolfSSL/wolfssh to v1.4.19
Closes #15476
2024-11-04 08:44:33 +01:00
Daniel Stenberg
6b2bc8130c
openssl: extend the OpenSSL error messages
Previously there were three error situations that only added the (unhelpful)
OpenSSL error strings, now we prefix those with a short explanation for the
error situation.

Reported-by: Jeroen Ooms
Fixes #15473
Closes #15474
2024-11-04 08:42:05 +01:00
Jonas 'Sortie' Termansen
78c3172921
curl_addrinfo: support operating systems with only getaddrinfo(3)
The gethostbyname(3) family was removed in POSIX-1.2008 in favor of
getaddrinfo(3) introduced in POSIX-1.2001. Modern POSIX systems such as
Sortix does not have gethostbyname nor the related definitions and
structures.

curl already only uses getaddrinfo(3) if available and thread safe,
although there is mild breakage if the related gethostbyname definitions
are missing.

This change attempts to fix that breakage:

Remove an unnecessary configure error if gethostbyname is missing since
getaddrinfo is enough as a fallback.

Rewrite Curl_ip2addr to not use struct hostent as it no longer is
standardized and create the struct Curl_addrinfo directly.

Only define the Curl_he2ai function on non-getaddrinfo systems where it
is going to be used with struct hoestent.

Revoke the fallback logic for when it's unknown whether getaddrinfo is
thread safe. It doesn't appear to make any sense since h_errno is
unrelated to getaddrinfo. The logic prevents new POSIX.1-2024 systems
from passing the thread safety test since h_errno does not exist anymore
and POSIX already requires getaddrinfo to be thread safe. There's
already a denylist in place for operating systems with known buggy
implementations.

Closes #15475
2024-11-02 22:28:59 +01:00
Viktor Szakats
25025419c9
pytest: include curl version string and python platform in log
For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Assisted-by: Dan Fandrich
Closes #15470
2024-11-02 01:56:55 +01:00
Viktor Szakats
9d32724c12
certs: add missing -CAcreateserial option for LibreSSL
Also:
- display openssl path and version.
- quote a string.

Follow-up to 9b0c0d6ade #15129

Closes #15471
2024-11-01 15:36:48 +01:00
Viktor Szakats
97d69ec0da
winbuild: drop gen_resp_file.bat
`gen_resp_file.bat` could be reduced to 3 lines.
Those lines are simple to use from `Makefile.vc` as-is.

Also drop the unnecessary tabs.

Closes #15463
2024-11-01 11:36:54 +01:00
Dan Fandrich
d88db0b6b2 tests: use a set for several of the curl_props
These are used for member-of testing, so a set is more appropriate and
efficient. Also, fix a couple cases of bad exceptions.

Closes #15462
2024-10-31 20:14:44 -07:00
Stefan Eissing
9b863ac670
vquic: recv_mmsg, use fewer, but larger buffers
Reported-by: koujaz on github
Fixes #15267
Closes #15454
2024-10-31 23:40:51 +01:00
Stefan Eissing
922235e56b
ngtcp2: do not loop on recv
The vquic_recv_packets() function already loops when not all requested
packets can be received (until EAGAIN) and there is not need to do that
again in ngtcp2.

Closes #15466
2024-10-31 14:08:58 +01:00
Viktor Szakats
2f22fc10e5
GHA/linux-old: adjust configure job name 2024-10-31 13:26:27 +01:00
Viktor Szakats
329a8e9daa
unit1307: tidy up Apple OS detection
Use `__APPLE__` macro to detect Apple OS instead of relying on
the string in `CURL_OS`.

This also fixes detection with default CMake builds where `CURL_OS` is
`Darwin`. The code before this patch was expecting this substring in
lowercase.

Closes #15461
2024-10-31 09:09:01 +01:00
edmcln
9640a8ef6f
schannel: fix TLS cert verification by IP SAN
Reported-by: elvinasp on github
Fixes #15149
Closes #15421
2024-10-31 08:59:37 +01:00
Viktor Szakats
fb711b5098
build: fix clang-cl builds, add CI job
- appveyor: add build-only job for clang-cl.

- cmake: `-pedantic-errors` enables `-Werror,-Wlanguage-extension-token`
  automatically, which makes `__int64` detection fail.
  Explictly disable this compiler warning for clang-cl to make the
  feature detection work and to accept `__int64` in the source code.

- cmake: disable `-Wlanguage-extension-token` warning for clang-cl
  to fix these when encountering `__int64`:
  ```
  lib/formdata.c(797,29): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(117,33): error : extension used [-Werror,-Wlanguage-extension-token]
  lib/warnless.c(60,28): message : expanded from macro 'CURL_MASK_SCOFFT'
  lib/warnless.c(59,38): message : expanded from macro 'CURL_MASK_UCOFFT'
  include\curl/system.h(352,40): message : expanded from macro 'CURL_TYPEOF_CURL_OFF_T'
  ```

- make `__GNUC__` warning suppressions apply to `__clang__` too.
  Necessary for clang-cl, which defines the latter, but not the former.
  (Regular clang defines both.)

- examples: fix clang-cl compiler warning in `http2-upload.c`.
  ```
  docs\examples\http2-upload.c(56,5): error : no previous prototype for function 'my_gettimeofday' [-Werror,-Wmissing-prototypes]
  docs\examples\http2-upload.c(56,1): message : declare 'static' if the function is not intended to be used outside of this translation unit
  ```

- unit2604: add missing `#pragma GCC diagnostic pop`.
  Follow-up to e53523fef0 #14859

- unit1652: limit compiler warning suppression to GCC.
  They do not affect clang builds.
  Follow-up to 71cf0d1fca #14772

Closes #15449
2024-10-30 23:15:32 +01:00
Viktor Szakats
9acecc923d
tidy-up: whitespace, fix CI spacecheck for docs
Also: fixup CI spacecheck to apply to docs again.

Closes #15423
2024-10-30 23:15:28 +01:00
Daniel Stenberg
0cececef0f
config: rename the OS define to CURL_OS to reduce collision risk
Reported-by: Jon Rumsey
Fixes #15455
Closes #15457
2024-10-30 14:59:54 +01:00
Daniel Stenberg
c0d2b9bee7
MQTT: remove trailing newline 2024-10-30 14:04:08 +01:00
Daniel Stenberg
98561a3bef
RELEASE-NOTES: synced 2024-10-30 09:47:06 +01:00
Viktor Szakats
bc6212004a
pytest: show curl features and protocols
For the Test Clutch matrix.

https://testclutch.curl.se/static/reports/feature-matrix.html

Closes #15452
2024-10-30 09:32:29 +01:00
Marwan Yassini
e4aa07b526
mqtt: fix mqtt.md wording and add clearer explanation
Some of the wording in the mqtt.md confused me as to how the commands
were used and what they did, so I cleared up some of the wording to
better explain what each command does.

Closes #15451
2024-10-30 08:44:05 +01:00
Jay Satiro
22e7b1512b winbuild/README: consolidate command prompt section
- Remove reference to 'Developer Command Prompt for Visual Studio'
  shortcut since it opens in x86 mode.

That prompt may confuse users since it is not easily switched to x64.
Our instruction says vcvarsall can be used to change the platform but it
is not in the path in any version that I checked (VS 2010, 2013, 2022).

Instead users will now only see the remaining instruction to use a
platform specific command prompt to build curl, like "x64 Native Tools".

There's several links as well to Microsoft documentation for users that
have more complicated requirements, such as using vcvarsall.

Closes https://github.com/curl/curl/pull/15313
2024-10-30 01:30:15 -04:00
renovate[bot]
85ee614020
ci: update rojopolis/spellcheck-github-actions digest to 74c2a14
Closes #15412
2024-10-29 15:52:30 +01:00
Jon Rumsey
b57e9c8f9b
OS400: don't delete source files when building with debug
Debugger not able to work against curl *SRVPGM when using temporary
source files.

Fixes #15445
Closes #15446
2024-10-29 15:44:05 +01:00
Stefan Eissing
0d475da1c4
pytest: fix run against multissl curl
Changes to make a curl built with OpenSSL + GnuTLS to run successfully
in our pytests. Run

CURL_SSL_BACKEND=openssl pytest

to test a TLS backend other than the default.

Closes #15443
2024-10-29 11:13:56 +01:00
Daniel Stenberg
a70f5bc4b5
curl/config2setopts: move SSH related options into same block
Move the code setting SSH specific libcurl options into the same block
to avoid having a separate almost identical condition later.

Closes #15444
2024-10-29 11:05:22 +01:00
Daniel Stenberg
84f96e3363
tool_operate: url_proto improvements
- renamed to url_proto_and_rewrite to better reveal what it does
- clarify the functionality in the top comment
- make it return CURLE_OUT_OF_MEMORY appropriately
- remove check for URL being set, use assert instead

Closes #15442
2024-10-29 10:07:37 +01:00
Daniel Stenberg
a273cc255f
multi: fix "Useless Assignment"
CodeSonar pointed out "This code assigns the variable the same value it
already had"

Follow-up to e77326403d

Closes #15441
2024-10-29 09:41:43 +01:00
Daniel Stenberg
b7a06dee50
setopt: return error for bad input to CURLOPT_RTSP_REQUEST
And leave the value untouched. Previously, an unrecognized argument
would reset it to RTSPREQ_NONE (and still return OK).

Closes #15440
2024-10-29 09:40:56 +01:00
Viktor Szakats
74c7b672d9
runtests: add comment for handle64 pathsep requirement [ci skip]
Cherry-picked from #14949
2024-10-29 09:27:42 +01:00
Daniel Stenberg
cbc39a88d7
setopt_cptr: make overflow check only done when needed
An overflow check for if the value of a curl_off_t is larger than a
size_t can hold, is only necessary if the two types are actually
differently sized, now checked by the preprocessor. To avoid
"Unreachable Conditional".

Closes #15439
2024-10-29 09:25:29 +01:00
Viktor Szakats
1a2d38c47c
GHA/windows: avoid curl.exe libtool wrapper
Avoid the `curl.exe` wrapper binary created by libtool, and run the real
`curl.exe` directly for tests and version information.

This solution was used in Azure jobs. I missed it when migrating jobs
to GHA.

Applies to tests run in the `mingw, AM x86_64 c-ares U` job, which has
seen unexplained flakiness.

Ref: 354afc891d #6049
Follow-up to e53523fef0 #14859

Closes #15437
2024-10-29 09:20:37 +01:00
Viktor Szakats
ef7399b8b5
runtests: pass single backslashes with Windows Perl
handle/handle64 requires a literal match with the filenames it's
listing.

Also:
- make handle64 log messages more unique to help text searches.
- update a comment with Windows Perl info.

Cherry-picked from #14949
Closes #15436
2024-10-29 09:20:37 +01:00
Daniel Stenberg
cd2b45201a
src/lib: remove redundant ternary operators
Closes #15435
2024-10-29 08:18:30 +01:00
Daniel Stenberg
080973dcdb
lib: msnprintf tidy-ups
doh: avoid an msnprintf()

openssl: skip a superfluous return code check

Closes #15434
2024-10-28 22:56:11 +01:00
Daniel Stenberg
cb011ac096
tls: avoid abusing CURLE_SSL_ENGINE_INITFAILED
That error code was introduced and has been used for OpenSSL ENGINE
things and not others, so switch the other use cases over to other TLS
related error codes.

Closes #15430
2024-10-28 16:13:14 +01:00
Daniel Stenberg
974f6bcf80
RELEASE-NOTES: synced 2024-10-28 16:01:08 +01:00
Stefan Eissing
701813b23f
tests/http: add --insecure tests
Add two test cases that connection using a hostname the server has no
certificate for. First, verify that the peer verification fail, as
expected. Second, provide '--insecure' to test that the connection
succeeded and returned some data.

Closes #15429
2024-10-28 13:04:28 +01:00
Stefan Eissing
0e0c8cdf89
tests/scorecard: allow remote server test
New args for scorecard.py:
* --remote ip:port to run tests against a remote server
* --start-only: to only start the servers, listing their ports

Start the server using "scorecard.py --start-only" on one machine and
then run the tests with "scorecard.py --remote ip:port" against that
machine.

Closes #15415
2024-10-28 11:41:19 +01:00
Daniel Stenberg
770702fa3d
CI: bump wolfSSH and wolfSSL
- wolfSSH 1.4.18
- wolfSSL 5.7.4

Closes #15427
2024-10-28 09:38:37 +01:00