Commit Graph

34076 Commits

Author SHA1 Message Date
Viktor Szakats
41e5a116a1
src: drop support for CURL_TESTDIR debug env
No longer used by curl tests.

`--output-dir` option can be used as an alternative in all builds.

Follow-up to 39697dead3 #15114
Closes #15893
2025-01-02 14:44:39 +01:00
Viktor Szakats
772b6933bc
cmake/FindLDAP: avoid framework locations for libs too (Apple)
We already avoid system framework paths while looking for LDAP headers
to avoid issues.

Do the same while looking for LDAP libraries. This makes sure to find
the regular ldap library (`libldap.tbd`) instead of picking up
`ldap.framework` and let that seep into `libcurl.pc` with a full path.

This makes LDAP detection work on Apple as before introducing FindLDAP.

Follow-up to 49f2a23d50 #15273
Closes #15895
2025-01-02 12:55:50 +01:00
Viktor Szakats
27b9e76706
cmake: make system libraries dl, m, pthread customizable
via `DL_LIBRARY`, `MATH_LIBRARY`, `PTHREAD_LIBRARY` variables.

They are used in Rustls, wolfSSL Find modules.

Also:
- always use `NAMES` keyword in `find_library()` calls.
- respect `find_library()` results for `dl`, `m`, `pthread`.
- formatting.

Closes #15892
2025-01-02 12:55:50 +01:00
Viktor Szakats
9a9498ea1e
curl_sha512_256: rename symbols to the curl namespace
Closes #15894
2025-01-02 12:55:50 +01:00
Daniel Stenberg
91587522a1
docs/HTTP-COOKIES.md: link to more information
Closes #15891
2025-01-01 22:45:48 +01:00
Daniel Stenberg
7fb113f01f
hash: add asserts in hash_element_dtor()
This just adds a precaution and shows a clear intention in the code.
Added because CodeSonar is reporting a false positive Use After Free on
this function.

Closes #15889
2025-01-01 21:13:38 +01:00
Daniel Stenberg
7fed7274e4
COPYING: bump copyright year range to 1996 - 2025
Closes #15890
2025-01-01 21:12:12 +01:00
Daniel Stenberg
af4e85925d
select: avoid a NULL deref in cwfds_add_sock
curl_multi_waitfds(m, NULL, ...);

=> Curl_waitfds_init(&cwfds, ufds, size);

=> Curl_waitfds_add_ps(&cwfds);

=>   cwfds_add_sock(cwfds, ...);

Would then try to use the ->wfds array while set to NULL previously.
This should not happen, which this is now also protected with an assert
to trigger debug builds if it happens.

Caught by CodeSonar

Assisted-by: Jay Satiro

Closes #15881
2025-01-01 20:56:27 +01:00
Daniel Stenberg
26a672260b
RELEASE-NOTES: synced 2025-01-01 14:50:59 +01:00
Jakub Jelen
999cc818c5
openssl: add support to use keys and certificates from PKCS#11 provider
In OpenSSL < 3.0, the modularity was provided by mechanism called
"engines". This is supported in curl, but the engines got deprecated
with OpenSSL 3.0 in favor of more versatile providers.

This adds a support for OpenSSL Providers, to use PKCS#11 keys, namely
through the pkcs11 provider. This is done using similar approach as the
engines and this is automatically built in when the OpenSSL 3 and newer
is used.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>

Closes #15587
2025-01-01 14:47:31 +01:00
Viktor Szakats
d1336ca14a
GHA/http3-linux: drop redundant pkg-config paths for ngtcp2/nghttp2
- ngtcp2: drop `$PWD/build` (= self)
- ngtcp2: drop nghttp3. It's only used for examples, which we do not use
  here and are disabled by default.
- nghttp2: drop `$HOME/build` (does not exist)

Closes #15887
2025-01-01 14:28:38 +01:00
Daniel Stenberg
150b0d808b
urlapi: cleanup the redirect logic somewhat
Closes #15877
2025-01-01 14:11:15 +01:00
Viktor Szakats
07a084f539
lib: remove __EMX__ guards
Follow-up to 179ee78e86 #2166
Closes #15884
2025-01-01 12:44:20 +01:00
Viktor Szakats
70b49a4e4c
file: fix Android compiler warning
Apply the fix already used in `lib/fopen.c`.

```
lib/file.c:326:41: warning: implicit conversion loses integer precision: 'unsigned int' to 'mode_t' (aka 'unsigned short') [-Wimplicit-int-conversion]
  326 |   fd = open(file->path, mode, data->set.new_file_perms);
      |        ~~~~                   ~~~~~~~~~~^~~~~~~~~~~~~~
```

Closes #15883
2025-01-01 12:44:20 +01:00
Viktor Szakats
5054c68b58
file: drop OPEN_NEEDS_ARG3 option
Not set since 1bf3643f7b #8362 (2022)
Added in 00883822be (2009) for VxWorks.

Closes #15882
2025-01-01 12:44:20 +01:00
Viktor Szakats
98932f3487
multissl: auto-enable OPENSSL_COEXIST for wolfSSL + OpenSSL
When building with both OpenSSL and wolfSSL set this necessary option.
Otherwise fail with an error.

Requires wolfSSL v5.7.6 or upper.

Closes #15765
2025-01-01 06:20:30 +01:00
renovate[bot]
1019b410c9
CI: update dependency wolfSSL/wolfssl to v5.7.6
Closes #15886
2025-01-01 05:46:31 +01:00
Viktor Szakats
0f1b23e960
build: replace configure check with PP condition (Android <21)
To make it build again with CMake + Android 20 and earlier.

8e34505776 synced `getpwuid_r()` detection
in cmake with autotools. It means cmake started detecting it with
Android <21 just like autotools, and thus cmake builds also need to
tackle the missing declaration with old Android SDK versions. Use a PP
solution, allowing to drop the autotools-specific on used before this
patch.

Follow-up to 8e34505776 #15164
Follow-up to 9c33813d83 #2609
Ref: #2058
Closes #15871
2025-01-01 04:55:54 +01:00
Marcel Raad
280ff5ca03
test483: require cookie support
The test fails with `--disable-cookies`.

Closes https://github.com/curl/curl/pull/15876
2024-12-31 16:35:54 +01:00
Daniel Stenberg
4f920122a2
test3105: verify multi_remove_handle done twice
It should be ok.

Ref: #15852
Closes #15860
2024-12-31 12:03:51 +01:00
Viktor Szakats
aef7888649
cmp-config: drop 3 exceptions
Follow-up to fd067bfb5b #15596
Closes #15872
2024-12-31 11:40:50 +01:00
Viktor Szakats
8d42016945
GHA/configure-vs-cmake: trigger by CMake/** updates
Closes #15875
2024-12-31 11:36:56 +01:00
Viktor Szakats
342a654ef3
cmake: sync OpenSSL QUIC fork detection with autotools
Before this patch, detection used a function which wasn't called
from curl since d2c6d8be18 #8968.

Follow-up to b3f02e1d92 #12683
Closes #15873
2024-12-31 11:36:56 +01:00
Viktor Szakats
4badbbeb5b
cmake: fix net/in.h detection for MS-DOS
Syncing this with autotools.

Follow-up to 8e34505776 #15164
Closes #15869
2024-12-31 11:36:56 +01:00
Viktor Szakats
10fe952da0
build: fix unsigned time_t detection for cmake, MS-DOS, AmigaOS
- cmake: add auto-detection. Sync this with autotools.
- enable for MS-DOS and AmigaOS builds.
  (auto-detection doesn't work for cross-builds.)
- tidy up detection snippet.
- fix comment.

Closes #15868
2024-12-31 11:36:56 +01:00
Viktor Szakats
f60f872bcd
configure: drop unused detections and macros
- drop `HAVE_IOCTL` macro, drop exception.
- drop unused `setjmp.h` detection, drop exception.
  It's a C89 header and result also not used in detections.
- use C89 `stdlib.h` without detection.
  (It's still being detected by autotools anyway.)

Closes #15867
2024-12-31 11:36:55 +01:00
Jay Satiro
713182bd19 multi: fix return code for an already-removed easy handle
- Ensure that CURLM_OK is returned when curl_multi_remove_handle is
  called with an already removed easy handle.

Prior to this change and since ba235ab2 which precedes 8.10.0, if
curl_multi_remove_handle was called with an already-removed easy handle
then the return code would be CURLM_OK or CURLM_BAD_EASY_HANDLE
depending respectively on whether the multi did or did not contain other
easy handles.

This change restores the old behavior of returning CURLM_OK in both
cases.

Reported-by: Ralph Sennhauser

Fixes https://github.com/curl/curl/issues/15844
Closes https://github.com/curl/curl/pull/15852
2024-12-31 03:20:36 -05:00
Jay Satiro
6c70ec16c7 http: ignore invalid Retry-After times
- Treat negative Retry-After date-based times as 0.

- Treat Retry-After times greater than 6 hours as 6 hours.

Prior to this change Retry-After did not have a limited range and the
server could have set a time greater than 6 hours or a date in the past
that would result in a negative time, either of which may be unexpected
by the user.

The 6 hour limit is purposely not documented so that it can be changed
in the future if necessary.

Closes https://github.com/curl/curl/pull/15833
2024-12-31 03:19:22 -05:00
Viktor Szakats
8d1f26b866
GHA/http3-linux: do run on cmake build updates
Closes #15874
2024-12-31 04:16:19 +01:00
Viktor Szakats
1e14e1682c
examples/block-ip: drop redundant memory.h include
Not used elsewhere in the repo.
2024-12-31 00:35:57 +01:00
Viktor Szakats
f7c2bf0818
cmake: rename Windows detection cache file
To flatten the directory tree.

Closes #15859
2024-12-31 00:24:00 +01:00
Stefan Eissing
8a66c11a29
vtls: only remember the expiry timestamp in session cache
Instead of receive and lifetime, keep only the eppch seconds when a
session expires.

Closes #15861
2024-12-30 16:14:52 +01:00
Daniel Stenberg
c2d37463b9
curl/var: change byte offset syntax for assignments
Follow-up to 40c264db61 after discussions on IRC.

The new style is

  name[0-99]=contents

and

  name[0-99]@filename

A) This does not cause the same problems with old curl versions trying
the new syntax as this way will cause old curls just fail with syntax
error and not risk using the wrong file.

B) Adds the same byte range support for "normal" assigns, which the
previous syntax did not. Thus lets a user get a partial content of a
variable etc.

Added test 790 and 791 to verify non-file assigns with ranges.

Closes #15862
2024-12-30 15:55:54 +01:00
Viktor Szakats
e7b90dadb2
GHA/non-native: measure duration of individual build steps inside VMs
Closes #15864
2024-12-30 14:23:45 +01:00
dependabot[bot]
5dc5bd7638
CI: bump actions/cache from 4.1.2 to 4.2.0
Bumps [actions/cache](https://github.com/actions/cache) from 4.1.2 to 4.2.0.
- [Release notes](https://github.com/actions/cache/releases)
- [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
- [Commits](https://github.com/actions/cache/compare/v4.1.2...1bd1e32a3bdc45362d1e726936510720a7c30a57)

---
updated-dependencies:
- dependency-name: actions/cache
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #15817
2024-12-30 14:05:25 +01:00
dependabot[bot]
2a6dfe0274
CI: bump actions/upload-artifact from 4.4.3 to 4.5.0
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 4.4.3 to 4.5.0.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](b4b15b8c7c...6f51ac03b9)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Closes #15816
2024-12-30 14:03:46 +01:00
Daniel Stenberg
53fcac438a
TheArtOfHttpScripting.md: rewrite double 'that'
Closes #15863
2024-12-30 14:02:37 +01:00
Stefan Eissing
a2622cdbd5
mbedtls: fix handling of blocked sends
mbedtls is picky when a mbedtls_ssl_write) was previously blocked. It
requires to be called with the same amount of bytes again, or it will
lose bytes, e.g. reporting all was sent but they were not. Remember the
blocked length and use that when set.

Reported-by: Tamás Bálint Misius
Fixes #15801
Closes #15846
2024-12-30 10:20:27 +01:00
Daniel Stenberg
c445b7426a
checksrc: introduce 'banfunc' to ban specific functions
Use 'banfunc' and 'allowfunc' in .checksrc to specify which functions to
ban or allow to be used. This saves us from having to edit the script
going forward when we want to ban or allow specific functions.

This replaces a set of previous rules and all banned functions are now
checked with the BANNEDFUNC rule.

There is a set of default banned functions, shown by invoking
./checksrc.

Also, -a and -b options are added to specify allowed or banned functions
on the command line.

Closes #15835
2024-12-30 08:25:56 +01:00
Daniel Stenberg
66e5351e0a
urlapi: fix redirect to a new fragment or query (only)
The redirect logic was broken when the redirect-to URL was a relative
URL only as a fragment or query (starting with '#' or '?').

Extended test 1560 to reproduce, then verify.

Reported-by: Jeroen Ooms
Fixes #15836
Closes #15848
2024-12-30 08:23:26 +01:00
renovate[bot]
687a62f100
CI: update vmactions/omnios-vm digest
to 8eba2a9217

Closes #15853
2024-12-30 01:34:53 +01:00
Daniel Stenberg
f0cfead78f
RELEASE-NOTES: synced
Bump the planned next version to 8.12.0
2024-12-29 14:23:21 +01:00
Viktor Szakats
b8b982c136
cmake: use STREQUAL to detect Linux
Instead of `MATCHES`.
To sync with another check that already used `STREQUAL`.

Closes #15855
2024-12-29 13:14:58 +01:00
Christopher Dannemiller
c78044c07e multi: fix curl_multi_waitfds reporting of fd_count
- Make curl_multi_waitfds consistent with the documentation.

Issue Addressed:

 - The documentation of curl_multi_waitfds indicates that users should
   be able to call curl_multi_waitfds with a NULL ufds. However, before
   this change, the function would return CURLM_BAD_FUNCTION_ARGUMENT.
 - Additionally, the documentation suggests that users can use this
   function to determine the number of file descriptors (fds) needed.
   However, the function would stop counting fds if the supplied fds
   were exhausted.

Changes Made:

 - NULL ufds Handling: curl_multi_waitfds can now accept a NULL ufds if
   size is also zero.
 - Counting File Descriptors: If curl_multi_waitfds is passed a NULL
   ufds, or the size of ufds is insufficient, the output parameter
   fd_count will return the number of fds needed. This value may be
   higher than actually needed but never lower.

Testing:

 - Test 2405 has been updated to cover the usage scenarios described
   above.

Fixes https://github.com/curl/curl/issues/15146
Closes https://github.com/curl/curl/pull/15155
2024-12-29 01:05:09 -05:00
Viktor Szakats
7d6edf1d8d
GHA/windows: shorten job timeouts
To reduce the wait for re-running stuck jobs.

Sometimes jobs hang/get stuck while running tests, ignoring the step
timeout.

Closes #15851
2024-12-29 01:13:32 +01:00
Viktor Szakats
abb4fa5b62
cmake: optimize out 4 picky warning option detections with gcc
Follow-up to 9c543de0ec #10973
Closes #15850
2024-12-29 01:13:31 +01:00
Viktor Szakats
3780c7abcd
cmake: drop unused HAVE_SYS_XATTR_H detection
Follow-up to 8e34505776 #15164
Follow-up to 1c877a0712 #1176

Closes #15845
2024-12-28 12:29:59 +01:00
Viktor Szakats
ef07663bc4
cmake: tidy up local variable names
Closes #15843
2024-12-28 12:29:59 +01:00
Viktor Szakats
aed02db247
cmake: drop duplicate Windows cache value
Closes #15840
2024-12-28 10:34:37 +01:00
Viktor Szakats
c5dff4b817
tidy-up: rename MHDX_INLINE to CURL_FORCEINLINE
Closes #15839
2024-12-28 10:34:35 +01:00