Commit Graph

29663 Commits

Author SHA1 Message Date
Patrick Monnerat
ee0f73919a
nss: implement data_pending method
NSS currently uses the default Curl_none_data_pending() method which
always returns false, causing TLS buffered input data to be missed.

The current commit implements the nss_data_pending() method that properly
monitors the presence of available TLS data.

Ref:#10077

Closes #10225
2023-01-07 14:19:31 +01:00
Jay Satiro
d7b56ac75c CURLOPT_HEADERDATA.3: warn DLL users must set write function
- Warn that in Windows if libcurl is running from a DLL and if
  CURLOPT_HEADERDATA is set then CURLOPT_WRITEFUNCTION or
  CURLOPT_HEADERFUNCTION must be set as well, otherwise the user may
  experience crashes.

We already have a similar warning in CURLOPT_WRITEDATA. Basically, in
Windows libcurl could crash writing a FILE pointer that was created by
a different C runtime. In Windows each DLL that is part of a program may
or may not have its own C runtime.

Ref: https://github.com/curl/curl/issues/10231

Closes https://github.com/curl/curl/pull/10233
2023-01-06 03:45:17 -05:00
jonrumsey
1f693e0aca
x509asn1: fix compile errors and warnings
Various small issues when built for GSKit

Closes #10238
2023-01-05 23:51:27 +01:00
Patrick Monnerat
f22cd67b7d
runtests: fix detection of TLS backends
Built-in TLS backends are detected at test time by scanning for their
names in the version string line returned by the cli tool: as this line
may also list the libssh configuration that mentions its own backend,
the curl backend may be wrongly determined.

In example, if the version line contains "libssh/0.10.4/openssl/zlib",
OpenSSL is detected as a curl-configured backend even if not.

This fix requires the backend names to appear as full words preceded by
spacing in the version line to be recognized as curl TLS backends.

Closes #10236
2023-01-05 23:49:10 +01:00
andy5995
f92aae86c6
GHA: add job on Slackware 15.0
Closes #10230
2023-01-05 23:44:48 +01:00
Daniel Stenberg
4cfab52721
test363: make even smaller writes to loop more 2023-01-05 23:43:02 +01:00
Daniel Stenberg
3f3ddee066
http_proxy: do not assign data->req.p.http use local copy
Avoid the tricky reusing of the data->req.p.http pointer for http proxy
tunneling.

Fixes #10194
Closes #10234
2023-01-05 23:43:02 +01:00
Stefan Eissing
446267c555
quic: rename vquic implementations, fix for quiche build.
- quiche in debug mode did not build, fixed.
- moved all vquic implementation files to prefix curl_* to avoid
  the potential mixups between provided .h files and our own.
- quich passes test 2500 and 2502. 2501, the POST, fail with
  the body being rejected. Quich bug?

Closes #10242
2023-01-05 23:39:49 +01:00
Stefan Eissing
16bb32e104
sectransp: fix for incomplete read/writes
SecureTransport expects result code errSSLWouldBlock when the requested
length could not be sent/recieved in full. The previous code returned
noErr, which let SecureTransport to believe that the IO had terminated
prematurely.

Fixes #10227
Closes #10235
2023-01-05 16:04:12 +01:00
andy5995
21f5b6bfb7
GHA: Hacktoberfest CI: Update deprecated 'set-output' command
Closes #10221
2023-01-05 10:12:57 +01:00
Jay Satiro
602964ec5e scripts: set file mode +x on all perl and shell scripts
- Set all scripts +x, ie 644 => 755.

Prior to this change some scripts were not executable and therefore
could not be called directly.

~~~
git ls-files -s \*.{sh,pl,py} | grep -v 100755
~~~

Closes https://github.com/curl/curl/pull/10219
2023-01-05 02:34:24 -05:00
Stefan Eissing
24e4e57cf3
tool_operate: fix headerfile writing
Do not rely on the first transfer started to be the first to get a
response (remember -Z). All transfers now write the headefile (-D) in
append mode, making sure that the order of transfer responses does not
lead to overwrites of previous data.

Closes #10224
2023-01-04 23:11:54 +01:00
Daniel Stenberg
1485e89213
misc: reduce struct and struct field sizes
- by using BIT() instead of bool
- imap: shrink struct
- ftp: make state 'unsigned char'
- ftp: sort ftp_conn struct entries on size
- urldata: use smaller fields for SSL version info storage
- pop3: reduce the pop3_conn struct size
- smtp: reduce the size of the smtp structs

Closes #10186
2023-01-04 15:36:36 +01:00
Daniel Stenberg
7ad8a7ba9e
noproxy: support for space-separated names is deprecated
To be removed in July 2024.

Assisted-by: Michael Osipov
Fixes #10209
Closes #10215
2023-01-04 09:15:37 +01:00
Andrei Rybak
bb393e521f
lib: fix typos in comments which repeat a word
Remove erroneously duplicated words in code comments of files
`lib.connect.c` and `lib/url.c`.

Closes #10220
2023-01-04 09:12:58 +01:00
Radek Brich
3ef31a16fc
cmake: set SOVERSION also for macOS
Closes #10214
2023-01-03 23:51:40 +01:00
Jay Satiro
fcd1b547d4 http2: fix compiler warning due to uninitialized variable
Prior to this change http2_cfilter_add could return an uninitialized
cfilter pointer in an OOM condition. In this case though, the pointer
is discarded and not dereferenced so there was no risk of a crash.
2023-01-03 17:15:26 -05:00
Stefan Eissing
6a8d7ef981
cf-socket: keep sockaddr local in the socket filters
- copy `struct Curl_addrinfo` on filter setup into context
- remove `struct Curl_addrinfoi *` with `struct Curl_sockaddr_ex *` in
  connectdata that is set and NULLed by the socket filter
- this means we have no reference to the resolver info in connectdata or
  its filters
- trigger the CF_CTRL_CONN_INFO_UPDATE event when the complete filter
  chain reaches connected status
- update easy handle connection information on CF_CTRL_DATA_SETUP event.

Closes #10213
2023-01-03 17:33:29 +01:00
Daniel Stenberg
436d63fbb1
RELEASE-NOTES: synced 2023-01-03 09:34:54 +01:00
Daniel Stenberg
22f795c834
runtests: consider warnings fatal and error on them
To help us detect and fix warnings in this script easier and faster.

Assisted-by: Jakob Hirsch

Ref: #10206
Closes #10208
2023-01-03 09:29:52 +01:00
Daniel Stenberg
2bc1d775f5
copyright: update all copyright lines and remove year ranges
- they are mostly pointless in all major jurisdictions
- many big corporations and projects already don't use them
- saves us from pointless churn
- git keeps history for us
- the year range is kept in COPYING

checksrc is updated to allow non-year using copyright statements

Closes #10205
2023-01-03 09:19:21 +01:00
Daniel Stenberg
3e9c2924d6
docs/DEPRECATE.md: deprecate gskit
Ref: #10163

- This is a niche TLS library, only running on some IBM systems
- no regular curl contributors use this backend
- no CI builds use or verify this backend
- gskit, or the curl adaption for it, lacks many modern TLS features
  making it an inferior solution
- build breakages in this code take weeks or more to get detected
- fixing gskit code is mostly done "flying blind"

Closes #10201
2023-01-03 09:06:36 +01:00
Daniel Stenberg
4fc7737742
Revert "x509asn1: avoid freeing unallocated pointers"
This reverts commit 6b19247e79.

Fixes #10163
Closes #10207
2023-01-03 09:02:15 +01:00
Daniel Stenberg
e6002e9012
ngtcp2: fix the build without 'sendmsg'
Follow-up from 71b7e01610

Closes #10210
2023-01-03 08:54:22 +01:00
Daniel Stenberg
f86894a38c
cmake: check for sendmsg
Used by ngtcp2

Closes #10211
2023-01-03 08:51:51 +01:00
Timmy Schierling
7baff01fd6
runtest.pl: add expected fourth return value
Fixes warning in autobild log: "Use of uninitialized value $HTTP2TLSPORT
in substitution iterator at /tests/runtests.pl line 3516"

Closes #10206
2023-01-02 16:03:28 +01:00
Daniel Stenberg
b637f35346
http2: when using printf %.*s, the length arg must be 'int'
Detected by Coverity CID 1518341

Closes #10203
2023-01-02 13:24:37 +01:00
Daniel Stenberg
42c3b23a7c
cfilters: check for NULL before using pointer
Detected by Coverity CID 1518343

Closes #10202
2023-01-02 13:18:58 +01:00
Daniel Stenberg
ed18244df1
http2: in connisdead check, attach the connection before reading
Otherwise data->conn is NULL and things go wrong.

This problem caused occastional failures in test 359, 1700 and more
depending on timing and the alignment of various planets.

Assisted-by: Stefan Eissing

Closes #10199
2023-01-02 13:16:24 +01:00
Philip H
4556665ad1
Linux CI: update some dependecies to latest tag
Closes #10195
2023-01-02 11:56:49 +01:00
Daniel Stenberg
5c544b4912
c-hyper: move down the Accept-Encoding header generation
To match the internal HTTP request header order so that test 1277 works
again.

Closes #10200
2023-01-02 11:51:30 +01:00
Daniel Stenberg
9ca194b5e2
release-notes.pl: check fixes/closes lines better
To better skip lines that just happen to mention those words at the
start of a line without being instructions.
2023-01-02 11:31:29 +01:00
Daniel Stenberg
f27262b179
test1560: use a UTF8-using locale when run
There are odd cases that don't use UTF8 and then the IDN handling goes
wrong.

Reported-by: Marcel Raad
Fixes #10193
Closes #10196
2023-01-02 10:35:42 +01:00
Daniel Stenberg
36dce55629
cf-socket: fix build regression
Reported-by: Stephan Guilloux
Fixes #10190
Closes #10191
2023-01-02 10:34:14 +01:00
Daniel Stenberg
b8b483b0c4
examples: remove the curlgtk.c example
- it does not add a lot of value
- we do not test-build it to verify because of its dependencies
- unclear for what GTK versions it works or not

Reported-by: odek86 on github

Fixes #10197
Closes #10198
2023-01-02 10:19:35 +01:00
andy5995
d68e0a0cc2
docs: add link to GitHub Discussions
Closes #10171
2023-01-02 00:26:37 +01:00
andy5995
92abdaf8e2
GHA: ignore changes to md files for most workflows
Closes #10176
2023-01-02 00:13:02 +01:00
Josh Brobst
aa6e7a1f45
http: decode transfer encoding first
The unencoding stack is added to as Transfer-Encoding and
Content-Encoding fields are encountered with no distinction between the
two, meaning the stack will be incorrect if, e.g., the message has both
fields and a non-chunked Transfer-Encoding comes first. This commit
fixes this by ordering the stack with transfer encodings first.

Reviewed-by: Patrick Monnerat
Closes #10187
2023-01-02 00:06:15 +01:00
Daniel Stenberg
fc9f22b46e
curl.h: mark CURLSSLBACKEND_MESALINK as deprecated
Follow-up since 223f26c28a

Deprecated since 7.82.0

Closes #10189
2023-01-01 15:42:20 +01:00
Daniel Stenberg
afd0a12f8b
curl_global_sslset.3: clarify the openssl situation
and add rustls

Closes #10188
2023-01-01 15:08:06 +01:00
Cameron Blomquist
99327018cf
http: add additional condition for including stdint.h
stdint.h was only included in http.h when ENABLE_QUIC was defined, but
symbols from stdint.h are also used when USE_NGHTTP2 is defined. This
causes build errors when USE_NGHTTP2 is defined but ENABLE_QUIC is not.

Closes #10185
2023-01-01 00:51:35 +01:00
Daniel Stenberg
becfe2ec78
urldata: cease storing TLS auth type
The only TLS auth type libcurl ever supported is SRP and that is the
default type. Since nobody ever sets any other type, there is no point
in wasting space to store the set type and code to check the type.

If TLS auth is used, SRP is now implied.

Closes #10181
2022-12-31 16:56:21 +01:00
Daniel Stenberg
df856cb5c9
vtls: use ALPN HTTP/1.0 when HTTP/1.0 is used
Previously libcurl would use the HTTP/1.1 ALPN id even when the
application specified HTTP/1.0.

Reported-by: William Tang
Ref: #10183
2022-12-31 16:53:21 +01:00
Marcel Raad
49f39dfac9
lib670: make test.h the first include
As in all other lib tests. This avoids a macro redefinition warning for
`_FILE_OFFSET_BITS` visible in the autobuilds.

Closes https://github.com/curl/curl/pull/10182
2022-12-30 21:57:35 +01:00
Stefan Eissing
71b7e01610
lib: connect/h2/h3 refactor
Refactoring of connection setup and happy eyeballing. Move
nghttp2. ngtcp2, quiche and msh3 into connection filters.

 - eyeballing cfilter that uses sub-filters for performing parallel connects
 - socket cfilter for all transport types, including QUIC
 - QUIC implementations in cfilter, can now participate in eyeballing
 - connection setup is more dynamic in order to adapt to what filter did
   really connect.  Relevant to see if a SSL filter needs to be added or
   if SSL has already been provided
 - HTTP/3 test cases similar to HTTP/2
 - multiuse of parallel transfers for HTTP/3, tested for ngtcp2 and quiche

 - Fix for data attach/detach in VTLS filters that could lead to crashes
   during parallel transfers.
 - Eliminating setup() methods in cfilters, no longer needed.
 - Improving Curl_conn_is_alive() to replace Curl_connalive() and
   integrated ssl alive checks into cfilter.
 - Adding CF_CNTRL_CONN_INFO_UPDATE to tell filters to update
   connection into and persist it at the easy handle.

 - Several more cfilter related cleanups and moves:
   - stream_weigth and dependency info is now wrapped in struct
     Curl_data_priority
   - Curl_data_priority members depend is available in HTTP2|HTTP3
   - Curl_data_priority members depend on NGHTTP2 support
   - handling init/reset/cleanup of priority part of url.c
   - data->state.priority same struct, but shallow copy for compares only

 - PROTOPT_STREAM has been removed
   - Curl_conn_is_mulitplex() now available to check on capability

 - Adding query method to connection filters.
   - ngtcp2+quiche: implementing query for max concurrent transfers.

 - Adding is_alive and keep_alive cfilter methods. Adding DATA_SETUP event.
   - setting keepalive timestamp on connect
   - DATA_SETUP is called after the connection has been completely
     setup (but may not connected yet) to allow filters to initialize
     data members they use.

 - there is no socket to be had with msh3, it is unclear how select
   shall work

 - manual test via "curl --http3 https://curl.se" fail with "empty
   reply from server".

 - Various socket/conn related cleanups:
   - Curl_socket is now Curl_socket_open and in cf-socket.c
   - Curl_closesocket is now Curl_socket_close and in cf-socket.c
   - Curl_ssl_use has been replaced with Cur_conn_is_ssl
   - Curl_conn_tcp_accepted_set has been split into
     Curl_conn_tcp_listen_set and Curl_conn_tcp_accepted_set
     with a clearer purpose

Closes #10141
2022-12-30 16:43:19 +01:00
Daniel Stenberg
1c18f8da51
RELEASE-NOTES: synced 2022-12-30 16:06:03 +01:00
Daniel Stenberg
17f0891184
docs/libcurl/curl_getdate.3: minor whitespace edit
To avoid a fccp quirk that made it render wrongly on the website
2022-12-30 12:58:14 +01:00
Daniel Stenberg
54120efdf6
transfer: break the read loop when RECV is cleared
When the RECV bit is cleared because the response reading for this
transfer is complete, the read loop should be stopped. data_pending()
can otherwise still return TRUE and another read would be attempted.

Reported-by: Hide Ishikawa
Fixes #10172
Closes #10174
2022-12-30 09:20:55 +01:00
Daniel Stenberg
1c00796039
multihandle: turn bool struct fields into bits
Closes #10179
2022-12-30 00:16:53 +01:00
Stefan Eissing
b0119436b0
ftpserver: lower the normal DATA connect timeout to speed up torture tests
- tests/ftpserver.pl blocks when expecting a DATA connection from the
  client.

- the previous 10 seconds were encountered repeatedly in torture tests
  and let to long waits.

- 2 seconds should still be sufficient for current hw, but CI will show.

Closes #10178
2022-12-30 00:13:56 +01:00