Go to file
Sebastian Neubauer a5dd9435ee
smpt: fix starttls
In cases where the connection was fast, curl sometimes failed to open a
connection. This fixes a regression of c2d973627b.

The regression triggered in these steps:

1. Create an smtp connection
2. Use STARTTLS
3. Receive the response
4. We are inside the loop in `smtp_statemachine`, calling
   `smtp_state_starttls_resp`
5. In the good flow, we exit the loop, re-enter `smtp_statemachine` and
   run `smtp_perform_upgrade_tls` at the start of the function.

   In the bad flow, we stay in the while loop, calling
   `Curl_pp_readresp`, which reads part of the TLS handshake and things
   go wrong.

The reason is that `Curl_pp_moredata` changed behavior and always
returns `true`, so we stay in the loop in `smtp_statemachine`. With a
slow connection `Curl_pp_readresp` cannot read new data and returns
`CURL_AGAIN`, so we leave the loop and re-enter `smtp_statemachine`.

With a fast connection, `Curl_pp_readresp` reads new data from the tcp
connection, which is part of the TLS handshake.

The fix is in `Curl_pp_moredata`, which needs to take the final line
into account and return `false` if only the final line is stored.

Closes #13048
2024-03-05 13:30:16 +01:00
.circleci CI: Bump the Circle CI base Ubuntu image to the latest 20.04 2024-02-15 16:05:47 -08:00
.github CONTRIBUTE: update the section on documentation format 2024-03-05 10:53:21 +01:00
.reuse CI: Add dependabot.yml 2024-01-02 23:31:49 +01:00
CMake cmake: fix function description in comment [ci skip] 2024-02-06 22:20:33 +00:00
docs lib: enhance client reader resume + rewind 2024-03-05 13:26:05 +01:00
include curlver: bump to 8.7.0 for next release 2024-02-22 09:34:41 +01:00
lib smpt: fix starttls 2024-03-05 13:30:16 +01:00
LICENSES
m4 configure: add libngtcp2_crypto_boringssl detection 2024-01-25 11:27:43 +01:00
packages OS400: avoid using awk in the build scripts 2024-02-01 22:31:35 +01:00
plan9
projects tidy-up: whitespace 2023-12-08 03:28:50 +00:00
scripts lib: enhance client reader resume + rewind 2024-03-05 13:26:05 +01:00
src getparam: make --ftp-ssl work again 2024-02-28 11:20:22 +01:00
tests pytest: adapt to API change 2024-03-04 12:47:56 +01:00
winbuild build: do not publish HAVE_BORINGSSL, HAVE_AWSLC macros 2023-10-08 22:29:45 +00:00
.azure-pipelines.yml CI: install libpsl or configure --without-libpsl in builds 2024-01-09 09:10:58 +01:00
.cirrus.yml CI: install libpsl or configure --without-libpsl in builds 2024-01-09 09:10:58 +01:00
.dcignore
.dir-locals.el
.git-blame-ignore-revs
.gitattributes
.gitignore tidy-up: mostly whitespace nits 2023-08-31 23:02:10 +00:00
.mailmap mailmap: unify Michael Osipov under a single email 2023-09-21 14:18:49 +02:00
acinclude.m4 windows: delete redundant headers 2023-12-18 14:56:57 +00:00
appveyor.sh appveyor: tidy-ups 2023-12-23 03:33:22 +00:00
appveyor.yml appveyor: Properly skip if only CircleCI is changed 2024-03-01 01:16:24 -08:00
buildconf
buildconf.bat
CHANGES
CMakeLists.txt cmake: add warning for using TLS libraries without 1.3 support 2024-02-09 16:01:45 +01:00
configure.ac configure: build & install shell completions when enabled 2024-02-29 16:41:31 -08:00
COPYING COPYING: update copyright year 2024-01-08 18:40:06 +01:00
curl-config.in
GIT-INFO
libcurl.def curl_multi_get_handles: get easy handles from a multi handle 2023-09-25 20:16:58 +02:00
libcurl.pc.in
MacOSX-Framework
Makefile.am configure: build & install shell completions when enabled 2024-02-29 16:41:31 -08:00
Makefile.dist Makefile.mk: drop Windows support 2023-12-16 13:12:22 +00:00
maketgz docs: introduce "curldown" for libcurl man page format 2024-01-23 00:29:02 +01:00
README
README.md tidy-up: mostly whitespace nits 2023-08-31 23:02:10 +00:00
RELEASE-NOTES RELEASE-NOTES: synced 2024-03-04 08:19:12 +01:00
SECURITY.md SECURITY-PROCESS.md. call it vulnerability disclosure policy 2023-09-14 17:04:33 +02:00

curl logo

Curl is a command-line tool for transferring data specified with URL syntax. Find out how to use curl by reading the curl.1 man page or the MANUAL document. Find out how to install Curl by reading the INSTALL document.

libcurl is the library curl is using to do its job. It is readily available to be used by your software. Read the libcurl.3 man page to learn how.

You can find answers to the most frequent questions we get in the FAQ document.

Study the COPYING file for distribution terms.

Contact

If you have problems, questions, ideas or suggestions, please contact us by posting to a suitable mailing list.

All contributors to the project are listed in the THANKS document.

Commercial support

For commercial support, maybe private and dedicated help with your problems or applications using (lib)curl visit the support page.

Website

Visit the curl website for the latest news and downloads.

Git

To download the latest source from the Git server, do this:

git clone https://github.com/curl/curl.git

(you will get a directory named curl created, filled with the source code)

Security problems

Report suspected security problems via our HackerOne page and not in public.

Notice

Curl contains pieces of source code that is Copyright (c) 1998, 1999 Kungliga Tekniska Högskolan. This notice is included here to comply with the distribution terms.

Backers

Thank you to all our backers! 🙏 Become a backer.

Sponsors

Support this project by becoming a sponsor.