Commit Graph

5708 Commits

Author SHA1 Message Date
Steve Holme 006b011cdf http NTLM: remaining bits from 0001-Moved-ntlm-[...]-curl_ntlm-mod_3.patch
* Added function comments:
    - Curl_ntlm_decode_type2_message
    - Curl_ntlm_create_type1_message
    - Curl_ntlm_create_type3_message

* Modification of ntlm processing state to NTLMSTATE_TYPE2 is now done
  only when Curl_ntlm_decode_type2_message() has fully succeeded.
2011-08-22 16:42:59 +02:00
Yang Tse 1c400b4e5e zlib: ensure user provided memory functions are used by zlib, when given
As a bonus, this lets our MemoryTracking subsystem track zlib operations.
And also fixes a shortcut some zlib 1.2.x versions took using malloc()
instead of calloc(), which would trigger memory debuggers warnings on
memory being used without having been initialized.
2011-08-21 13:24:46 +02:00
Yang Tse aaab5fa299 MemoryTracking: adjust initialization calling
Calling of curl_memdebug() was still done with a pending free()
2011-08-20 17:26:42 +02:00
Daniel Stenberg 2d7c79af76 tcpconnect: follow-up commit after b998d95b
As I modified conn->bits.tcpconnect to become an array that holds one
bool for each potential connection all uses of that struct field must
index it correctly.
2011-08-19 23:39:56 +02:00
Yang Tse 38c5e81a67 ssh.c: add PATH_MAX definition for WIN32 2011-08-19 21:25:39 +02:00
Daniel Stenberg 3af9ba166c connect: set TIMER_CONNECT
When connecting, make sure TIMER_CONNECT is set.
2011-08-19 00:16:01 +02:00
Daniel Stenberg b998d95b4d FTP: fix proxy connect race condition
When using the multi interface, a SOCKS proxy, and a connection that
wouldn't immediately consider itself connected (which my Linux tests do
by default), libcurl would be tricked into doing _two_ connects to the
SOCKS proxy when it setup the data connection and then of course the
second attempt would fail miserably and cause error.

This problem is a regression that was introduced by commit
4a42e5cdaa that was introduced in the 7.21.7 release.

Bug: http://curl.haxx.se/mail/lib-2011-08/0199.html
Reported by: Fabian Keil
2011-08-18 23:35:15 +02:00
Daniel Stenberg d44896508c Curl_SOCKS4: minor code compression 2011-08-18 23:28:50 +02:00
Yang Tse 9afb343368 zlib: enforce full initialization of our data space z_stream structs 2011-08-18 20:10:51 +02:00
Daniel Stenberg 1833984664 VC makefiles: fixed variable name mistake 2011-08-17 23:51:37 +02:00
Yang Tse 31a1af5ebb MemoryTracking: adjust curl_domalloc() and curl_dofree() memory filling
Until 2011-08-17 libcurl's Memory Tracking feature also performed
automatic malloc and free filling operations using 0xA5 and 0x13
values. Our own preinitialization of dynamically allocated memory
might be useful when not using third party memory debuggers, but
on the other hand this would fool memory debuggers into thinking
that all dynamically allocated memory is properly initialized.

As a default setting, libcurl's Memory Tracking feature no longer
performs preinitialization of dynamically allocated memory on its
own. If you know what you are doing, and really want to retain old
behavior, you can achieve this compiling with preprocessor symbols
CURL_MT_MALLOC_FILL and CURL_MT_FREE_FILL defined with appropriate
values.
2011-08-17 19:02:42 +02:00
Yang Tse 9710f387c4 MemoryTracking: make curl_docalloc() call calloc() avoiding our zero fill 2011-08-16 22:24:23 +02:00
Daniel Stenberg 4ed7abb537 MSVC makefiles: provide SSH build targets
"release-ssl-ssh2-zlib" and "debug-ssl-ssh2-zlib" are two new makefile
targets that build libcurl with MSVC and link with libssh2

Bug: http://curl.haxx.se/bug/view.cgi?id=3388920
Reported by: "kdekker"
2011-08-15 23:22:06 +02:00
Daniel Stenberg 93ba8b9560 Curl_pgrsStartNow: clear all flags but HIDE
As bug 3385258 pointed out but I missed up the fix for. This is another
take at a fix.

Bug: http://curl.haxx.se/bug/view.cgi?id=3392101
Reported by: Wu Yongzheng
2011-08-15 22:13:18 +02:00
Kamil Dudka d6f319fb64 nss: start with no database if the selected database is broken
Bug: https://bugzilla.redhat.com/728562
2011-08-15 14:44:49 +02:00
Yang Tse b9d5e72adc http NTLM: reinstate "nssg.h" "curl_sspi.h" header inclusions 2011-08-15 01:34:34 +02:00
Daniel Stenberg 44b44a751d telnet: allow programatic use on Windows
Summary of the issue can be found at:
http://curl.haxx.se/mail/lib-2010-04/0367.html

That patch only updated the unix sockets code - the winsock code was not
updated and no longer works the same was as the unix code. This change
updates the windows code accordingly.

Bug: http://curl.haxx.se/bug/view.cgi?id=3163118
2011-08-14 23:30:15 +02:00
Yang Tse e575cbc815 http NTLM: reinstate "memdebug.h" header inclusion
Inclusion of header "memdebug.h" in http_ntlm.c got lost in commit 98fb0ef7.
2011-08-14 21:19:22 +02:00
Daniel Stenberg f0c59c6c2c RTSP: GET_PARAMETER requests have a body
Bug: http://curl.haxx.se/bug/view.cgi?id=3383692
2011-08-14 19:07:54 +02:00
Daniel Stenberg dfb18da5dc Curl_output_ntlm: remove unused variable 2011-08-14 18:54:21 +02:00
Yang Tse dc4f9d185d http NTLM: fix 8 compiler warnings
Strict splitting of http_ntlm.[ch] may trigger 8 compiler warnings when
building with some compilers and strict compiler warnings enabled, depending
on other specific configuration options some could get triggered or not.

Seven are related with 'unused function parameters' and another one with
'var may be used before its value is set'.
2011-08-14 16:36:47 +02:00
Yang Tse 98fb0ef73e http NTLM: split http_ntlm.[ch] between http_ntlm.[ch] and curl_ntlm.[ch]
For modularity purposes, huge chunks of NTLM existing code is transformed into
functions to allow future internal code reuse.

Resulting three new libcurl private functions:

 - Curl_ntlm_create_type1_message()
 - Curl_ntlm_create_type3_message()
 - Curl_ntlm_decode_type2_message()

Changing static ntlm_sspi_cleanup() into non-static Curl_ntlm_sspi_cleanup()

This 'refactoring' has been prepared by previous commits to allow that this
specific one does not introduce any change to existing code. All existing
goodness and badness previous to this commit should remain the same once it is
applied, the only difference should be that existing code is moved into
functions.

Given the quite big portions of code being moved around, and the importance of
change traceability, this commit has been done in such a way that it is
possible to perform a three-way diff from initial http_ntlm.[ch] to resulting
http_ntlm.[ch] and curl_ntlm.[ch] to actually verify that no functional change
is introduced here.

Notice that Steve Holme has provided several patches, but these included this
refactoring along with 'extra' fixes. I really wanted this 'clean' refactoring
done first, in order to allow discussion or committing of 'extra' fixes on a
case by case basis, so, I had to bite the bullet ;-)

Comments, line adjustments, compiler warning fixes, whatever, may follow
afterwards.
2011-08-14 15:45:19 +02:00
Yang Tse 08b05efd20 http_negotiate_sspi.c: fix compiler warning
warning C4706: assignment within conditional expression
2011-08-14 00:05:05 +02:00
Yang Tse b4d6db83de http NTLM: change return type of Curl_input_ntlm() to CURLcode
Remove CURLntlm enum, no longer required.
2011-08-13 23:59:29 +02:00
Daniel Stenberg a30ede868a VC6 makefiles: added embedded documentation
Just a note about the fact that all VC[6/8/9/10] makefiles are generated
from the VC6 one as source.
2011-08-13 22:30:56 +02:00
Daniel Stenberg e40c663d36 Curl_retry_request: check return code!
Curl_readrewind() was called without checking its return code, which
could lead to badness.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
2011-08-13 00:51:16 +02:00
Yang Tse 1e4187f8bf http NTLM: update NTLM type-* message structure descriptions - followup 2011-08-13 00:20:51 +02:00
Yang Tse a472ceb174 http NTLM: fix inclusion of curl_ntlm.h 2011-08-12 22:01:27 +02:00
Yang Tse 092189c664 http NTLM: update NTLM message structure notes 2011-08-12 21:13:01 +02:00
Steve Holme 301e907aed http NTLM: move portions of http_ntlm.h into new curl_ntlm.h 2011-08-12 20:02:01 +02:00
Yang Tse 3293150da2 http NTLM: more adjustments in preparation of code refactoring
Use preprocessor symbol NTLM_BUFSIZE to define private NTLM buffer fixed size.

Use a SessionHandle 'data' pointer variable to ease refactoring.

Update NTLM type-* message structure descriptions.

Fix some more spacing and typos (Steve Holme).
2011-08-12 19:51:50 +02:00
Yang Tse 448f982d54 http NTLM: fix compiler warning 2011-08-11 09:06:06 +02:00
Steve Holme f396d94736 http NTLM: Tidied up more inconsistent spacing.
Moved NTLMSSP_SIGNATURE, HOSTNAME_MAX, SHORTPAIR and LONGQUARTET definitions in ready for move to curl_ntlm.c.

Used separate variables for Windows SSPI and native code to ease moving of code to curl_ntlm.c.

Fixed typographical erros where SPPI should be SSPI.

Fixed compilation warnings on 64-bit builds when calling Windows SSPI functions.
2011-08-11 02:18:16 +02:00
Yang Tse c7fb556f26 http NTLM: Further tiding up to libcurl standards 2011-08-09 22:57:22 +02:00
Steve Holme 5ed17de326 http NTLM: Tidied up http_ntlm prior to splitting the ntlm specific code 2011-08-09 22:57:22 +02:00
Daniel Stenberg 7c21c1c4f9 cookie parser: handle 'secure='
There are two keywords in cookie headers that don't follow the regular
name=value style: secure and httponly. Still we must support that they
are written like 'secure=' and then treat them as if they were written
'secure'. Test case 31 was much extended by Rob Ward to test this.

Bug: http://curl.haxx.se/bug/view.cgi?id=3349227
Reported by: "gnombat"
2011-08-09 14:02:05 +02:00
Daniel Stenberg 45d883d88d CURLFORM_BUFFER: insert filename as documented
A regression where CURLFORM_BUFFER stopped to properly insert the file
name part in the formpart. Bug introduced in commit f851f76857.

Added CURLFORM_BUFFER use to test 554 to verify this.

Bug: http://curl.haxx.se/mail/lib-2011-07/0176.html
Reported by: Henry Ludemann
2011-08-08 18:45:03 +02:00
Daniel Stenberg 3dcc0df5cc SOCKS: fix the connect timeout
The connect timeout logic when using SOCKS was done wrong

Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html
Reported by: "Spoon Man"
2011-08-08 11:23:31 +02:00
Daniel Stenberg da3ae20da5 ftp_doing: bail out on error properly
When a failure has been detected we must abort immdiately.

Bug: http://curl.haxx.se/mail/lib-2011-07/0177.html
Reported by: "Spoon Man"
2011-08-08 10:43:09 +02:00
Cristian Rodríguez 3d919440c8 OpenSSL: Use SSL_MODE_RELEASE_BUFFERS if available, reduces memory use
See also :
http://www.openssl.org/docs/ssl/SSL_CTX_set_mode.html
http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html

Signed-off-by: Cristian Rodríguez <crrodriguez@opensuse.org>
2011-08-07 22:58:31 +02:00
Daniel Stenberg 15379f0614 Curl_pgrsStartNow: clear all bits except HIDE
Bug: http://curl.haxx.se/bug/view.cgi?id=3385258
Reported by: Ben Winslow
2011-08-07 22:26:57 +02:00
Daniel Stenberg f2a6373629 readwrite_data: improved C-E decoding error message 2011-08-07 19:55:23 +02:00
Yang Tse 2ccffbb37e BSD-style lwIP TCP/IP stack support - followup
lwIP library initialization.
2011-08-07 08:45:57 +02:00
Yang Tse 1db023d3cb NTLM single-sign on adjustments (IX)
Use swrite/sread instead of write/read to avoid SIGPIPE
2011-08-07 03:05:04 +02:00
Yang Tse 91ad42412f config-win32.h: comments adjustments 2011-08-06 19:18:43 +02:00
Christian Hägele 704dc18440 asyn-thread: check for dotted addresses before thread starts 2011-08-06 15:21:42 +02:00
Yang Tse 40e1d03c5d checksrc.pl: add quotes to var 2011-08-05 21:24:59 +02:00
Yang Tse c95fec5e5b keep a single copy of config-win32.h in version control repository - followup
Allow configure builds to generate src/config-win32.h

Skip checksrc on src/config-win32.h contents already checked at lib/config-win32.h

Allow multiple -W in checksrc.pl
2011-08-05 21:01:39 +02:00
Yang Tse f6272dd9b8 BSD-style lwIP TCP/IP stack support - followup 2011-08-05 15:53:00 +02:00
Yang Tse f0fae85acd keep a single copy of config-win32.h in version control repository.
maketgz and buildconf.bat updated to reflect this.
2011-08-05 13:20:22 +02:00