Commit Graph

31608 Commits

Author SHA1 Message Date
Dmitry Karpov
1e4cd51935
cookie: avoid fopen with empty file name
Closes #12514
2023-12-14 00:15:57 +01:00
Viktor Szakats
246e0d805a
tests/server: delete workaround for old-mingw
mingw-w64 1.0 comes with w32api v3.12, thus doesn't need this.

Follow-up to 38029101e2 #11625

Reviewed-by: Jay Satiro
Closes #12510
2023-12-13 08:01:33 +00:00
Viktor Szakats
043523a89b
cmake: delete obsolete TODOs more [ci skip]
- manual completed: 898b012a9b #1288
- soname completed: 5de6848f10 #10023
- bunch of others that are completed
- `NTLM_WB_ENABLED` is implemented in a basic form, and now also
  scheduled for removal, so a TODO at this point isn't useful.

And this 'to-check' item:

Q: "The cmake build selected to run gcc with -fPIC on my box while the
   plain configure script did not."

A: With CMake, since 2ebc74c36a #11546
   and fc9bfb1452 #11627, we explicitly
   enable PIC for libcurl shared lib. Or when building libcurl for
   shared and static lib in a single pass. We do this by default for
   Windows or when enabled by the user via `SHARE_LIB_OBJECT`.
   Otherwise we don't touch this setting. Meaning the default set by
   CMake (if any) or the toolchain is used. On Debian Bookworm, this
   means that PIC is disabled for static libs by default. Some platforms
   (like macOS), has PIC enabled by default.
   autotools supports the double-pass mode only, and in that case
   CMake seems to match PIC behaviour now (as tested on Linux with gcc.)

Follow-up to 5d5dfdbd1a #12500

Reviewed-by: Jay Satiro
Closes #12509
2023-12-13 08:01:33 +00:00
Stefan Eissing
3be759610f
CLIENT-WRITERS: design and use documentation
Closes #12507
2023-12-12 17:37:52 +01:00
Viktor Szakats
5d5dfdbd1a
cmake: delete obsolete TODO items [ci skip]
There is always room for improvement, but CMake is up to par now with
autotools, so there is no longer a good reason to keep around these
inline TODO items.

Answering one of questions:

Q: "The gcc command line use neither -g nor any -O options. As a
   developer, I also treasure our configure scripts's --enable-debug
   option that sets a long range of "picky" compiler options."

A: CMake offers the `CMAKE_BUILD_TYPE` variable to control debug info
   and optimization level. E.g.:
   - `Release`    = `-O3` + no debug info
   - `MinSizeRel` = `-Os` + no debug info
   - `Debug`      = `-O0` + debug info

   https://stackoverflow.com/questions/48754619/what-are-cmake-build-type-debug-release-relwithdebinfo-and-minsizerel/59314670#59314670
   https://cmake.org/cmake/help/latest/manual/cmake-buildsystem.7.html#default-and-custom-configurations

   For picky warnings we have the `PICKY_COMPILER` options, enabled by
   default.

Closes #12500
2023-12-12 11:54:35 +00:00
Stefan Eissing
02d81c5a68
CONNECTION-FILTERS: update documentation
Closes #12497
2023-12-11 23:30:26 +01:00
Daniel Stenberg
ff74cef5d4
lib: reduce use of strncpy
- bearssl: select cipher without buffer copies
- http_aws_sigv4: avoid strncpy, require exact timestamp length
- http_aws_sigv4: use memcpy isntead of strncpy
- openssl: avoid strncpy calls
- schannel: check for 1.3 algos without buffer copies
- strerror: avoid strncpy calls
- telnet: avoid strncpy, return error on too long inputs
- vtls: avoid strncpy in multissl_version()

Closes #12499
2023-12-11 23:29:02 +01:00
Daniel Stenberg
9efdefe6b1
CI/distcheck: run full tests
To be able to detect missing files better, this now runs the full CI
test suite. If done before, it would have detected #12462 before
release.

Closes #12503
2023-12-11 23:26:04 +01:00
Daniel Stenberg
e38a8e0cd0
docs: clean up Protocols: for cmdline options
... and some other minor polish.

Closes #12496
2023-12-11 10:40:16 +01:00
Daniel Stenberg
9fa8652fd5
cmdline/gen: fix the sorting of the man page options
They were previously sorted based on the file names, which use a .d
extension, making "data" get placed after "data-binary" etc. Making the
sort ignore the extention fixes the ordering.

Reported-by: Boris Verkhovskiy
Bug: https://curl.se/mail/archive-2023-12/0014.html
Closes #12494
2023-12-10 14:04:52 +01:00
Daniel Gustafsson
d65b8868c6
doh: remove unused local variable
The nurl variable is no longer used during probing following
a refactoring, so remove.

Closes #12491
2023-12-09 00:14:18 +01:00
Jay Satiro
0f3f384343 build: fix Windows ADDRESS_FAMILY detection
- Include winsock2.h for Windows ADDRESS_FAMILY detection.

Prior to this change cmake detection didn't work because it included
ws2def.h by itself, which is missing needed types from winsock2.h.

Prior to this change autotools detection didn't work because it did not
include any Windows header.

In both cases libcurl would fall back on unsigned short as the address
family type, which is the same as ADDRESS_FAMILY.

Co-authored-by: Viktor Szakats

Closes https://github.com/curl/curl/pull/12441
2023-12-08 13:11:44 -05:00
Daniel Stenberg
7c992dd9f8
lib: rename Curl_strndup to Curl_memdup0 to avoid misunderstanding
Since the copy does not stop at a null byte, let's not call it anything
that makes you think it works like the common strndup() function.

Based on feedback from Jay Satiro, Stefan Eissing and Patrick Monnerat

Closes #12490
2023-12-08 17:22:33 +01:00
Daniel Stenberg
6d8dc2f636
convsrctest.pl: removed: not used, not shipped in tarballs 2023-12-08 12:53:24 +01:00
Daniel Stenberg
c386065878
tests: rename tests scripts to the test number
It is hard to name the scripts sensibly. Lots of them are similarly
named and the name did not tell which test that used them.

The new approach is rather to name them based on the test number that
runs them. Also helps us see which scripts are for individual tests
rather than for general test infra.

 - badsymbols.pl -> test1167.pl
 - check-deprecated.pl -> test1222.pl
 - check-translatable-options.pl -> test1544.pl
 - disable-scan.pl -> test1165.pl
 - error-codes.pl -> test1175.pl
 - errorcodes.pl -> test1477.pl
 - extern-scan.pl -> test1135.pl
 - manpage-scan.pl -> test1139.pl
 - manpage-syntax.pl -> test1173.pl
 - markdown-uppercase.pl -> test1275.pl
 - mem-include-scan.pl -> test1132.pl
 - nroff-scan.pl -> test1140.pl
 - option-check.pl -> test1276.pl
 - options-scan.pl -> test971.pl
 - symbol-scan.pl -> test1119.pl
 - version-scan.pl -> test1177.pl

Closes #12487
2023-12-08 12:53:17 +01:00
MAntoniak
13a1d1ace8
sendf: fix compiler warning with CURL_DISABLE_HEADERS_API
fix MSVC warning C4189: 'htype': local variable is initialized but not
referenced - when CURL_DISABLE_HEADERS_API is defined.

Closes #12485
2023-12-08 09:28:53 +01:00
Viktor Szakats
ede2e812c2
tidy-up: whitespace
Closes #12484
2023-12-08 03:28:50 +00:00
Stefan Eissing
ca6bafce95
test_02_download: fix paramters to test_02_27
- it is a special client that only ever uses http/2

Closes #12467
2023-12-07 09:32:46 +01:00
MAntoniak
4dbc7acc19
vtls: remove the Curl_cft_ssl_proxy object if CURL_DISABLE_PROXY
Closes #12459
2023-12-07 09:31:05 +01:00
Daniel Stenberg
7309b9cbbf
lib: strndup/memdup instead of malloc, memcpy and null-terminate
- bufref: use strndup
 - cookie: use strndup
 - formdata: use strndup
 - ftp: use strndup
 - gtls: use aprintf instead of malloc + strcpy * 2
 - http: use strndup
 - mbedtls: use strndup
 - md4: use memdup
 - ntlm: use memdup
 - ntlm_sspi: use strndup
 - pingpong: use memdup
 - rtsp: use strndup instead of malloc, memcpy and null-terminate
 - sectransp: use strndup
 - socks_gssapi.c: use memdup
 - vtls: use dynbuf instead of malloc, snprintf and memcpy
 - vtls: use strdup instead of malloc + memcpy
 - wolfssh: use strndup

Closes #12453
2023-12-07 08:47:44 +01:00
Daniel Stenberg
63cdaefbc3
strdup: remove the memchr check from Curl_strndup
It makes it possible to clone a binary chunk of data.

Closes #12453
2023-12-07 08:47:28 +01:00
Daniel Stenberg
c0dd06ecb3
ftp: handle the PORT parsing without allocation
Also reduces amount of *cpy() calls.

Closes #12456
2023-12-07 08:46:22 +01:00
Daniel Stenberg
f899e91431
RELEASE-NOTES: synced
Bumped to 8.5.1
2023-12-06 23:23:06 +01:00
Daniel Stenberg
45cf4755e7
url: for disabled protocols, mention if found in redirect
To help users better understand where the URL (and denied scheme) comes
from. Also removed "in libcurl" from the message, since the disabling
can be done by the application.

The error message now says "not supported" or "disabled" depending on
why it was denied:

 Protocol "hej" not supported
 Protocol "http" disabled

And in redirects:

 Protocol "hej" not supported (in redirect)
 Protocol "http" disabled (in redirect)

Reported-by: Mauricio Scheffer
Fixes #12465
Closes #12469
2023-12-06 23:05:21 +01:00
Stefan Eissing
8b99e6f23f
sectransp_ make TLSCipherNameForNumber() available in non-verbose config
Reported-by: Cajus Pollmeier
Closes #12476
Fixes #12474
2023-12-06 23:03:35 +01:00
YX Hao
a17f041bea
lib: fix variable undeclared error caused by infof changes
`--disable-verbose` yields `CURL_DISABLE_VERBOSE_STRINGS` defined.
`infof` isn't `Curl_nop_stmt` anymore: dac293c.

Follow-up to dac293c

Closes #12470
2023-12-06 23:01:54 +01:00
Viktor Szakats
8b76591b6b
tidy-up: fix yamllint whitespace issues in labeler.yml
Follow-up to bda2129114 #12466

Reviewed-by: Dan Fandrich
Closes #12475
2023-12-06 20:33:04 +00:00
Viktor Szakats
bda2129114
tidy-up: fix yamllint whitespace issues
Closes #12466
2023-12-06 17:25:59 +00:00
Chris Sauer
a2e75af3fb
cmake: fix typo
Follow-up to aace27b
Closes #12464
2023-12-06 13:13:41 +01:00
Daniel Stenberg
da8c1d1578
dist: add tests/errorcodes.pl to the tarball
Used by test 1477

Reported-by: Xi Ruoyao
Follow-up to 0ca3a4ec9a
Fixes #12462
Closes #12463
2023-12-06 11:28:41 +01:00
Dan Fandrich
ee2e8bfa36 github/labeler: update a missed key in the v5 upgrade
Follow-up to ce03fe3ba
2023-12-06 00:59:53 -08:00
Daniel Stenberg
7161cb17c0
RELEASE-NOTES: synced
The curl 8.5.0 release.
2023-12-06 08:11:44 +01:00
Dan Fandrich
ce03fe3bae github/labeler: switch from the beta to labeler v5
Some keys were renamed and the dot option was made default.

Closes #12458
2023-12-05 13:30:35 -08:00
Daniel Stenberg
04540f69cf
DEPRECATE: remove NTLM_WB in June 2024
Ref: https://curl.se/mail/lib-2023-12/0010.html

Closes #12451
2023-12-05 08:02:59 +01:00
Jacob Hoffman-Andrews
ad040e1262
rustls: implement connect_blocking
Closes #11647
2023-12-04 23:03:45 +01:00
Daniel Stenberg
79147a76cd
examples/rtsp-options.c: add
Just a bare bones RTSP example using CURLOPT_RTSP_SESSION_ID and
CURLOPT_RTSP_REQUEST set to CURL_RTSPREQ_OPTIONS.

Closes #12452
2023-12-04 22:35:38 +01:00
Stefan Eissing
0fbbc80b24
ngtcp2: ignore errors on unknown streams
- expecially in is_alive checks on connections, we might
  see incoming packets on streams already forgotten and closed,
  leading to errors reported by nghttp3. Ignore those.

Closes #12449
2023-12-04 12:57:24 +01:00
Daniel Stenberg
cb521d1f9a
docs: make all examples in all libcurl man pages compile
Closes #12448
2023-12-04 10:50:42 +01:00
Daniel Stenberg
3c4fba8cf5
checksrc.pl: support #line instructions
makes it identify the correct source file and line
2023-12-04 10:50:42 +01:00
Daniel Stenberg
8dbcdc8c09
GHA/man-examples: verify libcurl man page examples 2023-12-04 10:50:42 +01:00
Daniel Stenberg
c5576d8d28
verify-examples.pl: verify that all man page examples compile clean 2023-12-04 10:50:42 +01:00
Daniel Stenberg
54d33862b5
RELEASE-NOTES: synced 2023-12-02 23:21:21 +01:00
Graham Campbell
f6e83a4cb0
http3: bump ngtcp2 and nghttp3 versions
nghttp3 v1.1.0
ngtcp2 v1.1.0

In docs and CI

Closes #12446
2023-12-02 23:02:54 +01:00
Graham Campbell
7b507feff4
CI/quiche: use 3.1.4+quic consistently in CI workflows
Closes #12447
2023-12-02 23:00:36 +01:00
Viktor Szakats
0f10360073
test1545: disable deprecation warnings
Fixes:
https://ci.appveyor.com/project/curlorg/curl/builds/48631551/job/bhx74e0i66yrp6pk#L1205

Same with details:
https://ci.appveyor.com/project/curlorg/curl/builds/48662893/job/ol8a78q9gmilb6wt#L1263
```
tests/libtest/lib1545.c:38:3: error: 'curl_formadd' is deprecated: since 7.56.0. Use curl_mime_init() [-Werror=deprecated-declarations]
   38 |   curl_formadd(&m_formpost, &lastptr, CURLFORM_COPYNAME, "file",
      |   ^~~~~~~~~~~~
[...]
```

Follow-up to 07a3cd83e0 #12421

Fixes #12445
Closes #12444
2023-12-02 20:17:41 +00:00
Daniel Stenberg
586e3c19cd
INSTALL: update list of ports and CPU archs 2023-12-02 17:40:48 +01:00
Daniel Stenberg
018f9cb480
symbols-in-versions: the CLOSEPOLICY options are deprecated
The were used with the CURLOPT_CLOSEPOLICY option, which *never* worked.
2023-12-02 17:07:34 +01:00
z2_
c44671ed43 build: fix builds that disable protocols but not digest auth
- Build base64 functions if digest auth is not disabled.

Prior to this change if some protocols were disabled but not digest auth
then a build error would occur due to missing base64 functions.

Fixes https://github.com/curl/curl/issues/12440
Closes https://github.com/curl/curl/pull/12442
2023-12-01 23:26:53 -05:00
MAntoniak
0eda1f6c9f
connect: reduce number of transportation providers
Use only the ones necessary - the ones that are built-in. Saves a few
bytes in the resulting code.

Closes #12438
2023-12-01 23:14:07 +01:00
David Benjamin
56791f3e23
vtls: consistently use typedef names for OpenSSL structs
The foo_st names don't appear in OpenSSL public API documentation. The
FOO typedefs are more common. This header was already referencing
SSL_CTX via <openssl/ssl.h>. There is a comment about avoiding
<openssl/x509v3.h>, but OpenSSL actually declares all the typedefs in
<openssl/ossl_typ.h>, which is already included by <openssl/ssl.h> (and
every other OpenSSL header), so just use that. Though I've included it
just to be explicit.

(I'm also fairly sure including <openssl/ssl.h> already triggers the
Schannel conflicts anyway. The comment was probably just out of date.)

Closes #12439
2023-12-01 23:00:43 +01:00