Although this should never happen due to the relationship between the
'mech' and 'resp' variables, and the way they are allocated together,
it does cause problems for code analysis tools:
V595 The 'mech' pointer was utilized before it was verified against
nullptr. Check lines: 376, 381. curl_sasl.c 376
Bug: https://github.com/curl/curl/issues/745 Reported-by: Alexis La Goutte
Steve Holme [Sun, 3 Apr 2016 16:17:20 +0000 (17:17 +0100)]
krb5_gssapi: Only process challenge when present
This wouldn't cause a problem because of the way the function is called,
but prior to this change, we were processing the challenge message when
the credentials were NULL rather than when the challenge message was
populated.
This also brings this part of the Kerberos 5 code in line with the
Negotiate code.
Steve Holme [Sun, 3 Apr 2016 16:02:44 +0000 (17:02 +0100)]
krb5: Fixed missing client response when mutual authentication enabled
Although mutual authentication is currently turned off and can only be
enabled by changing libcurl source code, authentication using Kerberos
5 has been broken since commit 79543caf90 in this use case.
Steve Holme [Sun, 3 Apr 2016 10:45:02 +0000 (11:45 +0100)]
krb5_sspi: Only process challenge when present
This wouldn't cause a problem because of the way the function is called,
but prior to this change, we were processing the challenge message when
the credentials were NULL rather than when the challenge message was
populated.
This also brings this part of the Kerberos 5 code in line with the
Negotiate code.
Steve Holme [Sun, 3 Apr 2016 10:15:03 +0000 (11:15 +0100)]
krb5: Only generate a SPN when its not known
Prior to this change, we were generating the SPN in the SSPI code when
the credentials were NULL and in the GSS-API code when the context was
empty. It is better to decouple the SPN generation from these checks
and only generate it when the SPN itself is NULL.
This also brings this part of the Kerberos 5 code in line with the
Negotiate code.
Daniel Stenberg [Fri, 1 Apr 2016 18:42:25 +0000 (20:42 +0200)]
http2: make use of the nghttp2 error callback
It offers extra info from nghttp2 in certain error cases. Like for
example when trying prior-knowledge http2 on a server that doesn't speak
http2 at all. The error message is passed on as a verbose message to
libcurl.
Steve Holme [Fri, 1 Apr 2016 20:48:35 +0000 (21:48 +0100)]
http_negotiate: Corrected host and proxy host name being wrong way round
I had accidentally used the proxy server name for the host and the host
server name for the proxy in commit ad5e9bfd5d and 6d6f9ca1d9. Whilst
Windows SSPI was quite happy with this, GSS-API wasn't.
Steve Holme [Fri, 1 Apr 2016 19:39:34 +0000 (20:39 +0100)]
build: Changed the Visual Studio projects warning level from 3 to 4
After squashing most of our compiler warnings, up'ed the default
warning level from 3 to 4 in order to increase the likelyhood of
catching future warnings.
Daniel Stenberg [Fri, 1 Apr 2016 11:57:15 +0000 (13:57 +0200)]
upload: missing rewind call could make libcurl hang
When an upload is done, there are two places where that can be detected
and only one of them would rewind the input stream - which sometimes is
necessary for example when doing NTLM HTTP POSTs and more.
This could then end up libcurl hanging.
Figured-out-by: Isaac Boukris Reported-by: Anatol Belski
Fixes #741
Daniel Stenberg [Fri, 1 Apr 2016 08:14:06 +0000 (10:14 +0200)]
curl/mprintf.h: remove support for _MPRINTF_REPLACE
The define is not in our name space and is therefore not protected by
our API promises.
It was only really used by libcurl internals but was mostly erased from
there already in 8aabbf5 (March 2015). This is supposedly the final
death blow to that define from everywhere.
As a side-effect, making sure _MPRINTF_REPLACE is gone and not used, I
made the lib tests in tests/libtest/ use curl_printf.h for its redefine
magic and then subsequently the use of sprintf() got banned in the tests
as well (as it is in libcurl internals) and I then replaced them all
with snprintf().
In the unlikely event that any users is actually using this define and
gets sad by this change, it is very easily copied to the user's own
code.
Marcel Raad [Wed, 30 Mar 2016 15:23:02 +0000 (17:23 +0200)]
openssl: Fix compilation warnings
When compiling with OpenSSL 1.1.0 (so that the HAVE_X509_GET0_SIGNATURE
&& HAVE_X509_GET0_EXTENSIONS pre-processor block is active), Visual C++
14 complains:
warning C4701: potentially uninitialized local variable 'palg' used
warning C4701: potentially uninitialized local variable 'psig' used
Jay Satiro [Tue, 29 Mar 2016 22:50:12 +0000 (18:50 -0400)]
build-wolfssl: Allow a broader range of ciphers (Visual Studio)
This is an update to the build-time options used to build wolfSSL in
Visual Studio for greater compatibility, and make it behave similar to
the way OpenSSL 1.0.2 behaves. Starting in wolfSSL v3.6.6 static ciphers
and SSLv3 are disabled by default at build time, but we can use both.
- Enable static cipher suites TLS_ECDH_ and TLS_RSA_.
- Enable SSLv3 hello. Though in libcurl we disable it by default at
runtime, we make it available so the user can manually select it if
necessary.
Isaac Boukris [Tue, 29 Mar 2016 14:13:46 +0000 (17:13 +0300)]
GSS: make Curl_gss_log_error more verbose
Also display the GSS_C_GSS_CODE (major code) when specified instead of
only GSS_C_MECH_CODE (minor code).
In addition, the old code was printing a colon twice after the prefix
and also miscalculated the length of the buffer in between calls to
gss_display_status (the length of ": " was missing).
Also, gss_buffer is not guaranteed to be NULL terminated and thus need
to restrict reading by its length.
Daniel Stenberg [Tue, 29 Mar 2016 14:08:38 +0000 (16:08 +0200)]
http2: set correct scheme in handler structs [regression]
Since commit a5aec58 the handler schemes need to match for the
connections to be reused and for HTTP/2 multiplexing to work, reusing
connections is very important!
Daniel Stenberg [Sun, 27 Mar 2016 22:03:42 +0000 (00:03 +0200)]
Makefile.am: skip the scripts dir
Skipping the scripts dir is primarily done for 'make install' so that it
does not attempt to install the zsh completion script as we've not yet
found a proper way to do/run that at install time.
By leaving the script dir's Makefile in place, a user can still opt to
run make install manually in there.
Steve Holme [Sun, 27 Mar 2016 16:58:50 +0000 (17:58 +0100)]
http_ntlm: Renamed from curl_ntlm.[c|h]
Renamed the header and source files for this module as they are HTTP
specific and as such, they should use the naming convention as other
HTTP authentication source files do - this revert commit 260ee6b7bf.
Note: We could also rename curl_ntlm_wb.[c|h], however, the Winbind
code needs separating from the HTTP protocol and migrating into the
vauth directory, thus adding support for Winbind to the SASL based
protocols such as IMAP, POP3 and SMTP.
Karlson2k [Mon, 22 Feb 2016 09:30:37 +0000 (12:30 +0300)]
sshserver.pl: use quotes for given options
Fixed failed redirection of stderr with some options. At least on Msys2,
perl fails to redirect stderr if $value contains newline or other weird
characters.
Jay Satiro [Sat, 26 Mar 2016 18:41:35 +0000 (14:41 -0400)]
url: don't use bad offset in tld_check_name to show error
libidn's tld_check_lz returns an error offset of the first character
that it failed to process, however that offset is not a byte offset and
may not even be in the locale encoding therefore we can't use it to show
the user the character that failed to process.
Steve Holme [Sun, 13 Mar 2016 20:09:15 +0000 (20:09 +0000)]
http_negotiate: Combine GSS-API and SSPI source files
As the GSS-API and SSPI based source files are no longer library/API
specific, following the extraction of that authentication code to the
vauth directory, combine these files rather than maintain two separate
versions.
Steve Holme [Sat, 26 Mar 2016 11:35:07 +0000 (11:35 +0000)]
warnless.h: Removed spurious character from commit 696bc6b9c9
Not picked up by checksrc or Visual Studio but my own code review, this
would haven broken Intel based Unix builds - Perhaps I should learn to
type on my laptop's keyboard before committing!
Steve Holme [Sat, 12 Sep 2015 10:14:14 +0000 (11:14 +0100)]
build: Updated all makefiles and project files for the new vauth directory
Updated the makefiles and Visual Studio project files to support moving
the authentication code to the new lib/vauth directory that was started
in commit 0d04e859e1.