Commit Graph

29851 Commits

Author SHA1 Message Date
Marc Aldorasi
71cc27f0d6 cmake: use list APPEND syntax for CMAKE_REQUIRED_DEFINITIONS
- Use list() instead of set() for CMAKE_REQUIRED_DEFINITIONS list since
  the former is clearer.

Closes https://github.com/curl/curl/pull/10272
2023-01-24 03:09:09 -05:00
Dan Fandrich
3eabedc027 CI: Add a workflow to automatically label pull requests
The labeler language is quite restrictive right now so labels are added
quite conservatively, meaning that many PRs won't get labels when it's
"obvious" they should. It will still save some manual work on those
that it can label.
2023-01-23 18:18:00 -08:00
Jay Satiro
3feb6b46a2 system.h: assume OS400 is always built with ILEC compiler
Prior to this change the OS400 types were only defined when __ILEC400__.
That symbol is only defined by IBM's C compiler and not their C++
compiler, which led to missing types when users on OS400 would compile a
C++ application that included curl.

The IBM C and C++ compilers are the only native compilers on the
platform.

Assisted-by: Jon Rumsey
Reported-by: John Sherrill

Fixes https://github.com/curl/curl/issues/10305
Closes https://github.com/curl/curl/pull/10329
2023-01-21 15:08:23 -05:00
xgladius
ac6e7f5689 cmake: Remove deprecated symbols check
curl stopped use of CMAKE_USE_ as a prefix for its own build symbols in
2021 and added a check, meant to last 1 year, to fatally error on those
symbols. This commit removes that check.

Closes https://github.com/curl/curl/pull/10314
2023-01-20 17:11:04 -05:00
Dan Fandrich
5a70403cff docs: POSTFIELDSIZE must be set to -1 with read function
Reported-by: RanBarLavie on github

Closes #10313
2023-01-20 10:01:43 -08:00
Stefan Eissing
f8da4f2f2d vtls: fix hostname handling in filters
- Copy the hostname and dispname to ssl_connect_data.

Use a copy instead of referencing the `connectdata` instance since this
may get free'ed on connection reuse.

Reported-by: Stefan Talpalaru
Reported-by: sergio-nsk@users.noreply.github.com

Fixes https://github.com/curl/curl/issues/10273
Fixes https://github.com/curl/curl/issues/10309

Closes https://github.com/curl/curl/pull/10310
2023-01-20 00:40:18 -05:00
Sergey Bronnikov
11708d6f00 lib: fix typos
Closes https://github.com/curl/curl/pull/10307
2023-01-17 03:39:25 -05:00
Sergey Bronnikov
de07d804fb curl_version_info.3: fix typo
Closes https://github.com/curl/curl/pull/10306
2023-01-17 03:37:38 -05:00
Jay Satiro
c4cd0e2be9 openssl: Don't ignore CA paths when using Windows CA store (redux)
.. and remove 'experimental' designation from CURLSSLOPT_NATIVE_CA.

This commit restores the behavior of CURLSSLOPT_NATIVE_CA so that it
does not override CURLOPT_CAINFO / CURLOPT_CAPATH, or the hardcoded
default locations. Instead the native Windows CA store can be used at
the same time.

---

This behavior was originally added over two years ago in abbc5d60
(#5585) but then 83393b1a (#7892) broke it over a year ago, I assume
inadvertently.

The CURLSSLOPT_NATIVE_CA feature was marked experimental and likely
rarely used.

Ref: https://github.com/curl/curl/pull/5585
Ref: https://github.com/curl/curl/pull/7892
Ref: https://curl.se/mail/lib-2023-01/0019.html

Closes https://github.com/curl/curl/pull/10244
2023-01-17 03:32:58 -05:00
Daniel Stenberg
6113dec2a8
RELEASE-NOTES: synced 2023-01-13 16:25:02 +01:00
Daniel Stenberg
abae4e31a2
ws: fix autoping handling
Reported-by: Alexey Savchuk
Fixes #10289
Closes #10294
2023-01-13 15:35:50 +01:00
Daniel Stenberg
521da2dbd3
curl_log: avoid printf() format checking with mingw
Since it does not seem to like %zu and more

Follow-up to db91dbbf2

Fixes #10291
Closes #10292
2023-01-13 13:37:21 +01:00
Daniel Stenberg
e6b72644c2
tool_getparam: fix compiler warning when !HAVE_WRITABLE_ARGV
Follow-up to 2ed0e1f70e

Closes #10286
2023-01-13 10:39:23 +01:00
Stefan Eissing
12157aa924
openssl: make the BIO_METHOD a local variable in the connection filter
This avoids UAF issues when `curl_global_cleanup()` is called before all
transfers have been completely handled. Unfortunately this seems to be a
more common pattern than we like.

Closes #10285
2023-01-12 23:43:56 +01:00
Daniel Stenberg
7d3b167f48
curl: output warning at --verbose output for debug-enabled version
+ a libcurl warning in the debug output

Assisted-by: Jay Satiro

Ref: https://curl.se/mail/lib-2023-01/0039.html
Closes #10278
2023-01-12 17:59:26 +01:00
Daniel Stenberg
13991d60ee
src: add --http3-only
Warning: --http3 and --http3-only are subject to change again (or be
removed) before HTTP/3 support goes non-experimental.

Closes #10264
2023-01-12 16:18:05 +01:00
Daniel Stenberg
a56d2b0b94
curl.h: add CURL_HTTP_VERSION_3ONLY
As the previous CURL_HTTP_VERSION_3 option gets a slightly altered meaning.

Closes #10264
2023-01-12 16:17:55 +01:00
Daniel Stenberg
8956cd4f9a
connect: fix access of pointer before NULL check
Detected by Coverity CID 1518992

Closes #10284
2023-01-12 15:31:21 +01:00
Daniel Gustafsson
4579626c27
easyoptions: Fix header printing in generation script
The optiontable.pl script prints the header comment when generating
easyoptions.c, but it wasn't escaping all characters which jumbled the
curl ascii logo.  Fix by escaping.

Cloes #10275
2023-01-12 14:59:38 +01:00
Harry Sintonen
2ed0e1f70e
tool_getparam: fix hiding of command line secrets
Closes #10276
2023-01-12 14:09:23 +01:00
Stefan Eissing
d6b5d9f4ae
tests: document the cfilter debug logging options
Closes #10283
2023-01-12 14:08:31 +01:00
Stefan Eissing
db91dbbf2c
curl_log: for failf/infof and debug logging implementations
- new functions and macros for cfilter debugging
 - set CURL_DEBUG with names of cfilters where debug logging should be
   enabled
 - use GNUC __attribute__ to enable printf format checks during compile

Closes #10271
2023-01-12 10:14:17 +01:00
Daniel Stenberg
5cf5bfcd13
RELEASE-NOTES: synced 2023-01-10 13:54:29 +01:00
Nick Banks
9f0c7795eb
msh3: update to v0.6
Closes #10192
2023-01-10 13:50:08 +01:00
Stefan Eissing
088c08a7e4
ngtcp2: add CURLOPT_SSL_CTX_FUNCTION support for openssl+wolfssl
Using common method for SSL_CTX initialization of verfiy peer and CA
settings. This also provides X509_STORE sharing to become available for
ngtcp2+openssl HTTP/3.

Reported-by: violetlige on github

Fixes #10222
Closes #10239
2023-01-10 13:41:21 +01:00
Daniel Stenberg
c34fcbbad8
cf-socket: make infof() call use %zu for size_t output
Detected by Coverity CID 1518986 and CID 1518984

Closes #10268
2023-01-10 11:51:34 +01:00
jonrumsey
9749a379e0
os400: fixes to make-lib.sh and initscript.sh
Adjust how exports list is generated from header files to account for
declarations across multiple lines and CURL_DEPRECATED(...) tags.

Update initscript.sh

Specify qadrt_use_inline to prevent unistd.h in ASCII runtime defining
close(a) -> close_a(a)

Fixes #10266
Closes #10267
2023-01-10 09:29:04 +01:00
Stefan Eissing
33ac97e1cb
tests-httpd: basic infra to run curl against an apache httpd plus nghttpx for h3
- adding '--with-test-httpd=<path>' to configure non-standard apache2
  install
- python env and base classes for running httpd
- basic tests for connectivity with h1/h2/h3
- adding test cases for truncated responses in http versions.
- adding goaway test for HTTP/3.
- adding "stuttering" tests with parallel downloads in chunks with
  varying delays between chunks.

- adding a curltest module to the httpd server, adding GOAWAY test.
    - mod_curltest now installs 2 handlers
      - 'echo': writing as response body what came as request body
      - 'tweak': with query parameters to tweak response behaviour
- marked known fails as skip for now

Closes #10175
2023-01-09 17:40:04 +01:00
Stefan Eissing
1c5d8acf79
quic: improve connect error message, debugging info, fix false connect report
- ECONNECTREFUSED has not its own fail message in quic filters
- Debug logging in connect eyballing improved
- Fix bug in ngtcp2/quiche that could lead to false success reporting.

Reported-by: Divy Le Ray

Fixes #10245
Closes #10248
2023-01-09 13:23:20 +01:00
Stefan Eissing
0ef2926881
quiche: fix build without any HTTP/2 implementation
Fixes #10260
Closes #10263
2023-01-09 11:09:34 +01:00
Daniel Stenberg
0978b2ef25
.github/workflows/linux.yml: add a quiche CI job
Move over from zuul

Closes #10241
2023-01-09 11:09:33 +01:00
Daniel Stenberg
5cb63da771
curl.h: allow up to 10M buffer size
Bump the limit from 512K. There might be reasons for applications using
h3 to set larger buffers and there is no strong reason for curl to have
a very small maximum.

Ref: https://curl.se/mail/lib-2023-01/0026.html

Closes #10256
2023-01-08 20:54:48 +01:00
Tatsuhiro Tsujikawa
3022eeaefe
GHA: use designated ngtcp2 and its dependencies versions
Designate ngtcp2 and its dependency versions so that the CI build does
not fail without our control.

Closes #10257
2023-01-08 20:31:52 +01:00
Daniel Stenberg
5a9a5e171e
docs/cmdline-opts/hsts.d: explain hsts more
Closes #10258
2023-01-08 11:08:10 +01:00
Stefan Eissing
4303093cd5
msh3: run again in its cfilter
- test 2500, single GET works
- test 2501, single POST stalls
- test 2502, multiple, sequential GETs each use a new connection since
  MsH3ConnectionGetState(qconn) no longer reports CONNECTED after one
  GET.

Closes #10204
2023-01-08 11:06:30 +01:00
Jay Satiro
260fea215a sendf: fix build for Linux TCP fastopen
- Fix the remote addr struct dereference.

- Include cf-socket.h in urldata.h.

Follow-up to 6a8d7ef9 which changed conn->ipaddr (Curl_addrinfo* )
member to conn->remote_addr (Curl_sockaddr_ex *) several days ago.

Reported-by: Stephan Guilloux

Fixes https://github.com/curl/curl/issues/10249
Closes https://github.com/curl/curl/pull/10250
2023-01-08 03:32:06 -05:00
Daniel Stenberg
91576eba57
RELEASE-NOTES: synced 2023-01-07 23:09:28 +01:00
Daniel Stenberg
b45b6b618d
setopt: move the SHA256 opt within #ifdef libssh2
Because only the libssh2 backend not supports it and thus this should
return error if this option is used other backends.

Reported-by: Harry Sintonen

Closes #10255
2023-01-07 23:01:52 +01:00
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