platform/upstream/curl.git
12 years agotests: Added Metalink test case # 2005
Tatsuhiro Tsujikawa [Thu, 21 Jun 2012 02:16:53 +0000 (04:16 +0200)]
tests: Added Metalink test case # 2005

12 years agocurl: Restore noprogress and isatty config values.
Tatsuhiro Tsujikawa [Wed, 20 Jun 2012 16:00:53 +0000 (01:00 +0900)]
curl: Restore noprogress and isatty config values.

The noprogress and isatty in Configurable are global, in a sense
that they persist in one curl invocation. Currently once one
download writes its response data to tty, they are set to FALSE
and they are not restored on successive downloads.  This change
first backups the current noprogress and isatty, and restores
them when download does not write its data to tty.

12 years agocurl: Made --metalink option toggle Metalink functionality
Tatsuhiro Tsujikawa [Wed, 20 Jun 2012 15:51:06 +0000 (00:51 +0900)]
curl: Made --metalink option toggle Metalink functionality

In this change, --metalink option no longer takes argument.  If
it is specified, given URIs are processed as Metalink XML file.
If given URIs are remote (e.g., http URI), curl downloads it
first. Regardless URI is local file (e.g., file URI scheme) or
remote, Metalink XML file is not written to local file system and
the received data is fed into Metalink XML parser directly.  This
means with --metalink option, filename related options like -O
and -o are ignored.

Usage examples:

$ curl --metalink http://example.org/foo.metalink

This will download foo.metalink and parse it and then download
the URI described there.

$ curl --metalink file://foo.metalink

This will parse local file foo.metalink and then download the URI
described there.

12 years agocurl: Refactored metalink_checksum
Tatsuhiro Tsujikawa [Sat, 16 Jun 2012 13:58:06 +0000 (22:58 +0900)]
curl: Refactored metalink_checksum

When creating metalink_checksum from metalink_checksum_t, first
check hex digest is valid for the given hash function.  We do
this check in the order of digest_aliases so that first good
match will be chosen (strongest hash function available).  As a
result, the metalinkfile now only contains at most one
metalink_checksum because other entries are just redundant.

12 years agotool_doswin.c: fix djgpp function _use_lfn() used without a prototype
Gisle Vanem [Wed, 20 Jun 2012 21:40:42 +0000 (23:40 +0200)]
tool_doswin.c: fix djgpp function _use_lfn() used without a prototype

http://curl.haxx.se/mail/archive-2012-06/0028.html

12 years agobuild: fix RESOURCE bug in lib/Makefile.vc*
Yang Tse [Wed, 20 Jun 2012 21:30:17 +0000 (23:30 +0200)]
build: fix RESOURCE bug in lib/Makefile.vc*

Removed two, not intended to exist, RESOURCE declarations.

Bug: http://curl.haxx.se/bug/view.cgi?id=3535977

And sorted configuration hunks to reflect same internal order
as the one shown in the usage message.

12 years agoschannel: Implement new buffer size strategy
Marc Hoersken [Wed, 20 Jun 2012 05:49:34 +0000 (07:49 +0200)]
schannel: Implement new buffer size strategy

Increase decrypted and encrypted cache buffers using limitted
doubling strategy. More information on the mailinglist:
http://curl.haxx.se/mail/lib-2012-06/0255.html

It updates the two remaining reallocations that have already been there
and fixes the other one to use the same "do we need to increase the
buffer"-condition as the other two.  CURL_SCHANNEL_BUFFER_STEP_SIZE was
renamed to CURL_SCHANNEL_BUFFER_FREE_SIZE since that is actually what it
is now.  Since we don't know how much more data we are going to read
during the handshake, CURL_SCHANNEL_BUFFER_FREE_SIZE is used as the
minimum free space required in the buffer for the next operation.
CURL_SCHANNEL_BUFFER_STEP_SIZE was used for that before, too, but since
we don't have a step size now, the define was renamed.

12 years agoschannel SSL: fix compiler warning
Yang Tse [Wed, 20 Jun 2012 20:26:51 +0000 (22:26 +0200)]
schannel SSL: fix compiler warning

12 years agoschannel SSL: fix for renegotiate problem
Mark Salisbury [Wed, 20 Jun 2012 16:24:47 +0000 (10:24 -0600)]
schannel SSL: fix for renegotiate problem

In schannel_connect_step2() doread should be initialized based
on connssl->connecting_state.

12 years agoruntests.pl: make it support metalink feature
Tatsuhiro Tsujikawa [Wed, 20 Jun 2012 18:15:42 +0000 (20:15 +0200)]
runtests.pl: make it support metalink feature

12 years agogetpart.pm: make test definition section/part parser more robust
Yang Tse [Wed, 20 Jun 2012 18:13:07 +0000 (20:13 +0200)]
getpart.pm: make test definition section/part parser more robust

Test definition section parts which needed to include xml-lingo as contents
of that part required that the xml-blurb was written as a single line. Now the
xml-data inside the part can be written multiline making it more readable.

Tested with <client><file> part which is written to disk before <command> runs.

12 years agoschannel_connect_step2: checksrc whitespace fix
Daniel Stenberg [Tue, 19 Jun 2012 22:51:03 +0000 (00:51 +0200)]
schannel_connect_step2: checksrc whitespace fix

12 years agoschannel SSL: changes in schannel_connect_step2
Mark Salisbury [Tue, 19 Jun 2012 22:51:03 +0000 (00:51 +0200)]
schannel SSL: changes in schannel_connect_step2

Process extra data buffer before returning from schannel_connect_step2.
Without this change I've seen WinCE hang when schannel_connect_step2
returns and calls Curl_socket_ready.

If the encrypted handshake does not fit in the intial buffer (seen with
large certificate chain), increasing the encrypted data buffer is necessary.

Fixed warning in curl_schannel.c line 1215.

12 years agoconfig-win32ce.h: WinCE config adjustment
Mark Salisbury [Tue, 19 Jun 2012 22:49:49 +0000 (00:49 +0200)]
config-win32ce.h: WinCE config adjustment

process.h is not present on WinCE

12 years agoschannel SSL: Made send method handle unexpected cases better
Mark Salisbury [Tue, 19 Jun 2012 22:14:17 +0000 (00:14 +0200)]
schannel SSL: Made send method handle unexpected cases better

Implemented timeout loop in schannel_send while sending data.  This
is as close as I think we can get to write buffering; I put a big
comment in to explain my thinking.

With some committer adjustments

12 years agocurl_schannel.c: Avoid unnecessary realloc calls to reduce buffer size
Marc Hoersken [Tue, 19 Jun 2012 12:57:12 +0000 (14:57 +0200)]
curl_schannel.c: Avoid unnecessary realloc calls to reduce buffer size

12 years agoschannel SSL: Use standard Curl read/write methods
Mark Salisbury [Tue, 19 Jun 2012 18:28:22 +0000 (20:28 +0200)]
schannel SSL: Use standard Curl read/write methods

Replaced calls to swrite with Curl_write_plain and calls to sread
with Curl_read_plain.

With some committer adjustments

12 years agoschannel SSL: make wording of some trace messages better reflect reality
Yang Tse [Tue, 19 Jun 2012 18:28:21 +0000 (20:28 +0200)]
schannel SSL: make wording of some trace messages better reflect reality

12 years agocurl_schannel.h: Use BUFSIZE as the initial buffer size if available
Marc Hoersken [Tue, 19 Jun 2012 08:31:56 +0000 (10:31 +0200)]
curl_schannel.h: Use BUFSIZE as the initial buffer size if available

Make the Schannel implementation use libcurl's default buffer size
for the initial received encrypted and decrypted data cache buffers.
The implementation still needs to handle more data since more data
might have already been received or decrypted during the handshake
or a read operation which needs to be cached for the next read.

12 years agoFixed NetWare makefile broken from last commit.
Guenter Knauf [Tue, 19 Jun 2012 09:54:10 +0000 (11:54 +0200)]
Fixed NetWare makefile broken from last commit.

12 years agoschannel SSL: Implemented SSL shutdown
Mark Salisbury [Tue, 19 Jun 2012 02:15:03 +0000 (04:15 +0200)]
schannel SSL: Implemented SSL shutdown

curl_schannel.c - implemented graceful SSL shutdown.  If we fail to
shutdown the connection gracefully, I've seen schannel try to use a
session ID for future connects and the server aborts the connection
during the handshake.

12 years agoschannel SSL: certificate validation on WinCE
Mark Salisbury [Tue, 19 Jun 2012 02:15:02 +0000 (04:15 +0200)]
schannel SSL: certificate validation on WinCE

curl_schannel.c - auto certificate validation doesn't seem to work
right on CE.  I added a method to perform the certificate validation
which uses CertGetCertificateChain and manually handles the result.

12 years agoschannel SSL: Added helper methods to simplify code
Mark Salisbury [Tue, 19 Jun 2012 02:15:01 +0000 (04:15 +0200)]
schannel SSL: Added helper methods to simplify code

Added helper methods InitSecBuffer() and InitSecBufferDesc() to make it
easier to set up SecBuffer & SecBufferDesc structs.

12 years agoSome more NetWare makefile tweaks for metalink.
Guenter Knauf [Mon, 18 Jun 2012 21:18:58 +0000 (23:18 +0200)]
Some more NetWare makefile tweaks for metalink.

12 years agotool_cb_see.c: WinCE build adjustment
Yang Tse [Mon, 18 Jun 2012 16:47:04 +0000 (18:47 +0200)]
tool_cb_see.c: WinCE build adjustment

12 years agosetup.h: WinCE build adjustment
Mark Salisbury [Mon, 18 Jun 2012 16:44:43 +0000 (18:44 +0200)]
setup.h: WinCE build adjustment

12 years agoftplistparser.c: do not compile if FTP protocol is not enabled
Mark Salisbury [Mon, 18 Jun 2012 11:06:02 +0000 (13:06 +0200)]
ftplistparser.c: do not compile if FTP protocol is not enabled

12 years agoWin32: downplay MS bazillion type synonyms game
Yang Tse [Sat, 16 Jun 2012 17:20:50 +0000 (19:20 +0200)]
Win32: downplay MS bazillion type synonyms game

Avoid usage of some MS type synonyms to allow compilation with
compiler headers that don't define these, using simpler synonyms.

12 years agoCurl_rtsp_parseheader: avoid useless malloc/free
Daniel Stenberg [Fri, 15 Jun 2012 20:51:45 +0000 (22:51 +0200)]
Curl_rtsp_parseheader: avoid useless malloc/free

Coverity actually pointed out flawed logic in the previous call to
Curl_strntoupper() where the code used sizeof() of a pointer to pass in
a size argument. That code still worked since it only needed to
uppercase 4 letters. Still, the entire malloc/uppercase/free sequence
was pointless since the code has already matched the string once in the
condition that starts the block of code.

12 years agocurl_share_setopt: use va_end()
Daniel Stenberg [Fri, 15 Jun 2012 20:37:19 +0000 (22:37 +0200)]
curl_share_setopt: use va_end()

As spotted by Coverity, va_end() was not used previously. To make it
used I took away a bunch of return statements and made them into
assignments instead.

12 years agoSSPI related code: Unicode support for WinCE - kill compiler warnings
Yang Tse [Fri, 15 Jun 2012 19:50:57 +0000 (21:50 +0200)]
SSPI related code: Unicode support for WinCE - kill compiler warnings

12 years agoSSPI related code: Unicode support for WinCE - commit 46480bb9 follow-up
Mark Salisbury [Fri, 15 Jun 2012 17:39:18 +0000 (19:39 +0200)]
SSPI related code: Unicode support for WinCE - commit 46480bb9 follow-up

12 years agobuild: add curl_multibyte files to build systems
Yang Tse [Fri, 15 Jun 2012 16:17:25 +0000 (18:17 +0200)]
build: add curl_multibyte files to build systems

12 years agoSSPI related code: Unicode support for WinCE
Mark Salisbury [Fri, 15 Jun 2012 16:05:11 +0000 (18:05 +0200)]
SSPI related code: Unicode support for WinCE

SSPI related code now compiles with ANSI and WCHAR versions of security
methods (WinCE requires WCHAR versions of methods).

Pulled UTF8 to WCHAR conversion methods out of idn_win32.c into their own file.

curl_sasl.c - include curl_memory.h to use correct memory functions.

getenv.c and telnet.c - WinCE compatibility fix

With some committer adjustments

12 years agoFixed typo.
Guenter Knauf [Fri, 15 Jun 2012 00:24:51 +0000 (02:24 +0200)]
Fixed typo.

12 years agowinbuild/MakefileBuild.vc: convert line endings to DOS style
Yang Tse [Thu, 14 Jun 2012 17:19:18 +0000 (19:19 +0200)]
winbuild/MakefileBuild.vc: convert line endings to DOS style

As per request on mailing list: http://curl.haxx.se/mail/lib-2012-06/0222.html

12 years agowinbuild: Allow SSPI build with or without Schannel
Marc Hoersken [Thu, 14 Jun 2012 15:56:59 +0000 (17:56 +0200)]
winbuild: Allow SSPI build with or without Schannel

The changes introduced in commit 2bfa57bc32 are not enough
to make it actually possible to use the USE_WINSSL option.
Makefile.vc was not updated and the configuration name which is
used in the build path did not match between both build files.

This patch fixes those issues and introduces the following changes:

- Replaced the -schannel name with -winssl in order to be consistent
with the other options
- Added ENABLE_WINSSL option to winbuild/Makefile.vc (default yes)
- Changed winbuild/MakefileBuild.vc to set USE_WINSSL to true if
USE_SSL is false and USE_WINSSL was not specified as a parameter
- Separated WINSSL handling from SSPI handling to be consistent with
the other options and their corresponding code path

12 years agocurl.1: 7.27.0 seems next release
Yang Tse [Thu, 14 Jun 2012 16:10:29 +0000 (18:10 +0200)]
curl.1: 7.27.0 seems next release

12 years agoschannel: fix printf-style format strings
Yang Tse [Thu, 14 Jun 2012 14:55:26 +0000 (16:55 +0200)]
schannel: fix printf-style format strings

12 years agoFix bad failf() and info() usage
Yang Tse [Thu, 14 Jun 2012 11:32:05 +0000 (13:32 +0200)]
Fix bad failf() and info() usage

Calls to failf() are not supposed to provide trailing newline.
Calls to infof() must provide trailing newline.

Fixed 30 or so strings.

12 years agoschannel: fix unused parameter warnings
Yang Tse [Thu, 14 Jun 2012 10:12:54 +0000 (12:12 +0200)]
schannel: fix unused parameter warnings

12 years agoschannel: fix comparisons between signed and unsigned
Yang Tse [Thu, 14 Jun 2012 10:10:51 +0000 (12:10 +0200)]
schannel: fix comparisons between signed and unsigned

12 years agoschannel: fix discarding qualifier from pointer type
Yang Tse [Thu, 14 Jun 2012 10:05:48 +0000 (12:05 +0200)]
schannel: fix discarding qualifier from pointer type

12 years agoschannel: fix shadowing of global declarations
Yang Tse [Thu, 14 Jun 2012 09:53:46 +0000 (11:53 +0200)]
schannel: fix shadowing of global declarations

12 years agoschannel: fix Curl_schannel_init() and Curl_schannel_cleanup() declarations
Yang Tse [Thu, 14 Jun 2012 09:34:12 +0000 (11:34 +0200)]
schannel: fix Curl_schannel_init() and Curl_schannel_cleanup() declarations

12 years agourldata.h: fix cyassl/openssl/ssl.h build clash with wincrypt.h
Gisle Vanem [Wed, 13 Jun 2012 23:51:51 +0000 (01:51 +0200)]
urldata.h: fix cyassl/openssl/ssl.h build clash with wincrypt.h

Building with CyaSSL failed compilation. Reason being that OCSP_REQUEST and
OCSP_RESPONSE are enum values in CyaSSL and defines in <wincrypt.h> included
via <winldap.h> in ldap.c.

http://curl.haxx.se/mail/lib-2012-06/0196.html

12 years agoMakefileBuild.vc: Allow building without SSL
Yang Tse [Wed, 13 Jun 2012 19:15:41 +0000 (21:15 +0200)]
MakefileBuild.vc: Allow building without SSL

In order to use Windows native SSL support define 'USE_WINSSL'

12 years agoconfigure: new option --with-winssl
Yang Tse [Wed, 13 Jun 2012 18:54:03 +0000 (20:54 +0200)]
configure: new option --with-winssl

This option may be used to build curl/libcurl using SSL/TLS support provided
by MS windows system libraries. Option is mutually exclusive with any other
SSL library. Default value is --without-winssl.

--with-winssl option implies --with-sspi option.

Option meaningful only for Windows builds.

12 years agoChanged Schannel string to SSL-Windows-native.
Guenter Knauf [Wed, 13 Jun 2012 17:29:45 +0000 (19:29 +0200)]
Changed Schannel string to SSL-Windows-native.

This is more descriptive for the user who might
not even know what schannnel is at all.

12 years agoschannel: remove version number and identify its use with 'schannel' literal
Yang Tse [Wed, 13 Jun 2012 13:53:51 +0000 (15:53 +0200)]
schannel: remove version number and identify its use with 'schannel' literal

Version number is removed in order to make this info consistent with
how we do it with other MS and Linux system libraries for which we don't
provide this info.

Identifier changed from 'WinSSPI' to 'schannel' given that this is the
actual provider of the SSL/TLS support. libcurl can still be built with
SSPI and without SCHANNEL support.

12 years agosinglesocket: remove dead code
Daniel Stenberg [Tue, 12 Jun 2012 21:04:04 +0000 (23:04 +0200)]
singlesocket: remove dead code

No need to check if 'entry' is non-NULL in a spot where it is already checked
and guaranteed to be non-NULL.

(Spotted by a Coverity scan)

12 years agonetrc: remove dead code
Daniel Stenberg [Tue, 12 Jun 2012 20:46:14 +0000 (22:46 +0200)]
netrc: remove dead code

Remove two states from the enum and the corresponding code for them as
these states were never reached or used.

(Spotted by a Coverity scan)

12 years agoRevert "connect.c/ftp.c: Fixed dereferencing pointer breakin strict-aliasing"
Yang Tse [Tue, 12 Jun 2012 11:12:09 +0000 (13:12 +0200)]
Revert "connect.c/ftp.c: Fixed dereferencing pointer breakin strict-aliasing"

This reverts commit 9c94236e6cc078a0dc5a78b6e2fefc1403e5375e.

It didn't server its purpose, so lets go back to long-time working code.

12 years agosocks_sspi.c: further cleanup
Yang Tse [Tue, 12 Jun 2012 10:34:52 +0000 (12:34 +0200)]
socks_sspi.c: further cleanup

12 years agosocks_sspi.c: Clean up and removal of obsolete minor status
Marc Hoersken [Tue, 12 Jun 2012 06:50:10 +0000 (08:50 +0200)]
socks_sspi.c: Clean up and removal of obsolete minor status

Removed obsolete minor status variable and parameter of status function
which was never used or set at all. Also Curl_sspi_strerror does support
only one status and there is no need for a second sub status.

12 years agoRemoved trailing whitespaces.
Guenter Knauf [Tue, 12 Jun 2012 03:36:08 +0000 (05:36 +0200)]
Removed trailing whitespaces.

12 years agostrerror.c: make Curl_sspi_strerror() always return code for errors
Yang Tse [Tue, 12 Jun 2012 01:57:15 +0000 (03:57 +0200)]
strerror.c: make Curl_sspi_strerror() always return code for errors

12 years agocurl_sspi.h: provide sspi status definitions missing in old headers
Yang Tse [Tue, 12 Jun 2012 01:56:24 +0000 (03:56 +0200)]
curl_sspi.h: provide sspi status definitions missing in old headers

12 years agosspi: make Curl_sspi_strerror() libcurl's sspi status code string function
Yang Tse [Mon, 11 Jun 2012 23:11:10 +0000 (01:11 +0200)]
sspi: make Curl_sspi_strerror() libcurl's sspi status code string function

12 years agosspi: make Curl_sspi_strerror() libcurl's sspi status code string function
Yang Tse [Mon, 11 Jun 2012 23:06:48 +0000 (01:06 +0200)]
sspi: make Curl_sspi_strerror() libcurl's sspi status code string function

12 years agoRevert: 634f7cfee40d4658 partially
Daniel Stenberg [Mon, 11 Jun 2012 20:58:39 +0000 (22:58 +0200)]
Revert: 634f7cfee40d4658 partially

Make sure CURL_VERSION_SSPI is present and works as in previous releases
for ABI and API compatibility reasons.

12 years agochecksrc: shorten a few lines to comply
Daniel Stenberg [Mon, 11 Jun 2012 17:08:46 +0000 (19:08 +0200)]
checksrc: shorten a few lines to comply

12 years agocleanup: remove trailing whitespace
Daniel Stenberg [Mon, 11 Jun 2012 17:06:43 +0000 (19:06 +0200)]
cleanup: remove trailing whitespace

12 years agowinbuild: Removed WITH_SSL=schannel and tie schannel to SSPI
Marc Hoersken [Mon, 11 Jun 2012 17:04:49 +0000 (19:04 +0200)]
winbuild: Removed WITH_SSL=schannel and tie schannel to SSPI

Removed specific WITH_SSL=schannel paramter that did not fit the general
schema and complicated the parameters. For now Schannel will be enabled
if SSPI is enabled and OpenSSL is disabled.

12 years agoMakefile.vc6: Added version.lib if built with SSPI
Steve Holme [Mon, 11 Jun 2012 17:04:16 +0000 (19:04 +0200)]
Makefile.vc6: Added version.lib if built with SSPI

12 years agowinbuild: Updated winbuild scripts to add schannel
Marc Hoersken [Mon, 11 Jun 2012 17:03:14 +0000 (19:03 +0200)]
winbuild: Updated winbuild scripts to add schannel

12 years agomingw32: Fixed warning of USE_SSL being redefined
Marc Hoersken [Sun, 10 Jun 2012 21:40:29 +0000 (23:40 +0200)]
mingw32: Fixed warning of USE_SSL being redefined

12 years agosspi: Fixed incompatible parameter pointer type in Curl_sspi_version
Marc Hoersken [Sun, 10 Jun 2012 21:31:59 +0000 (23:31 +0200)]
sspi: Fixed incompatible parameter pointer type in Curl_sspi_version

12 years agosspi: Updated RELEASE-NOTES, FEATURES and THANKS
Marc Hoersken [Sun, 10 Jun 2012 20:34:43 +0000 (22:34 +0200)]
sspi: Updated RELEASE-NOTES, FEATURES and THANKS

12 years agosetup.h: Automatically define USE_SSL if USE_SCHANNEL is defined
Marc Hoersken [Mon, 11 Jun 2012 06:37:22 +0000 (08:37 +0200)]
setup.h: Automatically define USE_SSL if USE_SCHANNEL is defined

12 years agoversion: Replaced SSPI feature information with version string details
Marc Hoersken [Mon, 11 Jun 2012 06:36:48 +0000 (08:36 +0200)]
version: Replaced SSPI feature information with version string details

Added Windows SSPI version information to the curl version string when
SCHANNEL SSL is not enabled, as the version of the library should also
be included when SSPI is used to generate security contexts.

Removed SSPI from the feature list as the features are GSS-Negotiate,
NTLM and SSL depending on the usage of the SSPI library.

12 years agosspi.c: Post Curl_sspi_version() rework code tidy up
Steve Holme [Sun, 10 Jun 2012 11:30:02 +0000 (12:30 +0100)]
sspi.c: Post Curl_sspi_version() rework code tidy up

Removed duplicate blank lines.
Removed spaces between the not and test in various if statements.
Removed explicit test of NULL in an if statement.
Placed function returns on same line as function declarations.
Replaced the use of curl_maprintf() with aprintf() as it is the
preprocessor job to do this substitution if ENABLE_CURLX_PRINTF
is set.

12 years agosspi: Reworked Curl_sspi_version() to return version components
Steve Holme [Sun, 10 Jun 2012 11:07:45 +0000 (12:07 +0100)]
sspi: Reworked Curl_sspi_version() to return version components

Reworked the version function to return four version components rather
than a string that has to be freed by the caller.

12 years agoconfigure.ac: Added -lversion if built with SSPI
Guenter Knauf [Mon, 23 Apr 2012 00:14:32 +0000 (01:14 +0100)]
configure.ac: Added -lversion if built with SSPI

12 years agoschannel: Code cleanup and bug fixes
Marc Hoersken [Sun, 15 Apr 2012 02:12:26 +0000 (04:12 +0200)]
schannel: Code cleanup and bug fixes

curl_sspi.c: Fixed mingw32-gcc compiler warnings
curl_sspi.c: Fixed length of error code hex output

The hex value was printed as signed 64-bit value on 64-bit systems:
SEC_E_WRONG_PRINCIPAL (0xFFFFFFFF80090322)

It is now correctly printed as the following:
SEC_E_WRONG_PRINCIPAL (0x80090322)

curl_sspi.c: Fallback to security function table version number
Instead of reporting an unknown version, the interface version is used.

curl_sspi.c: Removed SSPI/ version prefix from Curl_sspi_version
curl_schannel: Replaced static buffer sizes with defined names
curl_schannel.c: First brace when declaring functions on column 0
curl_schannel.c: Put the pointer sign directly at variable name
curl_schannel.c: Use structs directly instead of typedef'ed structs
curl_schannel.c: Removed space before opening brace
curl_schannel.c: Fixed lines being longer than 80 chars

12 years agocurl_sspi: Added Curl_sspi_version function
Marc Hoersken [Sat, 14 Apr 2012 13:00:33 +0000 (15:00 +0200)]
curl_sspi: Added Curl_sspi_version function

Added new function to get SSPI version as string.
Added required library version.lib to makefiles.
Changed curl_schannel.c to use Curl_sspi_version.

12 years agoschannel: Updated mingw32 makefiles
Guenter Knauf [Fri, 13 Apr 2012 11:17:57 +0000 (13:17 +0200)]
schannel: Updated mingw32 makefiles

12 years agoschannel: Replace ASCII specific code with general defines
Marc Hoersken [Fri, 13 Apr 2012 11:10:09 +0000 (13:10 +0200)]
schannel: Replace ASCII specific code with general defines

12 years agoschannel: Added definitions which are missing in mingw32
Marc Hoersken [Fri, 13 Apr 2012 11:09:24 +0000 (13:09 +0200)]
schannel: Added definitions which are missing in mingw32

12 years agoschannel: Moved interal struct types to urldata.h
Marc Hoersken [Fri, 13 Apr 2012 11:04:53 +0000 (13:04 +0200)]
schannel: Moved interal struct types to urldata.h

Moved type definitions in order to avoid inclusion loop

12 years agoschannel: Fixed compiler warnings about pointer type assignments
Marc Hoersken [Fri, 13 Apr 2012 11:05:26 +0000 (13:05 +0200)]
schannel: Fixed compiler warnings about pointer type assignments

12 years agoschannel: Fixed critical typo in conditions and added buffer length checks
Marc Hoersken [Fri, 13 Apr 2012 11:02:59 +0000 (13:02 +0200)]
schannel: Fixed critical typo in conditions and added buffer length checks

12 years agosspi: Refactored socks_sspi and schannel to use same error message functions
Marc Hoersken [Wed, 11 Apr 2012 15:25:26 +0000 (17:25 +0200)]
sspi: Refactored socks_sspi and schannel to use same error message functions

Moved the error constant switch to curl_sspi.c and added two new helper
functions to curl_sspi.[ch] which either return the constant or a fully
translated message representing the SSPI security status.
Updated socks_sspi.c and curl_schannel.c to use the new functions.

12 years agoschannel: Added special shutdown check for Windows 2000 Professional
Marc Hoersken [Tue, 10 Apr 2012 19:49:35 +0000 (21:49 +0200)]
schannel: Added special shutdown check for Windows 2000 Professional

Windows 2000 Professional:  Schannel returns SEC_E_OK instead
of SEC_I_CONTEXT_EXPIRED. If the length of the output buffer
is zero and the first byte of the encrypted packet is 0x15,
the application can safely assume that the message was a
close_notify message and change the return value to
SEC_I_CONTEXT_EXPIRED.

Connection shutdown does not mean that there is no data to read
Correctly handle incomplete message and ask curl to re-read
Fixed buffer for decrypted being to small
Re-structured read condition to be more effective
Removed obsolete verbose messages
Changed memory reduction method to keep a minimum buffer of size 4096

12 years agoschannel: Implemented SSL/TLS renegotiation
Marc Hoersken [Tue, 10 Apr 2012 19:21:31 +0000 (21:21 +0200)]
schannel: Implemented SSL/TLS renegotiation

Updated TODO information and added related MSDN articles

12 years agoschannel: Save session credential handles in session cache
Marc Hoersken [Mon, 9 Apr 2012 21:24:55 +0000 (23:24 +0200)]
schannel: Save session credential handles in session cache

12 years agoschannel: Code cleanup
Marc Hoersken [Mon, 9 Apr 2012 20:43:48 +0000 (22:43 +0200)]
schannel: Code cleanup

12 years agoschannel: Check for required context attributes
Marc Hoersken [Mon, 9 Apr 2012 20:33:58 +0000 (22:33 +0200)]
schannel: Check for required context attributes

12 years agoschannel: Allow certificate and revocation checks being deactivated
Marc Hoersken [Mon, 9 Apr 2012 16:35:00 +0000 (18:35 +0200)]
schannel: Allow certificate and revocation checks being deactivated

12 years agoschannel: Added SSL/TLS support with Microsoft Windows Schannel SSPI
Marc Hoersken [Mon, 9 Apr 2012 13:40:06 +0000 (15:40 +0200)]
schannel: Added SSL/TLS support with Microsoft Windows Schannel SSPI

12 years agohttp: Replaced specific SSL libraries list in https_getsock fallback
Marc Hoersken [Mon, 9 Apr 2012 13:19:54 +0000 (15:19 +0200)]
http: Replaced specific SSL libraries list in https_getsock fallback

12 years agoconnect.c/ftp.c: Fixed dereferencing pointer breakin strict-aliasing
Marc Hoersken [Mon, 11 Jun 2012 10:24:03 +0000 (12:24 +0200)]
connect.c/ftp.c: Fixed dereferencing pointer breakin strict-aliasing

Fixed warning: dereferencing pointer does break strict-aliasing rules
by using a union instead of separate pointer variables.
Internal union sockaddr_u could probably be moved to generic header.
Thanks to Paul Howarth for the hint about using unions for this.

Important for winbuild: Separate declaration of sockaddr_u pointer.
The pointer variable *sock cannot be declared and initialized right
after the union declaration. Therefore it has to be a separate statement.

12 years agocurl_ntlm_msgs.c: Fixed passwdlen not being used and recalculated
Marc Hoersken [Mon, 11 Jun 2012 00:23:00 +0000 (02:23 +0200)]
curl_ntlm_msgs.c: Fixed passwdlen not being used and recalculated

12 years agotests: fix test definitions # 1355, 1363, 1385 and 1393
Yang Tse [Mon, 11 Jun 2012 11:56:40 +0000 (13:56 +0200)]
tests: fix test definitions # 1355, 1363, 1385 and 1393

-i without HTTP protocol shall not include headers in the output

12 years agoCurl_pgrsDone: return int and acknowledge return code
Daniel Stenberg [Sun, 10 Jun 2012 21:39:04 +0000 (23:39 +0200)]
Curl_pgrsDone: return int and acknowledge return code

Since Curl_pgrsDone() itself calls Curl_pgrsUpdate() which may return an
abort instruction or similar we need to return that info back and
subsequently properly handle return codes from Curl_pgrsDone() where
used.

(Spotted by a Coverity scan)

12 years agowinbuild: Fixed environment variables being lost
Marc Hoersken [Sun, 10 Jun 2012 14:50:11 +0000 (16:50 +0200)]
winbuild: Fixed environment variables being lost

Fixed USE_IPV6 and USE_IDN not being passed
from Makefile.vc to MakefileBuild.vc
Fixed whitespace and formatting issues
Fixed typo and format in help message

12 years agoAdded metalink support to NetWare builds.
Guenter Knauf [Sat, 9 Jun 2012 21:10:23 +0000 (23:10 +0200)]
Added metalink support to NetWare builds.

12 years agosmtp.c: Removed unused variable
Steve Holme [Sat, 9 Jun 2012 18:49:59 +0000 (19:49 +0100)]
smtp.c: Removed unused variable

12 years agosmtp: Post apop feature code tidy up
Steve Holme [Sat, 9 Jun 2012 18:22:29 +0000 (19:22 +0100)]
smtp: Post apop feature code tidy up

12 years agopop3: Post apop feature code tidy up
Steve Holme [Sat, 9 Jun 2012 18:21:44 +0000 (19:21 +0100)]
pop3: Post apop feature code tidy up