Daniel Stenberg [Sun, 21 Dec 2014 22:21:16 +0000 (23:21 +0100)]
smb: use memcpy() instead of strncpy()
... as it never copies the trailing zero anyway and always just the four
bytes so let's not mislead anyone into thinking it is actually treated
as a string.
generate_config_vms_h_curl.com :
* VAX does not support 64 bit ints, so no NTLM support for now.
* VAX HP SSL port is ancient, needs some help.
* Disable NGHTTP2 for now, not ported to VMS.
* Disable UNIX_SOCKETS, not available on VMS yet.
* HP GSSAPI port does not have gss_nt_service_name.
gnv_link_curl.com : Update for new curl structure.
pcsi_product_gnv_curl.com : Set up to optionally do a complete build.
Steve Holme [Fri, 19 Dec 2014 20:41:47 +0000 (20:41 +0000)]
non-ascii: Reduce variable usage
Removed 'next' variable in Curl_convert_form(). Rather than setting it
from 'form->next' and using that to set 'form' after the conversion
just use 'form = form->next' instead.
Patrick Monnerat [Tue, 16 Dec 2014 12:29:01 +0000 (13:29 +0100)]
IPV6: address scope != scope id
There was a confusion between these: this commit tries to disambiguate them.
- Scope can be computed from the address itself.
- Scope id is scope dependent: it is currently defined as 1-based local
interface index for link-local scoped addresses, and as a site index(?) for
(obsolete) site-local addresses. Linux only supports it for link-local
addresses.
The URL parser properly parses a scope id as an interface index, but stores it
in a field named "scope": confusion. The field has been renamed into "scope_id".
Curl_if2ip() used the scope id as it was a scope. This caused failures
to bind to an interface.
Scope is now computed from the addresses and Curl_if2ip() matches them.
If redundantly specified in the URL, scope id is check for mismatch with
the interface index.
Daniel Stenberg [Tue, 16 Dec 2014 00:00:23 +0000 (01:00 +0100)]
tool_urlglob: unify return codes to use CURLcode
There was a mix of GlobCode, CURLcode and ints and they were mostly
passing around CURLcode errors. This change makes the functions use only
CURLcode and removes the GlobCode type completely.
Daniel Stenberg [Sun, 14 Dec 2014 22:32:53 +0000 (23:32 +0100)]
tool_urlglob.c: reverse two loops
By counting from 0 and up instead of backwards like before, we remove
the need for the "funny" check of the unsigned variable when decreased
passed zero. Easier to read and less risk for compiler warnings.
The >= 0 is actually not required, since i underflows and
the for-loop is stopped using the < condition, but this
makes the VS2012 compiler and code analysis happy.
Marc Hoersken [Sun, 14 Dec 2014 16:27:20 +0000 (17:27 +0100)]
curl_schannel: Improvements to memory re-allocation strategy
- do not grow memory by doubling its size
- do not leak previously allocated memory if reallocation fails
- replace while-loop with a single check to make sure
that the requested amount of data fits into the buffer
Steve Holme [Sun, 14 Dec 2014 12:27:57 +0000 (12:27 +0000)]
smb: Fixed unnecessary initialisation of struct member variables
There is no need to set the 'state' and 'result' member variables to
SMB_REQUESTING (0) and CURLE_OK (0) after the allocation via calloc()
as calloc() initialises the contents to zero.
Steve Holme [Sun, 14 Dec 2014 11:45:14 +0000 (11:45 +0000)]
ntlm: Remove unnecessary casts in readshort_le()
I don't think both of my fix ups from yesterday were needed to fix the
compilation warning, so remove the one that I think is unnecessary and
let the next Android autobuild prove/disprove it.
Guenter Knauf [Sat, 13 Dec 2014 12:29:59 +0000 (13:29 +0100)]
synctime.c: fixed timeserver URLs.
For getting the date header its not necessary to access special
pages or even CGI scripts - all pages including the main index
reply with the date header, therefore shortened URLs to domain.
Removed worldtime.com; added pool.ntp.org.
Steve Holme [Fri, 12 Dec 2014 22:57:31 +0000 (22:57 +0000)]
smtp.c: Fixed compilation warnings
smtp.c:2357 warning: adding 'size_t' (aka 'unsigned long') to a string
does not append to the string
smtp.c:2375 warning: adding 'size_t' (aka 'unsigned long') to a string
does not append to the string
smtp.c:2386 warning: adding 'size_t' (aka 'unsigned long') to a string
does not append to the string
Steve Holme [Fri, 12 Dec 2014 21:57:59 +0000 (21:57 +0000)]
ntlm: Disable NTLM v2 when 64-bit integers are not supported
This fixes compilation issues with compilers that don't support 64-bit
integers through long long or __int64 which was introduced in commit 07b66cbfa4.
Steve Holme [Fri, 12 Dec 2014 21:40:09 +0000 (21:40 +0000)]
ntlm: Allow NTLM2Session messages when USE_NTRESPONSES manually defined
Previously USE_NTLM2SESSION would only be defined automatically when
USE_NTRESPONSES wasn't already defined. Separated the two definitions
so that the user can manually set USE_NTRESPONSES themselves but
USE_NTLM2SESSION is defined automatically if they don't define it.
Steve Holme [Fri, 12 Dec 2014 19:46:56 +0000 (19:46 +0000)]
config-win32.h: Don't enable Windows Crypt API if using OpenSSL
As the OpenSSL and NSS Crypto engines are prefered by the core NTLM
routines, to the Windows Crypt API, don't define USE_WIN32_CRYPT
automatically when either OpenSSL or NSS are in use - doing so would
disable NTLM2Session responses in NTLM type-3 messages.
Steve Holme [Fri, 12 Dec 2014 18:55:16 +0000 (18:55 +0000)]
smtp: Fixed inappropriate free of the scratch buffer
If the scratch buffer was allocated in a previous call to
Curl_smtp_escape_eob(), a new buffer not allocated in the subsequent
call and no action taken by that call, then an attempt would be made to
try and free the buffer which, by now, would be part of the data->state
structure.
Steve Holme [Fri, 12 Dec 2014 18:37:06 +0000 (18:37 +0000)]
smtp: Fixed dot stuffing when EOL characters were at end of input buffers
Fixed a problem with the CRLF. detection when multiple buffers were
used to upload an email to libcurl and the line ending character(s)
appeared at the end of each buffer. This meant any lines which started
with . would not be escaped into .. and could be interpreted as the end
of transmission string instead.
This only affected libcurl based applications that used a read function
and wasn't reproducible with the curl command-line tool.
Bug: http://curl.haxx.se/bug/view.cgi?id=1456 Assisted-by: Patrick Monnerat
Dan Fandrich [Sun, 7 Dec 2014 11:24:29 +0000 (12:24 +0100)]
cookies: Improved OOM handling in cookies
This fixes the test 506 torture test. The internal cookie API really
ought to be improved to separate cookie parsing errors (which may be
ignored) with OOM errors (which should be fatal).
Guenter Knauf [Tue, 9 Dec 2014 17:18:40 +0000 (18:18 +0100)]
synctime.c: fixed user-agent setting.
Some websites meanwhile refuse to reply to requests from ancient
browsers like IE6, therefore I've comment out this setting, but
also fixed the string to now fake IE8 if someone enables it.
Steve Holme [Sun, 7 Dec 2014 20:44:57 +0000 (20:44 +0000)]
smb: Fixed Windows autoconf builds following commit eb88d778e7
As Windows based autoconf builds don't yet define USE_WIN32_CRYPTO
either explicitly through --enable-win32-cypto or automatically on
_WIN32 based platforms, subsequent builds broke with the following
error message:
"Can't compile NTLM support without a crypto library."