Commit Graph

30096 Commits

Author SHA1 Message Date
Stefan Eissing
f8f010e469
tests/http: fix log formatting on wrong exit code
Closes #10868
2023-03-30 13:09:12 +02:00
Daniel Stenberg
843a72b456
spellcheck.words: unify the AWS-LC spelling
Follow-up to 34ef4fab22

Closes #10867
2023-03-30 11:40:00 +02:00
Jim King
34ef4fab22
openssl: interop with AWS-LC
* Configure changes to detect AWS-LC
* CMakeLists.txt changes to detect AWS-LC
* Compile-time branches needed to support AWS-LC
* Correctly set OSSL_VERSION and report AWS-LC release number
* GitHub Actions script to build with autoconf and cmake against AWS-LC

AWS-LC is a BoringSSL/OpenSSL derivative
For more information see https://github.com/awslabs/aws-lc/

Closes #10320
2023-03-30 10:56:14 +02:00
Viktor Szakats
1e3319a167
cmake: picky-linker fixes for openssl, ZLIB, H3 and more
- fix HTTP/3 support detection with OpenSSL/quictls built with ZLIB.
  (Requires curl be built with ZLIB option also.)

- fix HTTP/3 support detection with OpenSSL/quictls/LibreSSL and `ld`
  linker on Windows.

- fix HTTP/3 support detection with wolfSSL to automatically add
  `ws2_32` to the lib list on Windows. For all linkers.

- reposition ZLIB (and other compression) detection _after_ TLS
  detection, but before calling HTTP/3-support detection via
  `CheckQuicSupportInOpenSSL`.

  May be a regression from ebef55a61d
  May fix #10832 (Reported-by: Micah Snyder)

  This also seems to fix an odd case, where OpenSSL/quictls is correctly
  detected, but its header path is not set while compiling, breaking
  build at `src/curl_ntlm_core.c`. Reason for this remains undiscovered.

- satisfy "picky" linkers such as `ld` with MinGW, that are highly
  sensitive to lib order, by also adding brotli to the beginning of the
  lib list.

- satisfy "picky" linkers by adding certain Windows systems libs to
  the lib list for OpenSSL/LibreSSL. (Might need additional ones for
  other forks, such as `pthread` for BoringSSL.)

Note: It'd make sense to _always_ add `ws2_32`, `crypt32` (except
Windows App targets perhaps?), `bcrypt` (except old-mingw!) on Windows
at this point. They are almost always required, and if some aren't,
they are ignored by the linker with no effect on final binaries.

Closes #10857
2023-03-30 08:55:20 +00:00
Stefan Eissing
b74bba9aad
vlts: use full buffer size when receiving data if possible
SSL backends like OpenSSL/wolfSSL and other return the content of one
TLS record on read, but usually there are more available.

Change the vtls cfilter recv() function to fill the given buffer until a
read would block.

Closes #10736
2023-03-30 10:04:20 +02:00
dengjfzh
6c6306f300
rtsp: skip malformed RTSP interleaved frame data
Some IP cameras send malformed RTSP interleaved frames sometimes, which
can cause curl_easy_perform return 1 (CURLE_UNSUPPORTED_PROTOCOL).  This
change attempts to skip clearly incorrect RTSP interleaving frame data.

Closes #10808
2023-03-30 09:59:09 +02:00
Stefan Eissing
61f52a97e9
lib: add bufq and dynhds
Adding `bufq`:
- at init() time configured to hold up to `n` chunks of `m` bytes each.
- various methods for reading from and writing to it.
- `peek` support to get access to buffered data without copy
- `pass` support to allow buffer flushing on write if it becomes full
- use case: IO buffers for dynamic reads and writes that do not blow up
- distinct from `dynbuf` in that:
  - it maintains a read position
  - writes on a full bufq return CURLE_AGAIN instead of nuking itself
- Init options:
  - SOFT_LIMIT: allow writes into a full bufq
  - NO_SPARES: free empty chunks right away
- a `bufc_pool` that can keep a number of spare chunks to
  be shared between different `bufq` instances

Adding `dynhds`:
- a straightforward list of name+value pairs as used for HTTP headers
- headers can be appended dynamically
- headers can be removed again
- headers can be replaced
- headers can be looked up
- http/1.1 formatting into a `dynbuf`
- configured at init() with limits on header counts and total string
  sizes
- use case: pass a HTTP request or response around without being version
  specific
- express a HTTP request without a curl easy handle (used in h2 proxy
  tunnels)
- future extension possibilities:
  - conversions of `dynhds` to nghttp2/nghttp3 name+value arrays

Closes #10720
2023-03-30 09:08:05 +02:00
Stefan Eissing
8cabef6fc3
pytest: improvements for suitable curl and error output
- will check built curl for http and https support and
  skip all tests if not there
- will dump stdout/stderr/trace output on errored responses

Closes #10829
2023-03-29 13:25:18 +02:00
Daniel Stenberg
8455013359
lib: use correct printf flags for sockets and timediffs
Introduces CURL_FORMAT_SOCKET_T for outputting socket numbers.

Fixes #10737
Reported-by: Gisle Vanem
Closes #10855
2023-03-29 13:12:29 +02:00
Daniel Stenberg
9a607fd728
telnet: make MSVC ignore warning for assignment within conditional
Follow-up to d92a5007b6

Closes #10859
2023-03-29 13:07:17 +02:00
Daniel Stenberg
b19cbebbb4
ws: handle reads before EAGAIN better
Reported-by: simplerobot on github
Fixes #10831
Closes #10856
2023-03-29 10:23:29 +02:00
Daniel Stenberg
baeaeecb0a
test1592: add flaky keyword
Closes #10860
2023-03-29 09:11:50 +02:00
Frank Gevaerts
abb9be36f1
lib/sha256.c: typo fix in comment (duplicated "is available")
Closes #10851
2023-03-28 17:52:41 +02:00
Arne Soete
2eadae8673
tests: update tests/httpd references to tests/http
tests/httpd was renamed to tests/http in #10654. This patch updates some
references in the README

Closes #10854
2023-03-28 17:50:59 +02:00
Kamil Dudka
d92a5007b6 telnet: simplify the implementation of str_is_nonascii()
There is no need to traverse the string twice.

Closes #10852
2023-03-28 15:41:55 +02:00
Frank Gevaerts
1903b95e4c
curl_easy_getinfo.3: typo fix (duplicated "from the")
Closes #10850
2023-03-28 11:59:49 +02:00
Philip H
3f3dfb4d0c
wolfssl.yml: bump to version 5.6.0
Closes #10843
2023-03-28 11:30:16 +02:00
Daniel Stenberg
3f9973f4df
RELEASE-NOTES: synced 2023-03-28 11:01:55 +02:00
Ronan Pigott
8d9c1a8aa8
docs/cmdline-opts: document the dotless config path
The real xdg config path is $XDG_CONFIG_HOME/curlrc, without the dot.
The dotless name seems preferable, so let's match the documentation to
the behavior.

Closes #10849
2023-03-28 10:32:00 +02:00
Daniel Stenberg
4fe6c91e7a
HTTP-COOKIES.md: mention the #HttpOnly_ prefix
Fixes #10847
Reported-by: Harry Sintonen
Closes #10848
2023-03-28 10:28:33 +02:00
Daniel Stenberg
5a10f48778
dynbuf: never allocate larger than "toobig"
As dynbufs always have a fixed maximum size which they are not allowed
to grow larger than, making sure that it never allocates a larger buffer
makes sure the buffer does not allocate memory that will never be used.

Closes #10845
2023-03-28 10:22:53 +02:00
Daniel Stenberg
c1d6fe2aaa
ftplistparser: replace realloc with dynbuf
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
2203bd13ff
ftplistparser: use ISDIGIT()
Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
01114f6efd
ftplistparser: move out private data from public struct
The public 'curl_fileinfo' struct contained three fields that are for
internal purposes only. This change makes them unused in the public
struct.

The new private struct fields are also renamed to make this separation
more obvious internally.

Closes #10844
2023-03-28 10:11:33 +02:00
Daniel Stenberg
e4cd1ffed1
openssl: fix indents - white space edits only
Closes #10840
2023-03-28 10:02:40 +02:00
Daniel Stenberg
5fec927374
url: remove call to Curl_llist_destroy in Curl_close
A list that is created with a NULL "destructor" does not need to be
destroyed. Not calling it is faster than calling it.

Closes #10846
2023-03-27 23:36:16 +02:00
Daniel Stenberg
843b3baa3e
multi: remove PENDING + MSGSENT handles from the main linked list
As they are not driving transfers or any socket activity, the main loop
does not need to iterate over these handles. A performance improvement.

They are instead only held in their own separate lists.

'data->multi' is kept a pointer to the multi handle as long as the easy
handle is actually part of it even when the handle is moved to the
pending/msgsent lists. It needs to know which multi handle it belongs
to, if for example curl_easy_cleanup() is called before the handle is
removed from the multi handle.

Alll 'data->multi' pointers of handles still part of the multi handle
gets cleared by curl_multi_cleanup() which "orphans" all previously
attached easy handles.

This is take 2. The first version was reverted for the 8.0.1 release.

Assisted-by: Stefan Eissing
Closes #10801
2023-03-26 17:43:28 +02:00
Stefan Eissing
9d107b6954
tests/http: add timeout to running curl in test cases
- we had a CI case once where `curl` seemingly did not
  return and it was hard to guess what happened.
- make curl execution in test cases time out after 60 seconds

Closes #10783
2023-03-26 17:41:46 +02:00
Daniel Stenberg
9c469942e2
RELEASE-PROCEDURE: update to new schedule
Ref: https://curl.se/mail/lib-2023-03/0062.html

Assisted-by: Andy Alt
Assisted-by: Dan Frandrich

Closes #10827
2023-03-26 17:39:43 +02:00
Patrick Monnerat
61d4260434
doc: curl_mime_init() strong easy handle binding has been relaxed in 7.87.0
Reported-by: Chloe Kudryavtsev
Fixes #10834
Closes #10835
2023-03-26 16:39:58 +02:00
Jay Satiro
e5588ced30 CURLOPT_WRITEFUNCTION.3: fix typo
Reported-by: Osaila@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/10839
2023-03-25 15:54:02 -04:00
Dan Fandrich
43e71fe0fc CI: skip some more builds when possible
When a commit only contains tests, documentation, or cmake files, skip
those builds that aren't affected by those.

The file filters available on the CI services don't seem to allow
skipping individual jobs, only the entire workflow, so we can't get any
more fine-grained than this.
2023-03-24 19:59:50 -07:00
Dan Fandrich
90f5250cc2 CI: add and adjust labeler match patterns
Allow cmdline tool alongside other labels.
2023-03-24 19:54:57 -07:00
Kai Pastor
2ffd787a71
CMake: make config version 8 compatible with 7
Reviewed-by: Jakub Zakrzewski
Closes #10819
2023-03-25 00:29:07 +01:00
Daniel Stenberg
fe55a63c83
RELEASE-NOTES: synced
Bumped version-in-progress to 8.1.0
2023-03-24 16:42:09 +01:00
Daniel Stenberg
d03c4dc165
GHA: add a memory-sanitizer job
Closes #10815
2023-03-24 11:04:59 +01:00
Dan Fandrich
6366a6f80f CI: fix brew retries on GHA
The fix in the previous commit was complete for Cirrus but accidentally
left off a part for GHA.

Follow-up to c2b7249d
2023-03-23 21:21:31 -07:00
Dan Fandrich
c0b6195161 CI: skip Azure for more commits which change only GHA 2023-03-23 21:18:04 -07:00
Daniel Stenberg
4528690cd5
cmake: set SONAME for SunOS too
Provided-by: Brian Lund

Closes #10816
2023-03-23 15:40:44 +01:00
Stefan Eissing
78f73f79ca
ngtcp2: adjust config and code checks for ngtcp2 without nghttp3
- make configure show on HTTP3 feature that both ngtcp2 and nghttp3
  are in play
- define ENABLE_QUIC only when USE_NGTCP2 and USE_NGHTTP3 are defined
- add USE_NGHTTP3 in the ngtcp2 implementation

Fixes #10793
Closes #10821
2023-03-23 15:39:13 +01:00
Daniel Stenberg
5ddd5f2619
data.d: emphasize no conversion
When asking curl to send a POST, curl does not encode or change the data.

Ref: #10820
Closes #10823
2023-03-23 15:35:25 +01:00
Daniel Stenberg
8963c25db3
server/getpart: clear the buffer before load
Fixes msan warnings:

==54195==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x55ece35e57cb in line_length /home/runner/work/curl/curl/tests/server/getpart.c:111:25
    #1 0x55ece35e3b83 in readline /home/runner/work/curl/curl/tests/server/getpart.c:164:24
    #2 0x55ece35e0269 in getpart /home/runner/work/curl/curl/tests/server/getpart.c:347:18
    #3 0x55ece36180b6 in parse_servercmd /home/runner/work/curl/curl/tests/server/sws.c:283:13

Closes #10822
2023-03-23 14:46:07 +01:00
Daniel Stenberg
0c2fcb0f60
ntlm: clear lm and nt response buffers before use
To avoid the risk of MemorySanitizer: use-of-uninitialized-value

Closes #10814
2023-03-23 09:25:05 +01:00
Daniel Stenberg
955e2769f7
digest: clear target buffer
Closes #10814
2023-03-23 09:24:59 +01:00
Douglas R. Reno
0c943964e1
cmake: bring in the network library on Haiku.
When cross-compiling for Haiku, the networking library needs to be
brought in. Without this, an unknown type of "Error" is reported in
lib/curl_setup_once.h.

This is also needed when using CMake natively on Haiku to build libcurl.

Fixes #10296
Closes #10792
2023-03-22 14:03:22 +01:00
Daniel Stenberg
70afa0d251
runtests: die if curl version can be found
Closes #10813
2023-03-22 14:01:45 +01:00
Stefan Eissing
5d1ecbcbd2
multi: add handle asserts in DEBUG builds
For GOOD_EASY_HANDLE and GOOD_MULTI_HANDLE checks

- allow NULL pointers to "just" return an error as before
- fail hard on nun-NULL pointers that no longer show the MAGICs

Closes #10812
2023-03-22 13:57:20 +01:00
jonrumsey
8a83bda0a2
gskit: various compile errors in OS400
Various compile failures in gskit.c;

- pipe_ssloverssl() needs Curl_easy data parameter for
  Curl_conn_cf_get_socket(cf, data)
- key_passwd is in ssl_config, not conn_config
- close_on() has 2 parameters, not 4
- getsockopt() needs to call Curl_conn_cf_get_socket(), not
  cxn->sock[FIRSTSOCKET]

Fixes #10799
Closes #10800
2023-03-22 13:55:26 +01:00
Daniel Stenberg
c0a9f905e6
tool_operate: pass a long as CURLOPT_HEADEROPT argument
Closes #10798
2023-03-22 13:51:37 +01:00
Daniel Stenberg
caf92a57b0
GHA: run all linux test jobs with valgrind
Closes #10798
2023-03-22 13:51:28 +01:00