Commit Graph

34209 Commits

Author SHA1 Message Date
Viktor Szakats
436bbbe7ab
GHA/linux: skip installing rust if rustls is in cache
Rust remains installed for the Hyper job, because the rustls cache flag
is always false in that case.

Closes #15246
2024-10-10 13:15:26 +02:00
Viktor Szakats
36bd807475
GHA/linux, http3-linux: add CMake support, sync steps, other improvements
- use shallow clone for submodules.
- reduce total job timeout from 90/60 -> 45 minutes.
- use `$HOME` instead of literal.
- http3-linux: sync step yaml order with linux.yml.
- http3-linux: add cmake + ninja support like in linux.yml.
- http3-linux: dump confgure log, test config, curl -V like in linux.yml.
- http3-linux: skip restoring gnutls and wolfssl when not used.
- dump `curl_config.h`.
- fold a long line.

Closes #15242
2024-10-10 12:16:42 +02:00
Viktor Szakats
5b2d6448bb
GHA/mac: simplify detecting SDK version bound to GCC
Previous method extracted this information from the "hack layer"
headers' copyright comments.

It turns out that the same information can be obtained by querying
the default SDK root via a GCC option.

According to this test run, they do match:
https://github.com/curl/curl/actions/runs/11264283159/job/31323963221?pr=15193

Closes #15241
2024-10-10 11:18:07 +02:00
Viktor Szakats
d3725f2bc4
GHA/linux: fix mbedTLS cmake build
CMake builds mbedTLS in Debug mode by default, which was the reason
for these consistent test failures:
```
FAIL 1631: 'FTP through HTTPS-proxy' FTP, HTTPS-proxy
FAIL 1632: 'FTP through HTTPS-proxy, with connection reuse' FTP, HTTPS-proxy
```
Sometimes also:
```
FAIL 303: 'HTTPS with 8 secs timeout' HTTPS, HTTP GET, timeout, FAILURE
```
https://github.com/curl/curl/actions/runs/11260616621/job/31313234198

Fix it by building in `RelWithDebInfo` mode, matching the bare
`Makefile` builds used earlier. (`Release` mode also works.)

Cache sizes:
- Makefile: 10MB
- CMake Release: 1MB
- CMake RelWithDebInfo: 2.5MB

Ref: #15215
Follow-up to e377c91766 #15208

Closes #15238
2024-10-10 10:54:15 +02:00
Daniel Stenberg
8c62479a77
packages/OS400/curlmain: remove the strncpy calls
Closes #15214
2024-10-10 07:47:41 +02:00
Daniel Stenberg
45b388fdc7
tests/server/util.c: remove use of strncpy
... and ban the function in code in this directory.

Closes #15213
2024-10-10 07:47:01 +02:00
Daniel Stenberg
08949637d5
tool_getparam: replace two uses of strncpy(), ban strncpy
strncpy() is rarely the right choice

Closes #15212
2024-10-09 23:43:24 +02:00
Daniel Stenberg
5ee43bb82e
tests: 780 - 783, new HSTS tests
test780: verify updated HSTS data in response header

test781: HSTS update expiry, with parent includeSubDomains domain
present

test782: HSTS update expiry, with two includeSubDomains domains present

test783: HSTS update expiry, removing includesubdomains in update
2024-10-09 13:48:14 +02:00
Daniel Stenberg
a94973805d
hsts: improve subdomain handling
- on load, only replace existing HSTS entries if there is a full host
  match

- on matching, prefer a full host match and secondary the longest tail
  subdomain match

Closes #15210
2024-10-09 13:48:08 +02:00
Emanuel Komínek
461ce6c616
multi: make curl_multi_cleanup invalidate magic latter
When a multi handle is being cleaned up, it can still cause user
callbacks to be fired. Notably Curl_cpool_destroy calls socket_callback
on all pooled connections. It's still possible for the callback to call
curl_multi_assign leading to an assert.

This commit moves clearing of a multi handle magic to a point where the
multi handle stops being a valid object.

Fixes #15201
Closes #15206
2024-10-09 07:55:21 +02:00
Colton Willey
0f7e72fbcc
wolfssl: use old version API without openssl extra
Closes #15205
2024-10-09 07:53:45 +02:00
Viktor Szakats
e377c91766
GHA: add Linux and macOS mbedTLS jobs, fix issue
- update mbedTLS repo URL.
- switch local mbedTLS build to use CMake, and Ninja.
  CMake build is required to create and install mbedTLS `pkg-config`
  files. (as of v3.6.1)
  `-DCMAKE_POSITION_INDEPENDENT_CODE=ON` required to avoid this error
  when linking mbedtls to `libcurl.so`:
  ```
  /usr/bin/ld: /home/runner/mbedtls/lib/libmbedcrypto.a(cipher.c.o): warning: relocation against `mbedtls_cipher_base_lookup_table' in read-only section `.text'
  /usr/bin/ld: /home/runner/mbedtls/lib/libmbedtls.a(ssl_tls.c.o): relocation R_X86_64_PC32 against symbol `mbedtls_x509_crt_profile_suiteb' can not be used when making a shared object; recompile with -fPIC
  /usr/bin/ld: final link failed: bad value
  ```
  Ref: https://github.com/curl/curl/actions/runs/11245069259/job/31264386723#step:40:43
- make local mbedTLS build 10x smaller by omitting programs and tests.
- GHA/linux: fix cmake warning by adding `-B .` option.
- GHA/linux: add build-only cmake job for packaged mbedTLS (2.x).
- fix compiler warning when building with mbedTLS 2.x:
  ```
  /home/runner/work/curl/curl/lib/vtls/mbedtls.c:344:1: error: ‘mbed_cipher_suite_get_str’ defined but not used [-Werror=unused-function]
    344 | mbed_cipher_suite_get_str(uint16_t id, char *buf, size_t buf_size,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~
  ```
  Ref: https://github.com/curl/curl/actions/runs/11244999065/job/31264168295#step:40:50

Also in preparation for #15193
Closes #15208
2024-10-09 02:46:01 +02:00
Viktor Szakats
b941d16d52
GHA/windows: drop vcpkg shiftmedia-gnutls, replace with mbedtls
GnuTLS vcpkg package broken again with the latest runner image update:
https://github.com/curl/curl/actions/runs/11240011311/job/31248406051?pr=15203#step:5:137

Previous breakage: 09b21e4755 #14864
Closes #15204
2024-10-08 22:19:28 +02:00
Dan Fandrich
6268caee83 INSTALL.md: fix a typo that slipped in to RISC OS
Also, illumos is spelled with lower case.
2024-10-08 09:57:05 -07:00
Daniel Stenberg
ee68b8db83
RELEASE-NOTES: synced 2024-10-08 16:50:57 +02:00
Sebastian Walz
adca93b53c
json.md: cli-option --json is an alias of --data-binary
Closes #15197
2024-10-08 16:15:06 +02:00
Daniel Stenberg
e8c024aa99
http_aws_sigv4: avoid local buffer and strcpy
This avoids the buffer, the copy and the previous host name length
limit.

Closes #15200
2024-10-08 16:13:25 +02:00
Daniel Stenberg
c5b8569c7c
tftp: avoid two memcpy/strcpy
Closes #15199
2024-10-08 15:41:42 +02:00
Daniel Stenberg
d90a8f07ed
telnet: avoid two strcpy() by pointing to the strings instead
Closes #15198
2024-10-08 15:40:00 +02:00
Daniel Stenberg
88ef62ba22
setopt: avoid superfluous length checks before strcmp()
Simplify the checks

Closes #15192
2024-10-08 15:37:19 +02:00
Daniel Stenberg
741e07edba
bearssl: avoid strpcy() when generating TLS version log message
Closes #15194
2024-10-08 15:36:05 +02:00
Daniel Stenberg
3dfc256b94
smb: replace use of strcpy() with snprintf()
Closes #15196
2024-10-08 15:34:50 +02:00
Daniel Stenberg
45b7aa6b70
altsvc: avoid using local buffer and memcpy
When parsing alt-svc headers. Store and use the length of the name
separately.

Closes #15191
2024-10-08 12:50:52 +02:00
Daniel Stenberg
60d8663afb
hsts: avoid the local buffer and memcpy on lookup
Closes #15190
2024-10-08 12:49:17 +02:00
Viktor Szakats
3e7a6fbb8e
configure: add GSS to libcurl.pc Depends:
GSS was the last (known) missing dependency missing from `libcurl.pc`.

Closes #15177
2024-10-08 11:49:18 +02:00
Viktor Szakats
9e19a577eb
cmake: detect GNU GSS
Fix to set `HAVE_GSSGNU` when GNU GSS is detected.

Also set the appropriate `pkg-config` dependency and do version
detection for the GNU GSS flavour.

Tested with `pkg-config` and partly tested without. The latter case
picks up everything else but, in my env. This is likely not the last
word to implement this detection correctly for all build-cases.

GNU GSS doesn't seem to have a Homebrew formula and building
it locally needs manual tweaks to make finish successfully.

Also move a MIT-specific header detection into to MIT-specific `if`
branch.

Closes #15176
2024-10-08 11:49:17 +02:00
Daniel Stenberg
3db50bd01f
CURLOPT_APPEND.md: goes for SFTP as well
Closes #15181
2024-10-08 11:09:04 +02:00
Daniel Stenberg
699a2df350
conncache: find bundle again in case it is removed
When the pool is cleaned up due to host limits, the bundle may be
cleaned up as well making the old pointer invalid.

Fixes #15185
Reported-by: Moritz Knüsel
Closes #15186
2024-10-08 11:06:49 +02:00
Daniel Stenberg
80dac51af8
test1915: remove wrong comment 2024-10-08 09:35:56 +02:00
Daniel Stenberg
40bd652b74
setopt: use a single function for HTTPAUTH and PROXYAUTH
Avoid duplicated almost-the-same code.

Closes #15182
2024-10-08 08:12:45 +02:00
Viktor Szakats
a79f20d376
cmake: do not propagate unused HAVE_GSSAPI_GSSAPI_KRB5_H to C
Closes #15174
2024-10-07 16:14:38 +02:00
Viktor Szakats
e888069f5a
cmake: detect HAVE_NETINET_IN6_H, HAVE_CLOSESOCKET_CAMEL, HAVE_PROTO_BSDSOCKET_H
To sync with `./configure`.

- `HAVE_NETINET_IN6_H` is
  needed by HPE NonStop NSE and NSX systems.
  Follow-up to 76ebd54175 #2155

- `HAVE_CLOSESOCKET_CAMEL`, `HAVE_PROTO_BSDSOCKET_H`
  are for AmigaOS.
  (Note: `./configure` tries to detect these for all targets, cmake does
  it only for AmigaOS, to not inflate configure time.)

Closes #15172
2024-10-07 13:45:20 +02:00
Viktor Szakats
86d5c2651d
configure: drop unused bare socket.h detection
Added in 37eba37019 (2009-06-17) to help
detecting socket functions.

But, this `socket.h` isn't used in the source code since
90dd1fc664 #8288 (2022-01-16).

Closes #15173
2024-10-07 12:31:37 +02:00
Viktor Szakats
6cfb615e92
sws: fix unused static function with TCP_NODELAY undefined
Closes #15171
2024-10-07 12:31:21 +02:00
Viktor Szakats
2d1959dd0c
configure: drop duplicate feature checks for poll(), if_nametoindex()
Before this patch they were detected via manual methods, then with
`AC_CHECK_FUNCS()`.

Delete the manual checks and keep the latter.

Also delete `CURL_INCLUDES_POLL()` which is no longer used after
the above.

Closes #15170
2024-10-07 12:31:21 +02:00
Viktor Szakats
5e70566094
build: detect and use _setmode() with Cygwin/MSYS, also use on Windows
Before this patch `setmode()` was not detected with Cygwin/MSYS, because
it's a macro, not a function, and detection is looking for a function.

Switching to symbol detection doesn't work because it mis-detects it on
BSD systems which features a function with the same name but different
functionality and arguments.

Fix it by looking for a `_setmode()` function on Cygwin/MSYS, and use it
if available.

`_setmode()` is recommended over `setmode()` by Windows documentation so
use that on Windows too. It seems to be available on all supported
compilers, so omit detection.

https://learn.microsoft.com/cpp/c-runtime-library/reference/posix-setmode
https://learn.microsoft.com/cpp/c-runtime-library/reference/setmode

Officially Windows requires argument `_O_BINARY` with an underscore.
`O_BINARY` is also supported but bound to conditions. Continue to use it
for simplicity. Cygwin supports `O_BINARY` (no underscore).

Closes #15169
2024-10-07 12:31:21 +02:00
Viktor Szakats
948a2b24f9
ech: spelling, whitespace, say --ech default config
Closes #15167
2024-10-07 12:31:21 +02:00
Viktor Szakats
a71bc67f2c
GHA/macos: comment spelling and clarity
Closes #15166
2024-10-07 12:31:21 +02:00
Viktor Szakats
1d96067224
build: add ldap to libcurl.pc Requires:
Closes #15163
2024-10-07 12:31:21 +02:00
Daniel Stenberg
d9a9233afa
RELEASE-NOTES: synced 2024-10-07 08:33:32 +02:00
Daniel Stenberg
19af07e7ef
INSTALL-CMAKE.md: mention focus on shared libraries
Match what the INSTALL.md document says for configure builds.

Reported-by: Nemos2024 on github
Fixes #14845
Closes #15168
2024-10-07 08:22:15 +02:00
renovate[bot]
6fe1c3bc6a
ci: update dependency ngtcp2/nghttp3 to v1.6.0
Closes #15161
2024-10-06 22:59:24 +02:00
renovate[bot]
4407b890a8
ci: update dependency ngtcp2/ngtcp2 to v1.8.0
Closes #15162
2024-10-06 22:59:03 +02:00
Viktor Szakats
3bd6728664
GHA/non-native: fix OmniOS job to fail on tests
Before this patch a failed test did not result in a failed CI job.

Closes #15160
2024-10-05 20:38:00 +02:00
Viktor Szakats
b171ee6019
cmake: use OpenSSL for LDAP detection only if available
Also unset `CMAKE_REQUIRED_LIBRARIES` in two error branches.

Reported-by: Vollstrecker on github
Fixes #15077
Closes #15152
2024-10-05 01:08:45 +02:00
Daniel Stenberg
e9eda865df
warnless: remove curlx_sktosi and curlx_sitosk
They were only used by test server code. Use plain old typecasts there.

Closes #15153
2024-10-05 00:28:06 +02:00
Dan Fandrich
57cc523378 tests: enable additional ruff Python lint options
These all seem reasonable to enable for this code.
2024-10-04 14:03:17 -07:00
Dan Fandrich
223fb00a78 CI: run pytype and ruff on Python code
These ensure a more consistent style and can find some errors statically
that would otherwise only be seen at run-time. Also, bump the Ubuntu
version of some other checks to get newer versions of some linters.

Closes #15067
2024-10-04 14:02:47 -07:00
Dan Fandrich
0f7ba5c5bf tests: change Python code style to pass ruff checks
Most of the changes consisted of removing unused imports and unnecessary
f-strings.
2024-10-04 14:02:05 -07:00
Dan Fandrich
2f3b7f20fb tests: fix some Python typing issues
These otherwise raise errors in pytype. A few problematic methods
weren't being used and are deleted.
2024-10-04 13:57:04 -07:00