Commit Graph

34076 Commits

Author SHA1 Message Date
Kevin Sun
0439499170
netrc: restore _netrc fallback logic
Regression from 05977f4f75fd08837a877, shipped in 8.11.0

Fixes #15734
Closes #15735
2024-12-13 10:08:00 +01:00
Daniel Stenberg
c2ac9ea1ee
checksrc: ban use of sscanf()
Using sscanf() is not a (security) problem in itself, but we strongly
discorage using it for parsing input since it is hard to use right, easy
to mess up and often makes for sloppy error checking.

Allow it in examples and tests

Closes #15687
2024-12-13 09:43:05 +01:00
Daniel Stenberg
d5c738c608
strparse: string parsing helper functions
Designed to aid converting off from sscanf parsers. sscanf is hard to
use right, easy to mess up and often makes for sloppy error checking.

The new parsers allow more exact and pedandic parsing.

This new set of functions should be possible to use (and extend) and
switch over other libcurl parser code to use going forward.

Adapts the following to use the new functions:

- altsvc.c
- hsts.c
- http_aws_sigv4.c

Bonus: fewer memory copies, fewer stack buffers.

Test: Unit test1664

Docs: docs/internals/STRPARSE.md

Closes #15692
2024-12-12 16:00:52 +01:00
Andy Pan
ff5091aa9f
async-thread: avoid closing eventfd twice
When employing eventfd for socketpair, there is only one file
descriptor. Closing that fd twice might result in fd corruption.
Thus, we should avoid closing the eventfd twice, following the
pattern in lib/multi.c.

Fixes #15725
Closes #15727
Reported-by: Christian Heusel
2024-12-12 15:58:47 +01:00
Randall S. Becker
aed732acb1
tests/http/clients: use proper sleep() call on NonStop
This fix impacts ws-data.c and ws-pingpong.c. sleep() replaced with
system PROCESS_DELAY_() having the same resolution as usleep().

Fixes #15711
Closes #15712

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
2024-12-12 14:30:28 +01:00
Randall S. Becker
ae4ec1d2ec
system.h: add 64-bit curl_off_t definitions for NonStop
Fixes #15723
Closes #15724

Signed-off-by: Randall S. Becker <randall.becker@nexbridge.ca>
2024-12-12 14:27:40 +01:00
Christian Schmitz
df1d08ec0d
sectransp: free certificate on error
Otherwise the certificate memory was leaked.

Closes #15721
2024-12-11 13:09:44 +01:00
Christian Schmitz
017e6440ce
conncache: result_cb comment removed from function docs
result_cb doesn't exist anymore

Closes #15720
2024-12-11 13:07:18 +01:00
Daniel Stenberg
a8397643f3
GHA/checkdocs: change markdown link checker to linkspector
Fixes #15717
Closes #15719
2024-12-11 13:05:11 +01:00
Daniel Stenberg
6907638631
RELEASE-NOTES: synced
Start working on the next release
2024-12-11 11:16:48 +01:00
Daniel Stenberg
98b30eda79
RELEASE-PROCEDURE.md: mention how to publish security advisories
As they are releated to the release procedure

Closes #15714
2024-12-11 11:11:32 +01:00
Daniel Stenberg
a8c852b9a5
cookie: parse only the exact expire date
The date parser function is very forgiving and skips most "irrelevant"
characters in its hunt for a date to figure out. Therefore it is
important to make sure the date string is properly null terminated so
that it does not accidentally parse a piece of whatever text follows
after the date.

Add test483: test (overly) long expire dates in cookies

Closes #15709
2024-12-11 09:31:53 +01:00
Daniel Stenberg
75f0835513
lib517: extend the getdate test with quotes and leading "junk"
Closes #15708
2024-12-11 09:19:50 +01:00
Daniel Stenberg
75a2079d5c
RELEASE: synced
curl 8.11.1 release
2024-12-11 08:05:13 +01:00
Daniel Stenberg
cff5a7b641
THANKS: contributors from 8.11.1 2024-12-11 08:05:13 +01:00
Viktor Szakats
2d4852af83
build: fix tests when documentation/manual is disabled
- build: fix to exclude 'documentation' tests when building
  the documentation is explicitly disabled. Both for cmake
  and `./configure`.

  Reported-by: Daniel Engberg
  Fixes #15703

- test481, test482: fix for builds with no manual.

  Reported-by: Daniel Engberg
  Fixes #15703

- configure: fix to always detect Perl. Running tests require
  it when run. Before this patch Perl wasn't detected when
  documentation/manual/embedded-CA were all disabled,
  making tests fail to start.

- test1177: add keyword `documentation`. It depends no
  `curl_version_info.3`.

- GHA/linux: test cmake and `./configure` with docs and
  manual disabled and tests run.

Closes #15704
2024-12-09 12:45:29 +01:00
renovate[bot]
72266a3e9f
GHA: update four depencencies
- github/codeql-action digest to aa57810
- cross-platform-actions/action action to v0.26.0
- actions/cache digest to 1bd1e32
- msys2/setup-msys2 digest to d44ca8e

Closes #15674
Closes #15686
Closes #15696
Closes #15702
2024-12-09 10:31:24 +01:00
Daniel Stenberg
96ffb57040
docs: bring back ALTSVC.md and HSTS.md
This partly reverts 0e06603b23

These file formats are not properly documented elsewhere, plus the
website uses these files to populate the documentation pages to which
users end up via the URLs that are mentioned within the alt-svc and hsts
files.

Fixes #15705
Reported-by: Jeffrey Bosboom
Closes #15706
2024-12-09 09:32:19 +01:00
Marcel Raad
ebce0e7e4a
test2086: disable MSYS2's POSIX path conversion
Older MSYS2 versions treat the URL as paths list and convert them from
UNIX to Windows format. There's no path here that needs to be
converted, so disable path conversion for this test as done for others.

Fixes https://github.com/curl/curl/pull/15644#issuecomment-2511313206
Closes https://github.com/curl/curl/pull/15677
2024-12-08 23:03:23 +01:00
Daniel Stenberg
59fec5ac43
mprintf: fix the integer overflow checks
When a floating point precision or string width are provided as a
base-10 number, the code could miss to detect integer overflows if the
provided value was exactly 2147483648 or 2147483649 (2147483647 being
the maxium value a signed integer can hold).

The chance that such values would actually ever be used is slim.

This change fixes the detection to also cover those edge cases.

Closes #15699
2024-12-06 16:38:30 +01:00
Daniel Stenberg
ec14be6a4d
RELEASE-NOTES: synced 2024-12-06 09:24:45 +01:00
Daniel Stenberg
8d926c653b
tool_getparam: remove Redundant Condition
Pointed out by CodeSonar

Closes #15698
2024-12-06 09:20:05 +01:00
Jay Satiro
a4458c7ee3 hostip: don't use the resolver for FQDN localhost
- Treat `[<any>.]localhost.` (ie localhost with FQDN period terminator)
  as fixed value 127.0.0.1 and ::1 instead of querying the resolver.

Prior to this change, b5c0fe20 (precedes 7.85.0) did the same for
non-FQDN `<any>.localhost`.

Prior to this change, 1a0ebf66 (precedes 7.78.0) did the same for
non-FQDN `localhost`.

Ref: https://github.com/curl/curl/issues/15628#issuecomment-2515540315

Closes https://github.com/curl/curl/pull/15676
2024-12-05 17:16:34 -05:00
Daniel Stenberg
6755ba593c
http_negotiate: allow for a one byte larger channel binding buffer
The channel binding data dynbuf was not set correctly making it fail with
CURLE_TOO_LARGE too easily.

Reported-by: galen11 on github
Fixes #15685
Closes #15694
2024-12-05 23:09:28 +01:00
chemodax
b6aecd4a98
cmake: set CURL_STATICLIB for static lib when SHARE_LIB_OBJECT=OFF
When compiled with BUILD_STATIC_LIBS=ON and SHARE_LIB_OBJECT=OFF compile
definition CURL_STATICLIB was not set for static library. It seems to be
copy-paste error in the lib/CMakeLists.txt.

This pull request fixes it.

Closes #15695
2024-12-05 20:52:01 +01:00
Stefan Eissing
ce949ba1dc
mime: fix reader stall on small read lengths
The base64 mime encoder stalls when it cannot encode a full 3 byte input
set into the read buffer. The workaround for this limitation was
incomplete and could lead to stalled transfers when the last chunk to
upload was smaller than 4 bytes.

Use a tmp buffer on small reads to allow mime encoders more space to put
their things.

Add test case reproducing the issue and fix.

Reported-by: Alexis Savin
Fixes #15688
Closes #15691
2024-12-05 15:44:51 +01:00
andrewkirillov-ibm
4bba14c35d
dmaketgz: use --no-cache when building docker image
Fixes #15689
Closes #15690
2024-12-05 15:41:53 +01:00
Daniel Stenberg
f707783630
tool_getparam: parse --localport without using sscanf
and switch to str2unummax() for the number parsings

Closes #15681
2024-12-05 08:22:35 +01:00
Daniel Stenberg
9664d5a547
tool_formparse: remove use of sscanf()
In the function for handling 'type=' in the -F command line arguments,
we make the code more lax to accept more strings and thereby also avoid
the use of sscanf().

Closes #15683
2024-12-05 07:58:45 +01:00
Daniel Stenberg
03669b630e
tool_urlglob: parse character globbing range without sscanf
A step towards a future without sscanf() calls.

Closes #15682
2024-12-05 07:56:55 +01:00
Daniel Stenberg
c948971e83
digest: produce a shorter cnonce in Digest headers
Other programs (Postman, Chrome, Python request) use a 16 byte cnonce
and there are instances of server-side implementations that don't
support the larger lengths curl used previously.

Fixes #15653
Reported-by: Florian Eckert
Closes #15670
2024-12-04 15:34:25 +01:00
Daniel Stenberg
509f50e58d
curl: do more command line parsing in sub functions
This moves argument parsing logic for a number of options into sub
functions to reduce the overall complexity of the single getparameter()
function. pmccabe says it takes complexity down from 234 to 147.

The command line options that now has dedicated parser funtions are:

 --continue-at, --ech, --header, --localport, --output, --quote, --range
 --remote-name, --time-cond, --upload-file, --url, --verbose, --writeout

These parsers were selected for thise because they had more than 15
lines of logic in the main switch(). Detected like this:

 git grep -hn 'case C_' tool_getparam.c |
  cut -d: -f1 |
  awk '{if(($1 - prev) > 15) { printf "%d\n", prev;} prev = $1;}'

Closes #15680
2024-12-04 13:16:29 +01:00
Daniel Stenberg
d95a89266b
openssl: remove three "Useless Assignments"
Pointed out by CodeSonar

Closes #15679
2024-12-04 08:29:24 +01:00
Daniel Pouzzner
c1edfc808a
liub: fixes for wolfSSL OPENSSL_COEXIST
For MD4, MD5, and DES

Assisted-by: Viktor Szakats
Closes #15650
2024-12-04 08:25:14 +01:00
Daniel Stenberg
3856e10445
KNOWN_BUGS: setting a disabled option should return CURLE_NOT_BUILT_IN
Reported-by: Jeroen Ooms
Closes #15472
Closes #15675
2024-12-04 07:07:43 +01:00
Daniel Stenberg
90d937def9
RELEASE-NOTES: synced 2024-12-03 17:21:42 +01:00
Daniel Stenberg
381b275314
http_proxy: move dynhds_add_custom here from http.c
... and make it static. As it is not used anywhere else.

Closes #15672
2024-12-03 15:02:58 +01:00
Daniel Stenberg
8d780f6012
openssl: stop using SSL_CTX_ function prefix for our functions
It is a prefix already taken and is used by OpenSSL

Closes #15673
2024-12-03 15:01:54 +01:00
renovate[bot]
6b65422bcc
Dockerfile: Update debian:bookworm-slim Docker digest to b73bf02
Closes #15671
2024-12-03 09:25:09 +01:00
renovate[bot]
c3181dc5cf
CI: update dependencies
- ngtcp2/ngtcp2 to v1.9.1
- github/codeql-action digest to f09c1c0
- rustls/rustls-ffi to v0.14.1
- awslabs/aws-lc to v1.40.0

Closes #15616
Closes #15619
Closes #15629
Closes #15651
2024-12-03 09:24:04 +01:00
xiaofeng
8b259498be
libssh: use libssh sftp_aio to upload file
Support async sftp upload for curl built with libssh.

Closes #15625
2024-12-02 21:33:24 +01:00
Daniel Stenberg
0169b80e5c
curl: --continue-at is mutually exclusive with --remove-on-error
Test 482 verifies

Fixes #15645
Reported-by: Harry Sintonen
Closes #15668
2024-12-02 21:22:57 +01:00
Daniel Stenberg
ffbcde0022
curl: --continue-at is mutually exclusive with --no-clobber
Test 481 verifies

Fixes #15645
Reported-by: Harry Sintonen
Closes #15668
2024-12-02 21:22:47 +01:00
Stefan Eissing
26ee83ab67
curl: use realtime in trace timestamps
Timestamps in trace logs used a mix of realtime and monotonic time
sources, leading to fractional seconds carrying wrong values. Use
realtime only, so the correct nanoseconds are printed.

Fixes #15614
Reported-by: jethrogb on github
Closes #15641
2024-12-02 21:21:18 +01:00
Stefan Eissing
fd4528a8d8
OpenSSL: improvde error message on expired certificate
Fix regression that no longer printed the error messages about expired
certificates in openssl. Add test case for openssl/gnutls/wolfssl.

Fixes #15612
Reported-by: hiimmat on github
Closes #15613
2024-12-02 21:17:59 +01:00
Stefan Eissing
55968fd14b
pytest: add test for use of CURLMOPT_MAX_HOST_CONNECTIONS
Add test_02_33 to run with various values for the multi option
CURLMOPT_MAX_HOST_CONNECTIONS and CURLOPT_FRESH_CONNECT to trigger
connection pool limit handling code.

Closes #15494
2024-12-02 21:16:10 +01:00
Daniel Stenberg
fcb59534e3
curl: --continue-at is mutually exclusive with --range
Allowing both just creates a transfer with behaviors no user can
properly anticipate so better just deny the combo.

Fixes #15646
Reported-by: Harry Sintonen
Closes #15666
2024-12-02 15:36:44 +01:00
Daniel Stenberg
fa1a8e0215
docs: suggest --ssl-reqd instead of --ftp-ssl
Reported-by: SuperStormer on github
Fixes #15658
Closes #15660
2024-12-02 09:07:50 +01:00
Daniel Stenberg
f54966b167
RELEASE-NOTES: synced 2024-12-02 09:05:37 +01:00
Jay Satiro
b1c54e1006 setopt: fix missing options for builds without HTTP & MQTT
- Restore some necessary options for builds without HTTP and MQTT.

The logic to turn off a segment of options in builds without HTTP and
MQTT was too expansive. Those builds (such as FTP-only builds) could not
use options such as CURLOPT_URL or CURLOPT_USERNAME etc.

Prior to this change 30da1f59 (precedes 8.11.0) refactored the options
processing and caused this issue.

Reported-by: Yoshimasa Ohno

Fixes https://github.com/curl/curl/issues/15634
Closes https://github.com/curl/curl/pull/15640
2024-11-29 12:49:55 -05:00