Go to file
Jay Satiro 3e7ec1e849 schannel: schannel_recv overhaul
This commit is several drafts squashed together. The changes from each
draft are noted below. If any changes are similar and possibly
contradictory the change in the latest draft takes precedence.

Bug: https://github.com/bagder/curl/issues/244
Reported-by: Chris Araman

%%
%% Draft 1
%%
- return 0 if len == 0. that will have to be documented.
- continue on and process the caches regardless of raw recv
- if decrypted data will be returned then set the error code to CURLE_OK
and return its count
- if decrypted data will not be returned and the connection has closed
(eg nread == 0) then return 0 and CURLE_OK
- if decrypted data will not be returned and the connection *hasn't*
closed then set the error code to CURLE_AGAIN --only if an error code
isn't already set-- and return -1
- narrow the Win2k workaround to only Win2k

%%
%% Draft 2
%%
- Trying out a change in flow to handle corner cases.

%%
%% Draft 3
%%
- Back out the lazier decryption change made in draft2.

%%
%% Draft 4
%%
- Some formatting and branching changes
- Decrypt all encrypted cached data when len == 0
- Save connection closed state
- Change special Win2k check to use connection closed state

%%
%% Draft 5
%%
- Default to CURLE_AGAIN in cleanup if an error code wasn't set and the
connection isn't closed.

%%
%% Draft 6
%%
- Save the last error only if it is an unrecoverable error.

Prior to this I saved the last error state in all cases; unfortunately
the logic to cover that in all cases would lead to some muddle and I'm
concerned that could then lead to a bug in the future so I've replaced
it by only recording an unrecoverable error and that state will persist.

- Do not recurse on renegotiation.

Instead we'll continue on to process any trailing encrypted data
received during the renegotiation only.

- Move the err checks in cleanup after the check for decrypted data.

In either case decrypted data is always returned but I think it's easier
to understand when those err checks come after the decrypted data check.

%%
%% Draft 7
%%
- Regardless of len value go directly to cleanup if there is an
unrecoverable error or a close_notify was already received. Prior to
this change we only acknowledged those two states if len != 0.

- Fix a bug in connection closed behavior: Set the error state in the
cleanup, because we don't know for sure it's an error until that time.

- (Related to above) In the case the connection is closed go "greedy"
with the decryption to make sure all remaining encrypted data has been
decrypted even if it is not needed at that time by the caller. This is
necessary because we can only tell if the connection closed gracefully
(close_notify) once all encrypted data has been decrypted.

- Do not renegotiate when an unrecoverable error is pending.

%%
%% Draft 8
%%
- Don't show 'server closed the connection' info message twice.

- Show an info message if server closed abruptly (missing close_notify).
2015-06-17 00:17:03 -04:00
CMake
docs Fix typo in docs 2015-06-16 12:16:55 +02:00
include curl.h: add CURL_HTTP_VERSION_2 2015-06-05 08:26:47 +02:00
lib schannel: schannel_recv overhaul 2015-06-17 00:17:03 -04:00
m4 build: Fix typo from OpenSSL 1.0.2 version detection fix 2015-06-14 16:01:18 -04:00
packages build: removed bundles.c from make files 2015-05-14 14:55:48 +02:00
projects
scripts scripts: moved contributors.sh and contrithanks.sh into subdir 2015-05-27 16:10:08 +02:00
src help: Add --proxy-service-name and --service-name to the --help output 2015-06-08 10:00:11 +02:00
tests test1530: added http to required features 2015-06-14 22:38:39 +02:00
winbuild winbuild: Document the option used to statically link the CRT 2015-05-08 01:09:57 -04:00
.gitattributes
.gitignore
.travis.yml
acinclude.m4 configure: remove missing and make it autogenerate 2015-04-30 18:40:35 +02:00
buildconf configure: remove missing and make it autogenerate 2015-04-30 18:40:35 +02:00
buildconf.bat
CHANGES
CHANGES.0
CMakeLists.txt
configure.ac Require nghttp2 v1.0.0 2015-05-18 09:33:48 +02:00
CONTRIBUTING.md CONTRIBUTING.md: remove the sourceforge mention 2015-04-30 18:35:43 +02:00
COPYING
CTestConfig.cmake
curl-config.in
GIT-INFO
libcurl.pc.in
MacOSX-Framework
Makefile.am scripts: add zsh.pl for generating zsh completion 2015-05-24 00:03:14 +02:00
Makefile.dist
maketgz log2changes.pl: moved to scripts/ 2015-05-24 00:09:23 +02:00
README README: use secure protocol for Git repository 2015-06-15 23:45:34 +02:00
RELEASE-NOTES RELEASE-NOTES: synced with f29f2cbd00 2015-06-16 09:07:37 +02:00

                                  _   _ ____  _
                              ___| | | |  _ \| |
                             / __| | | | |_) | |
                            | (__| |_| |  _ <| |___
                             \___|\___/|_| \_\_____|

README

  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 find answers to the most frequent questions we get in the FAQ document.

  Study the COPYING file for distribution terms and similar. If you distribute
  curl binaries or other binaries that involve libcurl, you might enjoy the
  LICENSE-MIXING document.

CONTACT

  If you have problems, questions, ideas or suggestions, please contact us
  by posting to a suitable mailing list. See http://curl.haxx.se/mail/

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

WEB SITE

  Visit the curl web site for the latest news and downloads:

        http://curl.haxx.se/

GIT

  To download the very latest source off the GIT server do this:

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

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

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.