]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 years agourldata: move the cookefilelist to the 'set' struct
Daniel Stenberg [Thu, 22 Dec 2022 12:09:16 +0000 (13:09 +0100)] 
urldata: move the cookefilelist to the 'set' struct

The cookiefile entries are set into the handle and should remain set for
the lifetime of the handle so that duplicating it also duplicates the
list. Therefore, the struct field is moved from 'state' to 'set'.

Fixes #10133
Closes #10134

2 years agostrdup: name it Curl_strdup
Daniel Stenberg [Thu, 22 Dec 2022 09:15:38 +0000 (10:15 +0100)] 
strdup: name it Curl_strdup

It does not belong in the curlx_ name space as it is never used
externally.

Closes #10132

2 years agomsh3: update to v0.5 Release
Nick Banks [Wed, 21 Dec 2022 14:13:40 +0000 (14:13 +0000)] 
msh3: update to v0.5 Release

Closes #10125

2 years agoworkflows/linux.yml: merge 3 common packages
andy5995 [Fri, 9 Dec 2022 20:53:47 +0000 (14:53 -0600)] 
workflows/linux.yml: merge 3 common packages

Closes #10071

2 years agodocs: mention indirect effects of --insecure
Daniel Stenberg [Wed, 21 Dec 2022 22:36:57 +0000 (23:36 +0100)] 
docs: mention indirect effects of --insecure

Warn users that disabling certficate verification allows servers to
"pollute" curl with data it trusts.

Reported-by: Harry Sintonen
Closes #10126

2 years agoSECURITY-PROCESS.md: document severity levels
Daniel Stenberg [Mon, 19 Dec 2022 17:04:11 +0000 (18:04 +0100)] 
SECURITY-PROCESS.md: document severity levels

Closes #10118

2 years agoRELEASE_NOTES: synced
Daniel Stenberg [Wed, 21 Dec 2022 14:35:59 +0000 (15:35 +0100)] 
RELEASE_NOTES: synced

bumped version for new cycle

2 years agotool_operate: fix `CURLOPT_SOCKS5_GSSAPI_NEC` type
Marcel Raad [Wed, 21 Dec 2022 11:31:31 +0000 (12:31 +0100)] 
tool_operate: fix `CURLOPT_SOCKS5_GSSAPI_NEC` type

`CURLOPT_SOCKS5_GSSAPI_NEC` is a long, while `socks5_gssapi_nec` was
made a bool in commit 4ac64eadf60.

Closes https://github.com/curl/curl/pull/10124

2 years agoRELEASE-NOTES: synced curl-7_87_0
Daniel Stenberg [Wed, 21 Dec 2022 07:00:59 +0000 (08:00 +0100)] 
RELEASE-NOTES: synced

The curl 7.87.0 release

2 years agoTHANKS: 40 new contributors from 7.87.0
Daniel Stenberg [Wed, 21 Dec 2022 07:00:59 +0000 (08:00 +0100)] 
THANKS: 40 new contributors from 7.87.0

2 years agohttp: fix the ::1 comparison for IPv6 localhost for cookies
Daniel Stenberg [Tue, 20 Dec 2022 09:07:36 +0000 (10:07 +0100)] 
http: fix the ::1 comparison for IPv6 localhost for cookies

When checking if there is a "secure context", which it is if the
connection is to localhost even if the protocol is HTTP, the comparison
for ::1 was done incorrectly and included brackets.

Reported-by: BratSinot on github
Fixes #10120
Closes #10121

2 years agoCI/spell: actions/checkout@v2 > actions/checkout@v3
Philip H [Mon, 19 Dec 2022 21:58:28 +0000 (22:58 +0100)] 
CI/spell: actions/checkout@v2 > actions/checkout@v3

2 years agosmb/telnet: do not free the protocol struct in *_done()
Daniel Stenberg [Mon, 19 Dec 2022 07:38:37 +0000 (08:38 +0100)] 
smb/telnet: do not free the protocol struct in *_done()

It is managed by the generic layer.

Reported-by: Trail of Bits
Closes #10112

2 years agohttp: use the IDN decoded name in HSTS checks
Daniel Stenberg [Mon, 19 Dec 2022 07:36:55 +0000 (08:36 +0100)] 
http: use the IDN decoded name in HSTS checks

Otherwise it stores the info HSTS into the persistent cache for the IDN
name which will not match when the HSTS status is later checked for
using the decoded name.

Reported-by: Hiroki Kurosawa
Closes #10111

2 years agoCURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"
Daniel Stenberg [Fri, 16 Dec 2022 11:45:20 +0000 (12:45 +0100)] 
CURLOPT_DEBUGFUNCTION.3: emphasize that incoming data is "raw"

Closes #10106

2 years agosocks: fix username max size is 255 (0xFF)
Xì Gà [Fri, 16 Dec 2022 10:58:38 +0000 (17:58 +0700)] 
socks: fix username max size is 255 (0xFF)

Closes #10105

Reviewed-by: Daniel Gustafsson
2 years agolimit-rate.d: see also --rate
Daniel Stenberg [Fri, 16 Dec 2022 09:31:13 +0000 (10:31 +0100)] 
limit-rate.d: see also --rate

2 years agolib1560: add some basic IDN host name tests
Daniel Stenberg [Thu, 15 Dec 2022 09:25:13 +0000 (10:25 +0100)] 
lib1560: add some basic IDN host name tests

Closes #10094

2 years agoidn: rename the files to idn.[ch] and hold all IDN functions
Daniel Stenberg [Wed, 14 Dec 2022 13:49:59 +0000 (14:49 +0100)] 
idn: rename the files to idn.[ch] and hold all IDN functions

Closes #10094

2 years agoidn: remove Curl_win32_ascii_to_idn
Daniel Stenberg [Wed, 14 Dec 2022 13:41:02 +0000 (14:41 +0100)] 
idn: remove Curl_win32_ascii_to_idn

It was not used. Introduce a new IDN header for the prototype(s).

Closes #10094

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 15 Dec 2022 15:35:18 +0000 (16:35 +0100)] 
RELEASE-NOTES: synced

2 years agocurl_url_get.3: remove spurious backtick
Daniel Stenberg [Thu, 15 Dec 2022 11:57:48 +0000 (12:57 +0100)] 
curl_url_get.3: remove spurious backtick

Put there by mistake.

Follow-up from 9a8564a92

Closes #10101

2 years agosocks: fix infof() flag for outputing a char
Daniel Stenberg [Thu, 15 Dec 2022 11:29:59 +0000 (12:29 +0100)] 
socks: fix infof() flag for outputing a char

It used to be a 'long', %lu is no longer correct.

Follow-up to 57d2d9b6bed33d
Detected by Coverity CID 1517663

Closes #10100

2 years agossl-reqd.d: clarify that this is for upgrading connections only
Daniel Stenberg [Wed, 14 Dec 2022 12:56:42 +0000 (13:56 +0100)] 
ssl-reqd.d: clarify that this is for upgrading connections only

Closes #10093

2 years agocurl_url_set.3: document CURLU_DISALLOW_USER
Daniel Stenberg [Thu, 15 Dec 2022 09:30:51 +0000 (10:30 +0100)] 
curl_url_set.3: document CURLU_DISALLOW_USER

Closes #10099

2 years agocmake: set the soname on the shared library
Daniel Stenberg [Sat, 3 Dec 2022 12:20:14 +0000 (13:20 +0100)] 
cmake: set the soname on the shared library

Set SONAME and VERSION for platforms we think this works on. Remove
issue from KNOWN_BUGS.

Assisted-by: Jakub Zakrzewski
Closes #10023

2 years agotool_paramhlp: free the proto strings on exit
Daniel Stenberg [Wed, 14 Dec 2022 22:55:37 +0000 (23:55 +0100)] 
tool_paramhlp: free the proto strings on exit

And also make sure that repeated use of the options free the previous
string before it stores a new.

Follow-up from e6f8445edef8e7996d

Closes #10098

2 years agotool_cfgable: free the ssl_ec_curves on exit
Daniel Stenberg [Wed, 14 Dec 2022 22:46:12 +0000 (23:46 +0100)] 
tool_cfgable: free the ssl_ec_curves on exit

Follow-up to ede125b7b

Closes #10097

2 years agourlapi: reject more bad letters from the host name: &+()
Daniel Stenberg [Wed, 14 Dec 2022 22:41:08 +0000 (23:41 +0100)] 
urlapi: reject more bad letters from the host name: &+()

Follow-up from eb0167ff7d31d3a5

Extend test 1560 to verify

Closes #10096

2 years agoaltsvc: fix rejection of negative port numbers
Daniel Stenberg [Wed, 14 Dec 2022 22:16:16 +0000 (23:16 +0100)] 
altsvc: fix rejection of negative port numbers

Follow-up to ac612dfeee95

strtoul() accepts a leading minus so better make sure there is none

Extended test 356 somewhat to use a huge negative 64 bit number that
otherwise becomes a low positive number.

Closes #10095

2 years agolib: use size_t or int etc instead of longs
Daniel Stenberg [Tue, 13 Dec 2022 14:02:00 +0000 (15:02 +0100)] 
lib: use size_t or int etc instead of longs

Since long is not using a consistent data size in curl builds, making it
often "waste" 32 bits.

Closes #10088

2 years agoazure: use "unversioned" clang and clang-tools for scanbuild job
Daniel Stenberg [Wed, 14 Dec 2022 09:26:09 +0000 (10:26 +0100)] 
azure: use "unversioned" clang and clang-tools for scanbuild job

To make it less fragile

Closes #10092

2 years agox509asn1: avoid freeing unallocated pointers
Daniel Gustafsson [Wed, 14 Dec 2022 09:14:27 +0000 (10:14 +0100)] 
x509asn1: avoid freeing unallocated pointers

When utf8asn1str fails there is no allocation returned, so freeing
the return pointer in **to is at best a no-op and at worst a double-
free bug waiting to happen. The current coding isn't hiding any such
bugs but to future proof, avoid freeing the return value pointer iff
the function failed.

Closes: #10087
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agocurl_url_set.3: fix typo
Emil Engler [Tue, 13 Dec 2022 18:04:55 +0000 (19:04 +0100)] 
curl_url_set.3: fix typo

Closes: #10089
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agotest2304: verify websocket handling when connection is closed
Daniel Stenberg [Mon, 12 Dec 2022 15:50:39 +0000 (16:50 +0100)] 
test2304: verify websocket handling when connection is closed

2 years agoserver/sws: if asked to close connection, skip the websocket handling
Daniel Stenberg [Mon, 12 Dec 2022 15:45:53 +0000 (16:45 +0100)] 
server/sws: if asked to close connection, skip the websocket handling

2 years agows: if no connection is around, return error
Daniel Stenberg [Mon, 12 Dec 2022 12:37:55 +0000 (13:37 +0100)] 
ws: if no connection is around, return error

- curl_ws_send returns CURLE_SEND_ERROR if data->conn is gone

- curl_ws_recv returns CURLE_GOT_NOTHING on connection close

- curl_ws_recv.3: mention new return code for connection close + example
  embryo

Closes #10084

2 years agodocs: extend the dump-header documentation
Emil Engler [Mon, 12 Dec 2022 18:44:35 +0000 (19:44 +0100)] 
docs: extend the dump-header documentation

This commit extends the documentation of the --dump-header command-line
option to reflect the behavior introduced in 8b1e5df7.

See #10079
Closes #10085

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 12 Dec 2022 08:15:50 +0000 (09:15 +0100)] 
RELEASE-NOTES: synced

2 years agostyled-output.d: this option does not work on Windows
Daniel Stenberg [Mon, 12 Dec 2022 07:11:15 +0000 (08:11 +0100)] 
styled-output.d: this option does not work on Windows

Reported-by: u20221022 on github
Fixes #10082
Closes #10083

2 years agotool: determine the correct fopen option for -D
Emil Engler [Sun, 11 Dec 2022 17:08:17 +0000 (18:08 +0100)] 
tool: determine the correct fopen option for -D

This commit fixes a bug in the dump-header feature regarding the
determination of the second fopen(3) option.

Reported-by: u20221022 on github
See #4753
See #4762
Fixes #10074
Closes #10079

2 years agodocs/curl_ws_send: Fixed typo in websocket docs
MonkeybreadSoftware [Sun, 11 Dec 2022 19:23:54 +0000 (20:23 +0100)] 
docs/curl_ws_send: Fixed typo in websocket docs

Replace as with is in relevant sentences.

Closes: #10081
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agoc-hyper: fix multi-request mechanism
Prithvi MK [Sun, 11 Dec 2022 10:13:14 +0000 (15:43 +0530)] 
c-hyper: fix multi-request mechanism

It makes test 565 run fine.

Fixes #8896
Closes #10080
Assisted-by: Daniel Stenberg
2 years agopage-header: grammar improvement (display transfer rate)
andy5995 [Fri, 9 Dec 2022 19:58:13 +0000 (13:58 -0600)] 
page-header: grammar improvement (display transfer rate)

Closes #10068

2 years agodocs/DEPRECATE.md: grammar improvement and sp correction
andy5995 [Fri, 9 Dec 2022 19:10:42 +0000 (13:10 -0600)] 
docs/DEPRECATE.md: grammar improvement and sp correction

The main thing I wanted to do was fix the spelling of "spent", but I
think this rewording improves the flow of the paragraph.

Closes #10067

2 years agotool_cfgable: make socks5_gssapi_nec a boolean
Boris Verkhovskiy [Sat, 10 Dec 2022 22:26:37 +0000 (15:26 -0700)] 
tool_cfgable: make socks5_gssapi_nec a boolean

Closes #10078

2 years agocontributors.sh: actually use $CURLWWW instead of just setting it.
Frank Gevaerts [Fri, 9 Dec 2022 15:42:21 +0000 (16:42 +0100)] 
contributors.sh: actually use $CURLWWW instead of just setting it.

The script was all set up for flexibility where curl-www is elsewhere in
the filesystem, but then hard-coded ../curl-www anyway...

Closes #10064

2 years agoKNOWN_BUGS: remove items not considered bugs any more
Daniel Stenberg [Tue, 6 Dec 2022 12:00:35 +0000 (13:00 +0100)] 
KNOWN_BUGS: remove items not considered bugs any more

- CURL_GLOBAL_SSL

This option was changed in libcurl 7.57.0 and clearly it has not caused
too many issues and a lot of time has passed.

- Store TLS context per transfer instead of per connection

This is a possible future optimization. One that is much less important
and interesting since the added support for CA caching.

- Microsoft telnet server

This bug was filed in May 2007 against curl 7.16.1 and we have not
received further reports.

- active FTP over a SOCKS

Actually, proxies in general is not working with active FTP mode. This
is now added in proxy documentation.

- DICT responses show the underlying protocol

curl still does this, but since this is now an established behavior
since forever we cannot change it easily and adding an option for it
seems crazy as this protocol is not so little its not worth it. Let's
just live with it.

- Secure Transport disabling hostname validation also disables SNI

This is an already documented restriction in Secure Transport.

- CURLOPT_SEEKFUNCTION not called with CURLFORM_STREAM

The curl_formadd() function is marked and documented as deprecated. No
point in collecting bugs for it. It should not be used further.

- STARTTRANSFER time is wrong for HTTP POSTs

After close source code inspection I cannot see how this is true or that
there is any special treatment for different HTTP methods. We also have
not received many further reports on this, making me strongly suspect
that this is no (longer an) issue.

- multipart formposts file name encoding

The once proposed RFC 5987-encoding is since RFC 7578 documented as MUST
NOT be used. The since then implemented MIME API allows the user to set
the name on their own and can thus provide it encoded as it wants.

- DoH is not used for all name resolves when enabled

It is questionable if users actually want to use DoH for interface and
FTP port name resolving. This restriction is now documented and we
advice users against using name resolving at all for these functions.

Closes #10043

2 years agoCURLOPT_COOKIEFILE.3: advice => advise
Daniel Stenberg [Fri, 9 Dec 2022 09:16:08 +0000 (10:16 +0100)] 
CURLOPT_COOKIEFILE.3: advice => advise

Closes #10063

Reviewed-by: Daniel Gustafsson
2 years agocurl.h: reword comment to not use deprecated option
Daniel Gustafsson [Fri, 9 Dec 2022 08:41:24 +0000 (09:41 +0100)] 
curl.h: reword comment to not use deprecated option

CURLOPT_INFILE was replaced by CURLOPT_READDATA in 7.9.7,  reword the
comment mentioning it to make code grepping easier as well as improve
the documentation.

Closes: #10062
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agosystem.h: fix socklen_t, curl_off_t, long long for Classic Mac OS
Ryan Schmidt [Wed, 7 Dec 2022 17:00:41 +0000 (11:00 -0600)] 
system.h: fix socklen_t, curl_off_t, long long for Classic Mac OS

Change "__MWERKS__" to "macintosh". When this block was originally added
in 3ac6929 it was probably intended to handle classic Mac OS since the
previous classic Mac OS build procedure for curl (which was removed in
bf327a9) used Metrowerks CodeWarrior.

But there are other classic Mac OS compilers, such as the MPW compilers,
that were not handled by this case. For classic Mac OS,
CURL_TYPEOF_CURL_SOCKLEN_T needs to match what's provided by the
third-party GUSI library, which does not vary by compiler.

Meanwhile CodeWarrior works on platforms other than classic Mac OS, and
they may need different definitions. Separate blocks could be added
later for any of those platforms that curl doesn't already support.

Closes #10049

2 years agovms: remove SIZEOF_SHORT
Ryan Schmidt [Thu, 8 Dec 2022 19:45:44 +0000 (13:45 -0600)] 
vms: remove SIZEOF_SHORT

The rest of SIZEOF_SHORT was removed in d48dd15.

See #9291
Closes #10061

2 years agotool_formparse: avoid clobbering on function params
Daniel Gustafsson [Thu, 8 Dec 2022 22:45:18 +0000 (23:45 +0100)] 
tool_formparse: avoid clobbering on function params

While perfectly legal to do, clobbering function parameters and using
them as local variables is confusing at best and rarely improves code
readability.  Fix by using a local variable instead, no functionality
is changed.

This also renames the parameter from data to mime_data since the term
data is (soft) reserved for the easy handle struct.

Closes: #10046
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agonoproxy: guard against empty hostnames in noproxy check
Daniel Gustafsson [Thu, 8 Dec 2022 22:37:32 +0000 (23:37 +0100)] 
noproxy: guard against empty hostnames in noproxy check

When checking for a noproxy setting we need to ensure that we get
a hostname passed in. If there is no hostname then there cannot be
a matching noproxy rule for it by definition.

Closes: #10057
Reported-by: Geeknik Labs
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
2 years agoc-hyper: CONNECT respones are not server responses
Daniel Stenberg [Thu, 8 Dec 2022 16:47:54 +0000 (17:47 +0100)] 
c-hyper: CONNECT respones are not server responses

Together with d31915a8dbbd it makes test 265 run fine.

Fixes #8853
Assisted-by: Prithvi MK
Assisted-by: Sean McArthur
Closes #10060

2 years agotest265: Use "connection: keep-alive" response header
Daniel Stenberg [Thu, 8 Dec 2022 15:47:43 +0000 (16:47 +0100)] 
test265: Use "connection: keep-alive" response header

When it answers as HTTP/1.0, so that clients (hyper) knows properly that
the connection remains intact.

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 8 Dec 2022 13:55:39 +0000 (14:55 +0100)] 
RELEASE-NOTES: synced

2 years agocfilter: improve SSL connection checks
Stefan Eissing [Wed, 7 Dec 2022 13:58:46 +0000 (14:58 +0100)] 
cfilter: improve SSL connection checks

- fixes `Curl_ssl_cf_get_ssl()` to detect also the first filter instance
  as ssl (refs #10053)

- replaces `Curl_ssl_use()` with the correct `Curl_conn_is_ssl()`

Closes #10054
Fixes #10053

Reported-by: Patrick Monnerat
2 years agoruntests: silence nghttpx errors
Daniel Stenberg [Tue, 6 Dec 2022 16:26:13 +0000 (17:26 +0100)] 
runtests: silence nghttpx errors

Also, move the output of the nghttpx_h3 info to the general "Env:" line
in the test output header.

Reported-by: Marcel Raad
Ref: https://github.com/curl/curl/commit/ca15b7512e8d1199e55fbaa206ef01e64b8f147d#commitcomment-92015094
Closes #10044

2 years agoconfig-mac: define HAVE_SYS_IOCTL_H
Ryan Schmidt [Mon, 5 Dec 2022 19:25:05 +0000 (13:25 -0600)] 
config-mac: define HAVE_SYS_IOCTL_H

This is needed to compile nonblock.c on classic Mac OS with Grand
Unified Socket Interface (GUSI) because nonblock.c uses FIONBIO which is
defined in <sys/filio.h> which is included by <sys/ioctl.h>.

Ref: https://sourceforge.net/projects/gusi/

Closes https://github.com/curl/curl/pull/10042

2 years agoCI: Change FreeBSD image from 12.3 to 12.4
Philip H [Wed, 7 Dec 2022 11:06:31 +0000 (12:06 +0100)] 
CI: Change FreeBSD image from 12.3 to 12.4

Ref: https://www.phoronix.com/news/FreeBSD-12.4-Released

Closes https://github.com/curl/curl/pull/10051

2 years agotest1421: fix typo
Ryan Schmidt [Wed, 7 Dec 2022 16:37:33 +0000 (10:37 -0600)] 
test1421: fix typo

Closes https://github.com/curl/curl/pull/10055

2 years agobuild: assume errno.h is always available
Jay Satiro [Sun, 27 Nov 2022 21:12:12 +0000 (16:12 -0500)] 
build: assume errno.h is always available

- Remove errno.h detection from all build configurations.

errno.h is a standard header according to C89.

Closes https://github.com/curl/curl/pull/9986

2 years agobuild: assume assert.h is always available
Jay Satiro [Sun, 27 Nov 2022 21:03:39 +0000 (16:03 -0500)] 
build: assume assert.h is always available

- Remove assert.h detection from all build configurations.

assert.h is a standard header according to C89.

I had proposed this several years ago as part of a larger change that
was abandoned.

Ref: https://github.com/curl/curl/issues/1237#issuecomment-277500720

Closes https://github.com/curl/curl/pull/9985

2 years agoCI: LGTM.com will be shut down in December 2022
Philip H [Wed, 7 Dec 2022 11:07:13 +0000 (12:07 +0100)] 
CI: LGTM.com will be shut down in December 2022

Closes #10052

2 years agomailmap: Andy Alt
Daniel Stenberg [Tue, 6 Dec 2022 22:23:13 +0000 (23:23 +0100)] 
mailmap: Andy Alt

2 years agomisc: Fix incorrect spelling
andy5995 [Tue, 6 Dec 2022 19:34:12 +0000 (13:34 -0600)] 
misc: Fix incorrect spelling

Fix various uses of connnect by replacing them with connect.

Closes: #10045
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2 years agowolfssl: remove special BIO return code handling
Stefan Eissing [Tue, 6 Dec 2022 07:47:32 +0000 (08:47 +0100)] 
wolfssl: remove special BIO return code handling

- rely solely on the retry flag in BIO, similar to OpenSSL vtls
  implementation.

Ref: https://github.com/curl/curl/pull/10021#issuecomment-1336147053

Closes #10033

2 years agoopenssl: return -1 on error in the BIO callbacks
Daniel Stenberg [Mon, 5 Dec 2022 10:29:38 +0000 (11:29 +0100)] 
openssl: return -1 on error in the BIO callbacks

BIO_read and BIO_write return negative numbers on error, including
retryable ones. A regression from 55807e6. Both branches should be
returning -1.

The APIs are patterned after POSIX read and write which, similarly,
return -1 on errors, not zero, with EAGAIN treated as an error.

Bug: https://github.com/curl/curl/issues/10013#issuecomment-1335308146
Reported-by: David Benjamin
Closes #10021

2 years agoconfig-mac: remove HAVE_SYS_SELECT_H
Ryan Schmidt [Mon, 5 Dec 2022 19:09:49 +0000 (13:09 -0600)] 
config-mac: remove HAVE_SYS_SELECT_H

When compiling for classic Mac OS with GUSI, there is no sys/select.h.
GUSI provides the "select" function prototype in sys/time.h.

Closes #10039

2 years agosetup: do not require __MRC__ defined for Mac OS 9 builds
Ryan Schmidt [Sat, 27 Aug 2022 00:31:31 +0000 (19:31 -0500)] 
setup: do not require __MRC__ defined for Mac OS 9 builds

Partially reverts "somewhat protect Mac OS X users from using Mac OS 9
config file", commit 62519bfe059251af2914199f284c736553ff0489.

Do things that are specific to classic Mac OS (i.e. include config-mac.h
in curl_setup.h and rename "main" to "curl_main" in tool_setup.h) when
only "macintosh" is defined. Remove the additional condition that
"__MRC__" should be defined since that would only be true with the MPW
MrC compiler which prevents the use of other reasonable compilers like
the MPW SC compiler and especially the Metrowerks CodeWarrior compilers.
"macintosh" is only defined by classic Mac OS compilers so this change
should not affect users of Mac OS X / OS X / macOS / any other OS.

Closes #10037

2 years agocurl.h: name all public function parameters
Ryan Schmidt [Mon, 5 Dec 2022 18:25:57 +0000 (12:25 -0600)] 
curl.h: name all public function parameters

Most public function parameters already have names; this adds those
that were missing.

Closes #10036

2 years agodocs/examples: spell correction ('Retrieve')
Andy Alt [Tue, 6 Dec 2022 03:24:28 +0000 (21:24 -0600)] 
docs/examples: spell correction ('Retrieve')

Closes #10040

2 years agounit1302: slightly extended
Daniel Stenberg [Mon, 5 Dec 2022 09:08:53 +0000 (10:08 +0100)] 
unit1302: slightly extended

To test more base64 decoding

2 years agobase64: faster base64 decoding
Daniel Stenberg [Mon, 5 Dec 2022 08:40:10 +0000 (09:40 +0100)] 
base64: faster base64 decoding

- by using a lookup table instead of strchr()
- by doing full quantums first, then padding

Closes #10032

2 years agolibssh2: return error when ssh_hostkeyfunc returns error
mickae1 [Mon, 5 Dec 2022 13:24:02 +0000 (14:24 +0100)] 
libssh2: return error when ssh_hostkeyfunc returns error

return CURLE_PEER_FAILED_VERIFICATION if verification with the callback
return a result different than CURLKHMATCH_OK

Closes #10034

2 years agoMakefile.mk: improve a GNU Make hack [ci skip]
Viktor Szakats [Mon, 5 Dec 2022 14:31:32 +0000 (14:31 +0000)] 
Makefile.mk: improve a GNU Make hack [ci skip]

Replace the hack of using `$() ` to represent a single space. The new
method silences the `--warn-undefined-variables` debug warning and it's
also a better-known form of solving this problem.

Reviewed-by: Jay Satiro
Closes #10031

2 years agotests/unit/.gitignore: ignore all unit + 4 digits files
Daniel Stenberg [Mon, 5 Dec 2022 13:58:06 +0000 (14:58 +0100)] 
tests/unit/.gitignore: ignore all unit + 4 digits files

2 years agobase64: encode without using snprintf
Daniel Stenberg [Sat, 3 Dec 2022 23:34:09 +0000 (00:34 +0100)] 
base64: encode without using snprintf

For speed. In some tests, this approch is 29 times faster!

Closes #10026

2 years agobase64: better alloc size
Daniel Stenberg [Sat, 3 Dec 2022 23:07:52 +0000 (00:07 +0100)] 
base64: better alloc size

The previous algorithm allocated more bytes than necessary.

Suggested-by: xtonik on github
Fixes #10024
Closes #10025

2 years agoconfig-mac: fix typo: size_T -> size_t
Ryan Schmidt [Sat, 27 Aug 2022 00:03:37 +0000 (19:03 -0500)] 
config-mac: fix typo: size_T -> size_t

Both MPW and CodeWarrior compilers complained about this.

Closes #10029

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Sat, 3 Dec 2022 10:47:27 +0000 (11:47 +0100)] 
RELEASE-NOTES: synced

2 years agoCMake: fix build with `CURL_USE_GSSAPI`
Jakub Zakrzewski [Fri, 2 Dec 2022 15:22:32 +0000 (16:22 +0100)] 
CMake: fix build with `CURL_USE_GSSAPI`

CMAKE_*_LINKER_FLAGS must be a string but GSS_LINKER_FLAGS is a list, so
we need to replace semicolons with spaces when setting those.

Fixes #9017
Closes #1022

2 years agoci: Reuse fuzzing snippet from curl-fuzzer project
Max Dymond [Fri, 2 Dec 2022 14:02:13 +0000 (14:02 +0000)] 
ci: Reuse fuzzing snippet from curl-fuzzer project

2 years agoGHA: clarify workflows permissions, set least possible privilege
Diogo Teles Sant'Anna [Wed, 16 Nov 2022 14:55:33 +0000 (11:55 -0300)] 
GHA: clarify workflows permissions, set least possible privilege

Set top-level permissions to None on all workflows, setting per-job
permissions. This avoids that new jobs inherit unwanted permissions.

Discussion: https://curl.se/mail/lib-2022-11/0028.html

Signed-off-by: Diogo Teles Sant'Anna <diogoteles@google.com>
Closes #9928

2 years agoMakefile.mk: address minor issues
Viktor Szakats [Fri, 2 Dec 2022 15:20:41 +0000 (15:20 +0000)] 
Makefile.mk: address minor issues

- Fix `NROFF` auto-detection with certain shell/make-build combinations:

  When a non-MSYS2 GNU Make runs inside an MSYS2 shell, Make executes
  the detection command as-is via `CreateProcess()`. It fails because
  `command` is an `sh` built-in. Ensure to explicitly invoke the shell.

- Initialize user-customizable variables:

  Silences a list of warnings when running GNU Make with the option
  `--warn-undefined-variables`. Another benefit is that it's now easy
  to look up all user-customizable `Makefile.mk` variables by grepping
  for ` ?=` in the curl source tree.

Suggested-by: Gisle Vanem
  Ref: https://github.com/curl/curl/pull/9764#issuecomment-1330674433

- Fix `MKDIR` invocation:

  Avoid a warning and potential issue in envs without forward-slash
  support.

Closes #10000

2 years agocurl_get_line: allow last line without newline char
Rob de Wit [Wed, 23 Nov 2022 13:56:39 +0000 (14:56 +0100)] 
curl_get_line: allow last line without newline char

improve backwards compatibility

Test 3200 verifies

Closes #9973

2 years agocookie: open cookie jar as a binary file
Daniel Stenberg [Fri, 2 Dec 2022 07:30:30 +0000 (08:30 +0100)] 
cookie: open cookie jar as a binary file

On Windows there is a difference and for text files, ^Z means end of
file which is not desirable.

Ref: #9973
Closes #10017

2 years agoruntests: only do CRLF replacements for hyper if it is HTTP
Daniel Stenberg [Thu, 1 Dec 2022 16:25:25 +0000 (17:25 +0100)] 
runtests: only do CRLF replacements for hyper if it is HTTP

Closes #10016

2 years agoopenssl: fix for BoringSSL BIO result interpretation mixups
Stefan Eissing [Thu, 1 Dec 2022 15:19:39 +0000 (16:19 +0100)] 
openssl: fix for BoringSSL BIO result interpretation mixups

Reported-by: Robin Marx
Fixes #10013
Closes #10015

2 years agoci: Remove zuul fuzzing job as it's superseded by CIFuzz
Max Dymond [Thu, 1 Dec 2022 13:54:13 +0000 (13:54 +0000)] 
ci: Remove zuul fuzzing job as it's superseded by CIFuzz

2 years agoruntests: do CRLF replacements per section only
Daniel Stenberg [Thu, 1 Dec 2022 08:21:04 +0000 (09:21 +0100)] 
runtests: do CRLF replacements per section only

The `crlf="yes"` attribute and "hyper mode" are now only applied on a
subset of dedicated sections: data, datacheck, stdout and protocol.

Updated test 2500 accordingly.

Also made test1 use crlf="yes" for <protocol>, mostly because it is
often used as a template test case. Going forward, using this attribute
we should be able to write test cases using linefeeds only and avoid
mixed line ending encodings.

Follow-up to ca15b7512e8d11

Fixes #10009
Closes #10010

2 years agognutls: use common gnutls init and verify code for ngtcp2
Stefan Eissing [Wed, 30 Nov 2022 13:42:37 +0000 (14:42 +0100)] 
gnutls: use common gnutls init and verify code for ngtcp2

Closes #10007

2 years agoaws_sigv4: fix typos in aws_sigv4.c
Baitinq on github [Wed, 30 Nov 2022 14:59:52 +0000 (15:59 +0100)] 
aws_sigv4: fix typos in aws_sigv4.c

Closes #10008

2 years agocurl.h: include <sys/select.h> on SerenityOS
Kenneth Myhra [Wed, 30 Nov 2022 09:33:57 +0000 (10:33 +0100)] 
curl.h: include <sys/select.h> on SerenityOS

Closes #10006

2 years agoopenssl: prefix errors with '[lib]/[version]: '
Daniel Stenberg [Wed, 30 Nov 2022 09:20:06 +0000 (10:20 +0100)] 
openssl: prefix errors with '[lib]/[version]: '

To help users understand where this (cryptic) error message comes from.

Suggested-by: Philip Sanetra
Ref: #10002
Closes #10004

2 years agotests: add HTTP/3 test case, custom location for proper nghttpx
Stefan Eissing [Tue, 29 Nov 2022 15:41:15 +0000 (16:41 +0100)] 
tests: add HTTP/3 test case, custom location for proper nghttpx

- adding support for HTTP/3 test cases via a nghttpx server that is
  build with ngtcp2 and nghttp3.
- test2500 is the first test case, performing a simple GET.
- nghttpx is checked for support and the 'feature' nghttpx-h3
  is set accordingly. test2500 will only run, when supported.
- a specific nghttpx location can be given in the environment
  variable NGHTTPX or via the configure option
    --with-test-nghttpx=<path>

Extend NGHTTPX config to H2 tests as well

* use $ENV{NGHTTPX} and the configured default also in http2 server starts
* always provide the empty test/nghttpx.conf to nghttpx. as it defaults to
  reading /etc/nghttpx/nghttpx.conf otherwise.

Added nghttpx to CI ngtcp2 jobs to run h3 tests.

Closes #9031

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Nov 2022 08:11:08 +0000 (09:11 +0100)] 
RELEASE-NOTES: synced

Removed duplicate after contributors.sh fix: 9967c10b6daa1

2 years agoscripts/contributors.sh: strip one OR MORE leading spaces
Daniel Stenberg [Wed, 30 Nov 2022 08:09:47 +0000 (09:09 +0100)] 
scripts/contributors.sh: strip one OR MORE leading spaces

From names found credited in commit logs

2 years agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 30 Nov 2022 07:59:43 +0000 (08:59 +0100)] 
RELEASE-NOTES: synced