Nick Zitzmann [Wed, 13 Nov 2013 02:26:20 +0000 (20:26 -0600)]
darwinssl: check for SSLSetSessionOption() presence when toggling BEAST
Even though this is only a formality (since not many people build on
Mavericks while targeting Leopard), since we still support Leopard
at the earliest, we might as well be pedantic.
Nick Zitzmann [Wed, 13 Nov 2013 02:18:04 +0000 (20:18 -0600)]
darwinssl: PKCS#12 import feature now requires Lion or later
It turns out that some of the constants necessary to make this feature
work are missing from Snow Leopard's Security framework even though
they are defined in the headers.
Steve Holme [Tue, 12 Nov 2013 19:01:04 +0000 (19:01 +0000)]
curl_easy_setopt: Added the ability to set the login options separately
Rather than set the authentication options as part of the login details
specified in the URL, or via the older CURLOPT_USERPWD option, added a
new libcurl option to allow the login options to be set separately.
Björn Stenberg [Mon, 11 Nov 2013 22:43:48 +0000 (23:43 +0100)]
multi: Set read socket when returning READSOCK(0)
This patch fixes and issue introduced in commit 7d7df831981fee, if the
tunnel state was TUNNEL_CONNECT, waitconnect_getsock() would return a
bitmask indicating a readable socket but never stored the socket in the
return array.
As the IMAP regex could fail and $1 would not contain the command id
updated the unrecognised command response to be more generic and
realistic (like those used in the command handlers).
Additionally updated the POP3, SMTP and FTP responses.
Our own printf() replacement clearly can't properly handle %.*s with a
string that isn't zero terminated. Instead of fixing the printf code or
even figuring out what the proper posix behavior is, I reverted this
piece of the code back to the previous version where it does malloc +
memcpy instead.
Regression added in e839446c2a5, released in curl 7.32.0.
Reported-by: Felix Yan
Bug: http://curl.haxx.se/bug/view.cgi?id=1295
Björn Stenberg [Tue, 29 Oct 2013 10:51:25 +0000 (11:51 +0100)]
connect: Add connection delay to Happy Eyeballs.
This patch adds a 200ms delay between the first and second address
family socket connection attempts.
It also iterates over IP addresses in the order returned by the
system, meaning most dual-stack systems will try IPv6 first.
Additionally, it refactors the connect code, removing most code that
handled synchronous connects. Since all sockets are now non-blocking,
the logic can be made simpler.
Steve Holme [Sun, 3 Nov 2013 11:27:12 +0000 (11:27 +0000)]
connect: Fixed "Whut?" no server connection failures
Introduced in commit 7d7df831981fee curl would loop displaying "Whut?"
if it was trying to connect to an address and port that didn't have
anything listening on it.
Steve Holme [Sat, 2 Nov 2013 11:18:39 +0000 (11:18 +0000)]
http: Added proxy tunnel authentication message header value extraction
...following recent changes to Curl_base64_decode() rather than trying
to parse a header line for the authentication mechanisms which is CRLF
terminated and inline zero terminate it.
Steve Holme [Wed, 30 Oct 2013 21:33:28 +0000 (21:33 +0000)]
http: Added authentication message header value extraction
...following recent changes to Curl_base64_decode() rather than trying
to parse a header line for the authentication mechanisms which is CRLF
terminated and inline zero terminate it.
Steve Holme [Wed, 30 Oct 2013 07:31:22 +0000 (07:31 +0000)]
base64: Added basic validation to base64 input string when decoding
A base64 string should be a multiple of 4 characters in length, not
contain any more than 2 padding characters and only contain padding
characters at the end of string. For example: Y3VybA==
Strings such as the following are considered invalid:
Y= - Invalid length
Y== - Invalid length
Y=== - More than two padding characters
Y=x= - Padding character contained within string
Gisle Vanem [Thu, 24 Oct 2013 13:21:16 +0000 (15:21 +0200)]
docs/examples/httpput.c: fix build for MSVC
"Dan Fandrich" <dan@coneharvesters.com> wrote:
>> But I'm not sure <unistd.h> is needed at all.
>
> It's needed for close(2). But the only reason that's needed is because fstat
> is used instead of stat(2); if you fix that, then you could remove that
> include altogether.
Okay. I've tested the following with MSVC and MingW. htttput.c now
simply uses stat():
Björn Stenberg [Sat, 26 Oct 2013 12:17:33 +0000 (14:17 +0200)]
Add "Happy Eyeballs" for IPv4/IPv6.
This patch invokes two socket connect()s nearly simultaneously, and
the socket that is first connected "wins" and is subsequently used for
the connection. The other is terminated.
There is a very slight IPv4 preference, in that if both sockets connect
simultaneously IPv4 is checked first and thus will win.
Steve Holme [Sun, 27 Oct 2013 09:10:38 +0000 (09:10 +0000)]
email: Added initial support for cancelling authentication
Should a client application fail to decode an authentication message
received from a server, or not support any of the parameters given by
the server in the message, then the authentication phrase should be
cancelled gracefully by the client rather than simply terminating the
connection.
The authentication phrase should be cancelled by simply sending a '*'
to the server, in response to erroneous data being received, as per
RFC-3501, RFC-4954 and RFC-5034.
This patch adds the necessary state machine constants and appropriate
response handlers in order to add this functionality for the CRAM-MD5,
DIGEST-MD5 and NTLM authentication mechanisms.
Daniel Stenberg [Sat, 26 Oct 2013 18:19:27 +0000 (20:19 +0200)]
FTP: make the data connection work when going through proxy
This is a regression since the switch to always-multi internally c43127414d89c.
Test 1316 was modified since we now clearly call the Curl_client_write()
function when doing the LIST transfer part and then the
handler->protocol says FTP and ftpc.transfertype is 'A' which implies
text converting even though that the response is initially a HTTP
CONNECT response in this case.
Steve Holme [Sat, 26 Oct 2013 10:09:31 +0000 (11:09 +0100)]
smtp: Fixed response code parsing for bad AUTH continuation responses
This workaround had been previously been implemented for IMAP and POP3
but not SMTP. Some of the recent test case additions implemented this
behaviour to emulate a bad server and the SMTP code didn't cope with it.