Commit Graph

32315 Commits

Author SHA1 Message Date
Jan Venekamp
74e0bb1e7a
tests: add pytest for --ciphers and --tls13-ciphers options
Closes #13530
2024-05-25 23:57:26 +02:00
Orgad Shaneh
96a4cad46a
tool_operate: avoid explicitly setting verifypeer to 1
Also for the proxy verison. It is the default, just like verifyhost,
since a long time.

Closes #13704
2024-05-25 23:52:33 +02:00
Orgad Shaneh
302bcd0838
tests: extend user/password parsing test1620
Closes #13756
2024-05-25 23:48:57 +02:00
Alejandro R. Sedeño
e492834323
configure: use $EGREP in place of grep -E
`$EGREP` is set based on an earlier test in configure so that we can
work with systems that have `egrep` and a `grep` that does not support
`-E`.

Closes #13780
2024-05-25 23:46:33 +02:00
renovate[bot]
2fec5cd510
ci: update dependency awslabs/aws-lc to v1.28.0
Closes #13770
2024-05-25 23:44:36 +02:00
Jan Venekamp
27ae00d230
tests: test_17_ssl_use.py clarify mbedtls TLSv1.3 support
Closes #13779
2024-05-25 23:43:50 +02:00
Stefan Eissing
17af2bca58
http: write last header line late
- HEADERFUNCTIONS might inspect response properties like
  CURLINFO_CONTENT_LENGTH_DOWNLOAD_T on seeing the last header line. If
  the line is being written before this is initialized, values are not
  available.

- write the last header line late when analyzing a HTTP response so that
  all information is available at the time of the writing.

- add test1485 to verify that CURLINFO_CONTENT_LENGTH_DOWNLOAD_T works
  on seeing the last header.

Fixes #13752
Reported-by: Harry Sintonen
Closes #13757
2024-05-25 23:42:53 +02:00
Dan Fandrich
548d169c9c tests: use exec when spawning nghttpx
This stops keeping perl and shell processes around that are no longer
needed, plus it eliminates an unneeded shell message when the server is
later terminated.

Closes #13772
2024-05-24 16:38:17 -07:00
Viktor Szakats
b3f23f2084
GHA: ignore flaky test 3017 (MQTT) on OpenBSD
```
TESTFAIL: These test cases failed: 3017
```
Ref: https://github.com/curl/curl/actions/runs/9223543272/job/25376999226?pr=13759#step:3:16326
Ref: https://github.com/curl/curl/actions/runs/9230183764/job/25397883193?pr=13766#step:3:16345

Ref: https://github.com/curl/curl/pull/13583#issuecomment-2119376898
2024-05-24 23:47:21 +02:00
Joseph Chen
767909be08
build: add more supported attributes to the IAR compiler
Closes #13744
2024-05-24 23:45:45 +02:00
Viktor Szakats
0550ec2bd4
cmake: fix test 1013 with websockets enabled and no TLS
test 1013 is 'Compare curl --version with curl-config --protocols'.

Ref: https://github.com/curl/curl/actions/runs/9228363859/job/25392251955

Closes #13769
2024-05-24 22:13:18 +02:00
Viktor Szakats
4a198a50db
GHA: stop deleting curl in non-native workflows
We do it in Cirrus CI, but for some platforms it's not possible to
delete it and tests work anyway.

The test runner also runs `../src/curl` by default, which is always the
one freshly built. The runner may also need the system curl to talk to
APIs when needed.

Also:
- stop setting `CURL` env. This isn't picked up by the runners,
  and works out of the box anyway.
- quote an option just in case.

Follow-up to 90e644f944 #13583
Closes #13765
2024-05-24 22:13:18 +02:00
Jay Satiro
02b14378e6 openssl: stop duplicate ssl key logging for legacy OpenSSL
- Don't call the keylog function if it has already logged the key.

For old OpenSSL versions and its forks that do not have support for
OpenSSL's keylog callback, libcurl has its own legacy key logging
function that logs the TLS 1.2 (and earlier) key (client random + master
key) on a single line.

Prior to this change, since e7de80e8 (precedes 8.8.0), the legacy key
logging function could write the same key line more than once (usually
twice) due to some incorrect logic.

Closes https://github.com/curl/curl/pull/13683
2024-05-24 15:22:53 -04:00
Stefan Eissing
28284c8f33
transfer: remove curl_upload_refill_watermark, no longer used
the define applied to upload buffers which we removed

Closes #13764
2024-05-24 14:54:07 +02:00
Daniel Stenberg
5eb6662336
RELEASE-NOTES: synced 2024-05-24 13:33:15 +02:00
Viktor Szakats
7508e9ec41
cmake: fix brotli lib order
Fix root cause that caused missing symbols when linking brotli
statically with e.g. binutils `ld` (and any other "picky" linker,
or "traditional" linker as CMake now calls them).

Also drop existing workaround that added brotli libs twice to the lib
list.

```
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.text$ProcessCommands[ProcessCommands]+0xbb5): undefined reference to `BrotliTransformDictionaryWord'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.text$SafeProcessCommands[SafeProcessCommands]+0xe8a): undefined reference to `BrotliTransformDictionaryWord'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.rdata$.refptr._kBrotliContextLookupTable[.refptr._kBrotliContextLookupTable]+0x0): undefined reference to `_kBrotliContextLookupTable'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(decode.c.obj):decode.c:(.rdata$.refptr._kBrotliPrefixCodeRanges[.refptr._kBrotliPrefixCodeRanges]+0x0): undefined reference to `_kBrotliPrefixCodeRanges'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x21): undefined reference to `BrotliDefaultAllocFunc'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x2f): undefined reference to `BrotliDefaultFreeFunc'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateInit[BrotliDecoderStateInit]+0x10e): undefined reference to `BrotliSharedDictionaryCreateInstance'
x86_64-w64-mingw32-ld: .../curl/brotli/_bld/usr/lib/libbrotlidec.a(state.c.obj):state.c:(.text$BrotliDecoderStateCleanup[BrotliDecoderStateCleanup]+0xf4): undefined reference to `BrotliSharedDictionaryDestroyInstance'
collect2: error: ld returned 1 exit status
```

Breakage reproducible with curl-for-win config "`win-gcc`" and deleting
the `LDFLAGS+=' -Wl,--start-group'` line from its `curl.sh` script.
(Above line still required for some non-brotli cases, e.g. libssh2 and
zlib.)

Assisted-by: Kai Pastor
Ref: https://github.com/curl/curl/pull/10857#discussion_r1611714989
Follow-up to 1e3319a167 #10857
Closes #13761
2024-05-24 11:23:37 +02:00
Pavel P
30c3bf1656 cmake: fix building in unity mode
- Fix sha256 and sha512 duplicate macro names (eg function-like macro Ch
  is now Sha256_Ch and Sha512_Ch).

- Avoid defining short defines like R, S. (eg S is now Sha256_S).

Closes https://github.com/curl/curl/pull/13751
2024-05-24 03:25:19 -04:00
Jay Satiro
795515c773 winbuild: remove outdated WIN32 defines
- Remove all instances in the makefile of compiler option /DWIN32.

This is a follow-up to e9a7d4a1 which replaced all defined(WIN32) checks
with defined(_WIN32) in the codebase, since only the latter is
automatically defined by all compilers for Windows builds.

Bug: https://github.com/curl/curl/pull/13739#issuecomment-2123937859
Reported-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/13742
2024-05-24 03:23:14 -04:00
renovate[bot]
86cb12a400
ci: update github/codeql-action digest to 9fdb3e4
Closes #13726
2024-05-24 00:02:03 +02:00
Pavel P
0caadc1f24
asyn-thread: avoid using GetAddrInfoExW with impersonation
Multiple reports suggest that GetAddrInfoExW fails when impersonation is
used. This PR checks if thread is impersonating and avoids using
GetAddrInfoExW api.

Reported-by: Keerthi Timmaraju
Assisted-by: edmcln on github
Fixes #13612
Closes #13738
2024-05-23 23:56:58 +02:00
Stefan Eissing
30de937bda
transfer: conn close on paused upload
- add 2 variations on test_07_42 which PAUSEs uploads
  and response connections terminating either right away
  or after the 100-continue response
- when detecting the connection being closed in transfer.c
  readwrite_data(), clear ALL send bits in data->req.keepon.
  It no longer makes send to wait for a KEEP_SEND_PAUSE or HOLD.
- in the protocol client writer add the check for incomplete
  response bodies. When an EOS is seen and the length is known,
  check that and fail if bytes are missing.

Reported-by: Sergey Bronnikov
Fixes #13740
Closes #13750
2024-05-23 23:55:09 +02:00
Stefan Eissing
c5e322fb50
CI GHA: add vsftpd to ngtcp2-linux runs
- not using HTTP/3, but gnutls does not seem to run
  somewhere else right now

Closes #13760
2024-05-23 23:46:06 +02:00
Orgad Shaneh
cc383ee237
GHA: increase timeout for Cygwin autotools build tests step
Apparently 10 minutes are not (always) enough:
https://github.com/curl/curl/actions/runs/9197003907/job/25296439556#step:8:1936

Closes #13753
2024-05-23 13:29:47 +02:00
Stefan Eissing
1c4813c769
mbedtls: send close-notify on close
- send the TLS close notify message when cloding down
  the mbedtls connection filter
- this is a "least" effort version and, as other TLS filters,
  is lacking a graceful send/receive/timeout for a really
  clean shutdown.

Closes #13745
2024-05-22 23:07:22 +02:00
Stefan Eissing
0c4b4c1e93
mbedtls: check version for cipher id
mbedtls_ssl_get_ciphersuite_id_from_ssl() seems to have been added in
mbedtls 3.2.0. Check for that version.

Closes #13749
2024-05-22 23:05:41 +02:00
Viktor Szakats
ca8cb245e1
cmake: fix building with both md4 and md5 in unity mode
Macro and static function names were colliding between
`lib/md4.c` and
`lib/md5.c`.

Fix it by namespacing these symbols.

Seen with a basic macOS build using these options:
`-DCMAKE_UNITY_BUILD=ON -DCURL_USE_SECTRANSP=ON`

Closes #13737
2024-05-22 14:16:40 +02:00
Daniel Stenberg
4cc5657247
docs/Makefile.am: make curl-config.1 install
on "make install" like it should

Follow-up to 60971d665b

Closes #13741
2024-05-22 09:26:55 +02:00
dependabot[bot]
ac68a2dd85
GHA: bump actions/checkout from 4.1.4 to 4.1.6
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.4 to 4.1.6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](0ad4b8fada...a5ac7e51b4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Closes #13720
2024-05-22 09:14:10 +02:00
Stefan Eissing
5a913d8dc3
pytest: add ftp upload tests
- refs #13556
- allow anon uploads on vsftpd test server
- add test_30_05 for plain upload of 1k, 100k, 1m
- add test_31_05 for SSL upload of 1k, 100k, 1m
- verify file size and contents

Closes #13734
2024-05-22 09:12:43 +02:00
Stefan Eissing
f867942511
test: add test1546, chunked not last transfer encoding
with more than one transfer-encoding, 'chunked' must be the last added
to the writer stack (and therefore the first to decode). RFC 9112, ch.
6.1.

Closes #13736
2024-05-22 09:11:13 +02:00
Stefan Eissing
5e403dff06
test: add test1484, for HEAD with content
- test HEAD request with 'Transfer-Encoding:chunked' and
  non-encoded response content
- verifies #13725

Closes #13735
2024-05-22 09:10:00 +02:00
Daniel Stenberg
e4384b5c22
RELEASE-NOTES: synced
bump to 8.8.1 for now
2024-05-22 08:53:19 +02:00
Viktor Szakats
d13a3a6635
(lib)curl.rc: set debug flag also for CURLDEBUG and UNITTESTS
These macros also enable debug features in both libcurl and curl.
Enable `VS_FF_DEBUG` version resource flag when they are set.

Closes #13730
2024-05-22 08:38:12 +02:00
Jay Satiro
6eb99d7c1c winbuild: fix PE version info debug flag
- Only set PE file flag VS_FF_DEBUG if curl.exe and libcurl.dll were
  built with winbuild option DEBUG=yes which builds with debug info.

VS_FF_DEBUG is a PE flag (Portable Executable file flag - dll, exe, etc)
that indicates the file contains or was built with debug info.

Prior to this change when winbuild was used to build curl, curl.exe
and libcurl.dll always had VS_FF_DEBUG set, regardless of build option
DEBUG=yes/no, due to some bad logic.

Closes https://github.com/curl/curl/pull/13739
2024-05-22 02:30:40 -04:00
Daniel Stenberg
fd567d4f06
RELEASE-NOTES: synced 2024-05-22 07:54:25 +02:00
Daniel Stenberg
bbb0cecf73
THANKS: add contributors from 8.8.0 2024-05-22 07:54:25 +02:00
Nathan Moinvaziri
6ea9388157
url: remove duplicate call to Curl_conncache_remove_conn when pruning
- remove unnecessary prunedead struct from prune_dead_connections
- rename extract_if_dead to prune_if_dead for clarity

Closes #13710
2024-05-21 16:25:21 +02:00
Joseph Chen
c56071f41f
curl_setup.h: add support for IAR compiler
Closes #13728
2024-05-21 15:10:23 +02:00
Stephen Farrell
10a523c5e5
docs/ECH: typo/clarification
Closes #13727
2024-05-21 15:09:24 +02:00
Viktor Szakats
3b9ac3646b
hash: delete unused debug function
It had no use in the curl codebase and was also protected by the macro
`AGGRESSIVE_TEST` (renamed in 2020), also with no local reference.

Added in ca6e770837 (2002-11-11)

Closes #13729
2024-05-21 15:08:04 +02:00
Stefan Eissing
1d7b86e72b
content_encoding: reject transfer-encoding after chunked
reject a response that applies a transfer-encoding after a 'chunked'
encoding. RFC 9112 ch. 6.1 required chunked to be the final encoding.

Closes #13733
2024-05-21 15:06:41 +02:00
Stefan Eissing
5a4769b6d5
http: HEAD response body tolerance
- as reported in #13725, some servers wrongly send body bytes in
  responses to a HEAD request. This used to be tolerated in curl
  8.4 and before and leads to failed transfers in newer versions.
- restore previous behaviour for HTTP/1.1 and HTTP/2:
  * 1.1: do not add 'Transfer-Encoding' writers from HEAD
    responses. RFC 9112 says they do not apply.
  * 2: when the transfer expects 'no_body', to not report stream
    resets as error when all response headers have been received.

Reported-by: Jeroen Ooms
Fixes #13725
Closes #13732
2024-05-21 14:51:11 +02:00
Viktor Szakats
dbd626ab82
tests: fix TFTP test 2305 on Windows
Ref: #13692
Closes #13724
2024-05-20 21:20:02 +02:00
Jay Satiro
9aae9bf817 openssl: revert keylog_callback support for LibreSSL
- Revert to the legacy TLS 1.2 key logging code for LibreSSL.

- Document SSLKEYLOGFILE for LibreSSL is TLS 1.2 max.

Prior to this change if the user specified a filename in the
SSLKEYLOGFILE environment variable and was using LibreSSL 3.5.0+ then
an empty file would be created and no keys would be logged.

This is effectively a revert of e43474b4 which changed openssl.c to use
SSL_CTX_set_keylog_callback for LibreSSL 3.5.0+. Unfortunately LibreSSL
added that function only as a stub that doesn't actually do anything.

Reported-by: Gonçalo Carvalho

Fixes https://github.com/curl/curl/issues/13672
Closes https://github.com/curl/curl/pull/13682
2024-05-20 03:55:40 -04:00
renovate[bot]
bdfb41a04c
GHA: pin dependencies
Closes #13712
2024-05-19 23:37:59 +02:00
Viktor Szakats
2a9e08c2d0
appveyor: drop unnecessary --clean-first cmake option
In CI all machines are fresh on startup, making the `clean` operation
unnecessary. This can save some time/energy for each job run.

Closes #13707
2024-05-19 23:26:56 +02:00
Viktor Szakats
0b31c713a9
cmake: merge two if(BUILD_TESTING) branches
Closes #13708
2024-05-19 23:18:20 +02:00
Tatsuhiro Tsujikawa
7e932fac94
GHA: bump nghttp2 to v1.62.1
Use gcc-12 explicitly to compile C++20 source files.

Closes #13702
2024-05-19 23:15:00 +02:00
Viktor Szakats
90e644f944
GHA: add NetBSD, OpenBSD, FreeBSD/arm64 and OmniOS jobs
Add these jobs to GHA:
- NetBSD, cmake-unity, clang, OpenSSL, x86_64, with tests, w/o python,
  no parallelism (was flaky sometimes)
- OpenBSD, cmake-unity, clang, LibreSSL, x86_64, with tests,
  with python, -j8, TFTP results ignored due to #13623.
- FreeBSD, cmake-unity and autotools, clang, OpenSSL, arm64
  (Tests disabled for arm64, because they are slow. It's available for
  x86_64 with python, -j12.)
  Configuration matches our existing Cirrus CI one.
- OmniOS, autotools, gcc, OpenSSL, x86_64, with tests, -j12.

All build with websockets and examples.

Closes #13583
2024-05-19 23:06:54 +02:00
Viktor Szakats
df3f4340f2
GHA: disable TFTP test on native Windows
Some TFTP tests seem to enter into a loop and maybe hang?

E.g. 1007, 1009, 1238

Try fixing it by skipping all TFTP tests.

Ref: https://github.com/curl/curl/actions/runs/9141987545/job/25137038249?pr=13698

Also drop mingw-w64 test exclusions copy-pasted from MSYS jobs.

Possibly related: cffbcc3110 #5364

Close #13699
2024-05-19 13:02:51 +02:00