1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

7848 Commits

Author SHA1 Message Date
Bill Nagel
02d2c0a08d smb: Added initial SMB functionality
Initial implementation of the SMB/CIFS protocol.
2014-11-30 18:01:15 +00:00
Bill Nagel
aec2e865f0 smb: Added SMB handler interfaces
Added the SMB and SMBS handler interface structures and associated
functions required for SMB/CIFS operation.
2014-11-30 15:56:30 +00:00
Steve Holme
56120ca04b transfer: Code style policing
Prefer ! rather than NULL in if statements, added comments and updated
function spacing, argument spacing and line spacing to be more readble.
2014-11-30 15:06:16 +00:00
Steve Holme
785d76d681 transfer: Fixed existing scratch buffer being checked for NULL twice
If the scratch buffer already existed when the CRLF conversion was
performed then the buffer pointer would be checked twice for NULL. This
second check is only necessary if the call to malloc() was performed by
the first check.
2014-11-30 15:06:13 +00:00
Steve Holme
9afd97022e smtp: Fixed dot stuffing being performed when no new data read
Whilst I had moved the dot stuffing code from being performed before
CRLF conversion takes place to after it, in commit 4bd860a001, I had
moved it outside the 'when something read' block of code when meant
it could perform the dot stuffing twice on partial send if nread
happened to contain the right values. It also meant the function could
potentially read past the end of buffer. This was highlighted by the
following warning:

warning: `nread' might be used uninitialized in this function
2014-11-30 14:24:35 +00:00
Daniel Stenberg
5409f32984 smb.h: fixed picky compiler warning
smb.h:30:16: error: comma at end of enumerator list [-Werror=pedantic]
2014-11-29 23:06:04 +01:00
Bill Nagel
557658776f smb: Added SMB protocol and port definitions
Added the necessary protocol and port definitions in order to support
SMB/CIFS.
2014-11-29 21:26:40 +00:00
Bill Nagel
0627c48dde smb: Added internal SMB definitions and structures
Added the internal definitions and structures necessary for SMB/CIFS
support.
2014-11-29 20:32:34 +00:00
Bill Nagel
7c00ba10da smb: Added SMB connection structure
Added the connection structure that will be required in urldata.h for
SMB/CIFS based connections.
2014-11-29 20:16:51 +00:00
Bill Nagel
e80d9d5902 smb: Added initial source files for SMB
Added the initial source files and updated the relevant project files in
order to support SMB/CIFS.
2014-11-29 18:10:41 +00:00
Steve Holme
93e080cbaa http.c: Fixed compilation warnings from features being disabled
warning: unused variable 'data'
warning: variable 'addcookies' set but not used

...and some very minor coding style policing.
2014-11-27 22:29:31 +00:00
Steve Holme
854049f962 smtp: Fixed const'ness of nread parameter in Curl_smtp_escape_eob()
...and some comment typos!
2014-11-26 23:31:57 +00:00
Steve Holme
4bd860a001 smtp: Added support for the conversion of Unix newlines during mail send
Added support for the automatic conversion of Unix newlines to CRLF
during mail uploads.

Feature: http://curl.haxx.se/bug/view.cgi?id=1456
2014-11-26 23:31:54 +00:00
Daniel Stenberg
700843d69f select.c: fix compilation for VxWorks
Reported-by: Brian
Bug: http://curl.haxx.se/bug/view.cgi?id=1455
2014-11-25 08:55:17 +01:00
be1a505189 SSL: Add PEM format support for public key pinning 2014-11-24 19:30:09 +01:00
Steve Holme
53e2e4c721 multi.c: Fixed compilation warnings when no verbose string support
warning: variable 'connection_id' set but not used
warning: unused parameter 'lineno'
2014-11-23 19:51:24 +00:00
Steve Holme
1450712e76 sasl: Tidied up some parameter comments 2014-11-23 16:50:15 +00:00
Steve Holme
bfdef6301c sasl: Reduced the need for two sets of NTLM functions 2014-11-23 16:45:30 +00:00
Steve Holme
33be9e29be ntlm: Moved NSS initialisation to base decode function 2014-11-23 16:07:59 +00:00
Steve Holme
8ed2420dbb http_ntlm: Fixed additional NSS initialisation call when decoding type-2
After commit 48d19acb7c the HTTP code would call Curl_nss_force_init()
twice when decoding a NTLM type-2 message, once directly and the other
through the call to Curl_sasl_decode_ntlm_type2_message().
2014-11-23 16:05:08 +00:00
Steve Holme
409265a571 ntlm: Fixed static'ness of local decode function 2014-11-23 10:38:54 +00:00
Steve Holme
885119bf50 ntlm: Corrected some parameter names and comments 2014-11-23 10:38:35 +00:00
Daniel Stenberg
d62706ec6d http.c: log if it notices HTTP 1.1 after a upgrade to http2 2014-11-20 23:33:34 +01:00
Tatsuhiro Tsujikawa
7d1f2ac769 http: Disable pipelining for HTTP/2 and upgraded connections
This commit disables pipelining for HTTP/2 or upgraded connections.  For
HTTP/2, we do not support multiplexing.  In general, requests cannot be
pipelined in an upgraded connection, since it is now different protocol.
2014-11-20 14:41:17 +01:00
Steve Holme
34cb17b930 conncache: Fixed specifiers in infof() for long and size_t variables 2014-11-19 20:04:21 +00:00
Jon Spencer
2933698677 multi: inform about closed sockets before they are closed
When the connection code decides to close a socket it informs the multi
system via the Curl_multi_closed function. The multi system may, in
turn, invoke the CURLMOPT_SOCKETFUNCTION function with
CURL_POLL_REMOVE. This happens after the socket has already been
closed. Reorder the code so that CURL_POLL_REMOVE is called before the
socket is closed.
2014-11-19 13:22:07 +01:00
Guenter Knauf
cf510ad781 build: in Makefile.m32 moved target autodetection.
Moved target autodetection block after defining CC macro.
2014-11-19 12:39:20 +01:00
Guenter Knauf
140ca2dcc2 build: in Makefile.m32 simplify platform flags. 2014-11-19 11:46:02 +01:00
Guenter Knauf
a08decdfed build: in Makefile.m32 try to detect 64bit target. 2014-11-19 11:40:04 +01:00
Carlo Wood
013d5c18c3 debug: added new connection cache output, plus fixups
Debug output 'typo' fix.

Don't print an extra "0x" in
  * Pipe broke: handle 0x0x2546d88, url = /

Add debug output.
Print the number of connections in the connection cache when
  adding one, and not only when one is removed.

Fix typos in comments.
2014-11-18 23:02:40 +01:00
Daniel Stenberg
b77ff4d589 multi: move the ending condition into the loop as well
... as it was before I changed the loop in commit e04ccbd50. It caused
test 2030 and 2032 to fail.
2014-11-18 22:57:22 +01:00
Steve Holme
36f7b399de multi: Prefer we don't use CURLE_OK and NULL in comparisons 2014-11-18 20:25:05 +00:00
Daniel Stenberg
c068284882 multi_runsingle: use 'result' for local CURLcode storage
... and assign data->result only at the end. Makes the code more compact
(easier to read) and more similar to other code.
2014-11-18 15:18:21 +01:00
Daniel Stenberg
e05f801271 multi_runsingle: rename result to rc
save 'result' for CURLcode types
2014-11-18 14:47:15 +01:00
Daniel Stenberg
e04ccbd506 multi: make multi_runsingle loop internally
simplifies the use of this function at little cost.
2014-11-18 14:47:15 +01:00
Carlo Wood
1342a96ecf multi: when leaving for timeout, close accordingly
Fixes the problem when a transfer in a pipeline times out.
2014-11-18 14:47:15 +01:00
Guenter Knauf
4bc47bec57 build: in Makefile.m32 add -m32 flag for 32bit. 2014-11-18 14:25:41 +01:00
Guenter Knauf
e126ec4fc4 mk-ca-bundle.vbs: update copyright year. 2014-11-18 13:47:13 +01:00
Guenter Knauf
46ae340f24 build: in Makefile.m32 pass -F flag to windres. 2014-11-18 13:44:03 +01:00
Steve Holme
6cc79dc79d config-win32: Fixed build targets for the VS2012+ Windows XP toolset
Even though commit 23e70e1cc6 mentioned the v110_xp toolset, I had
forgotten to include the relevant pre-processor definitions.
2014-11-17 23:49:05 +00:00
Steve Holme
62a6230e1c sasl_sspi: Removed note about the NTLM functions being a wrapper 2014-11-16 22:49:30 +00:00
Steve Holme
43da5b2066 connect.c: Fixed compilation warning when no verbose string support
warning: unused parameter 'reason'
2014-11-16 18:21:12 +00:00
Steve Holme
591d5ca41b easy.c: Fixed compilation warning when no verbose string support
warning: unused parameter 'easy'
2014-11-16 18:21:03 +00:00
Steve Holme
4be80d5109 win32: Updated some legacy APIs to use the newer extended versions
Updated the usage of some legacy APIs, that are preventing curl from
compiling for Windows Store and Windows Phone build targets.

Suggested-by: Stefan Neis
Feature: http://sourceforge.net/p/curl/feature-requests/82/
2014-11-16 17:30:17 +00:00
Steve Holme
23e70e1cc6 config-win32: Introduce build targets for VS2012+
Visual Studio 2012 introduced support for Windows Store apps as well as
supporting Windows Phone 8. Introduced build targets that allow more
modern APIs to be used as certain legacy ones are not available on these
new platforms.
2014-11-16 17:24:48 +00:00
Steve Holme
800094802e sasl_sspi: Fixed compilation warnings when no verbose string support 2014-11-16 14:52:27 +00:00
Steve Holme
9669794e7a sasl_sspi: Added base64 decoding debug failure messages
Just like in the NTLM code, added infof() failure messages for
DIGEST-MD5 and GSSAPI authentication when base64 decoding fails.
2014-11-16 14:35:51 +00:00
Steve Holme
30892709d7 ntlm: Moved the SSPI based Type-3 message generation into the SASL module 2014-11-16 14:16:07 +00:00
Steve Holme
a3fead9706 ntlm: Moved the SSPI based Type-2 message decoding into the SASL module 2014-11-16 13:59:11 +00:00
Steve Holme
201d0df50b ntlm: Moved the SSPI based Type-1 message generation into the SASL module 2014-11-16 13:39:13 +00:00
Michael Osipov
9f10e45e42 kerberos: Use symbol qualified with _KERBEROS5
For consistency renamed USE_KRB5 to USE_KERBEROS5.
2014-11-16 13:29:04 +00:00
Tatsuhiro Tsujikawa
ed77fdf389 http2: Don't send Upgrade headers when we already do HTTP/2 2014-11-15 21:00:23 +01:00
Steve Holme
08f9c90981 sasl: Corrected Curl_sasl_build_spn() function description
There was a mismatch in function parameter names.
2014-11-15 18:35:40 +00:00
Steve Holme
2e16100609 urldata: Don't define sec_complete when no GSS-API support present
This variable is only used with HAVE_GSSAPI is defined by the FTP code
so let's place the definition with the other GSS-API based variables.
2014-11-15 13:15:02 +00:00
Michael Osipov
d54b551f6c docs: Use consistent naming for Kerberos 2014-11-15 13:10:45 +00:00
Steve Holme
cca12abf6e sasl_sspi: Corrected a couple of comment typos 2014-11-14 23:27:19 +00:00
Steve Holme
18e53fa91a sasl: Moved Curl_sasl_gssapi_cleanup() definition into header file
Rather than define the function as extern in the source files that use
it, moved the function declaration into the SASL header file just like
the Digest and NTLM clean-up functions.

Additionally, added a function description comment block.
2014-11-14 22:11:48 +00:00
Steve Holme
8c58dea899 sasl_sspi: Added missing RFC reference for HTTP Digest authentication 2014-11-14 22:03:27 +00:00
Steve Holme
9dfbcef272 ntlm: Clean-up and standardisation of base64 decoding 2014-11-14 22:02:06 +00:00
Steve Holme
7faaca7118 ntlm: We prefer 'CURLcode result' 2014-11-14 22:00:04 +00:00
Daniel Stenberg
2ee3c63b13 http2: fix switched macro when http2 is not enabled 2014-11-13 15:39:15 +01:00
Tatsuhiro Tsujikawa
7b7f0da4a7 http2: Deal with HTTP/2 data inside response header buffer
Previously if HTTP/2 traffic is appended to HTTP Upgrade response header
(thus they are in the same buffer), the trailing HTTP/2 traffic is not
processed and lost.  The appended data is most likely SETTINGS frame.
If it is lost, nghttp2 library complains server does not obey the HTTP/2
protocol and issues GOAWAY frame and curl eventually drops connection.
This commit fixes this problem and now trailing data is processed.
2014-11-13 15:38:12 +01:00
Daniel Stenberg
f64dbb08c2 multi: removed Curl_multi_set_easy_connection
It isn't used anywhere!

Reported-by: Carlo Wood
2014-11-10 10:09:40 +01:00
Peter Wu
17d27805f9 cmake: add ENABLE_THREADED_RESOLVER, rename ARES
Fix detection of the AsynchDNS feature which not just depends on
pthreads support, but also on whether USE_POSIX_THREADS is set or not.
Caught by test 1014.

This patch adds a new ENABLE_THREADED_RESOLVER option (corresponding to
--enable-threaded-resolver of autotools) which also needs a check for
HAVE_PTHREAD_H.

For symmetry with autotools, CURL_USE_ARES is renamed to ENABLE_ARES
(--enable-ares). Checks that test for the availability actually use
USE_ARES instead as that is the result of whether a-res is available or
not (in practice this does not matter as CARES is marked as required
package, but nevertheless it is better to write the intent).

Signed-off-by: Peter Wu <peter@lekensteyn.nl>
2014-11-10 09:09:25 +01:00
Steve Holme
bfc63bfb19 vtls.h: Fixed compiler warning when compiled without SSL
vtls.c:185:46: warning: unused parameter 'data'
2014-11-09 18:09:58 +00:00
Steve Holme
2fbf23875f ntlm: Added separate SSPI based functions
In preparation for moving the NTLM message code into the SASL module,
and separating the native code from the SSPI code, added functions that
simply call the functions in curl_ntlm_msg.c.
2014-11-09 15:12:35 +00:00
Steve Holme
48d19acb7c http_ntlm: Use the SASL functions instead
In preparation for moving the NTLM message code into the SASL module
use the SASL functions in the HTTP code instead.
2014-11-09 14:58:20 +00:00
Daniel Stenberg
9dbbba9976 libssh2: detect features based on version, not configure checks
... so that non-configure builds get the correct functions too based on
the libssh2 version used.
2014-11-09 15:43:27 +01:00
Nobuhiro Ban
18e1a3022d SSH: use the port number as well for known_known checks
... if the libssh2 version is new enough.

Bug: http://curl.haxx.se/bug/view.cgi?id=1448
2014-11-09 15:43:27 +01:00
Steve Holme
520dc64369 build: Fixed no NTLM support for email when CURL_DISABLE_HTTP is defined
USE_NTLM would only be defined if: HTTP support was enabled, NTLM and
cryptography weren't disabled, and either a supporting cryptography
library or Windows SSPI was being compiled against.

This means it was not possible to build libcurl without HTTP support
and use NTLM for other protocols such as IMAP, POP3 and SMTP. Rather
than introduce a new SASL pre-processor definition, removed the HTTP
prerequisite just like USE_SPNEGO and USE_KRB5.

Note: Winbind support still needs to be dependent on CURL_DISABLE_HTTP
as it is only available to HTTP at present.

This bug dates back to August 2011 when I started to add support for
NTLM to SMTP.
2014-11-09 12:54:34 +00:00
Steve Holme
8145f92dcc ntlm: Removed an unnecessary free of native Target Info
Due to commit 40ee1ba0dc the free in Curl_ntlm_decode_type2_target() is
longer required.
2014-11-09 11:54:50 +00:00
Steve Holme
40ee1ba0dc ntlm: Moved the native Target Info clean-up from HTTP specific function 2014-11-09 11:47:40 +00:00
Steve Holme
474442dd56 ntlm: Moved SSPI clean-up code into SASL module 2014-11-09 11:10:34 +00:00
Steve Holme
dc867bbf3a Makefile.vc6: Added support for WinIDN 2014-11-08 18:31:29 +00:00
Steve Holme
7599143dcc version info: Added Kerberos V5 to the supported features 2014-11-07 10:55:14 +00:00
Guenter Knauf
f28c856e33 mk-ca-bundle.vbs: switch to new certdata.txt url. 2014-11-07 10:27:26 +01:00
Steve Holme
dcad09e125 http_digest: Fixed some memory leaks introduced in commit 6f8d8131b1
Fixed a couple of memory leaks as a result of moving code that used to
populate allocuserpwd and relied on it's clean up.
2014-11-07 00:11:20 +00:00
Steve Holme
0a925d7834 sasl_sspi: Tidy up of the existing digest code
Following the addition of SSPI support for HTTP digest, synchronised
elements of the email digest code with that of the new HTTP code.
2014-11-06 23:26:27 +00:00
Steve Holme
70100d5509 http_digest: Post SSPI support tidy up
Post tidy up to ensure commonality of code style and variable names.
2014-11-06 23:15:24 +00:00
Steve Holme
cfe4252744 http_digest: Fixed auth retry loop when SSPI based authentication fails 2014-11-06 15:27:27 +00:00
Steve Holme
500d2db302 http_digest: Reworked the SSPI based input token storage
Reworked the input token (challenge message) storage as what is passed
to the buf and desc in the response generation are typically blobs of
data rather than strings, so this is more in keeping with other areas
of the SSPI code, such as the NTLM message functions.
2014-11-06 14:59:53 +00:00
Steve Holme
6d45f952e6 sasl_sspi: Fixed compilation warning from commit 2d2a62e3d9
Added void reference to unused 'data' parameter back to fix compilation
warning.
2014-11-06 13:32:04 +00:00
Steve Holme
3aa0e57ce6 sspi: Align definition values to even columns as we use 2 char spacing 2014-11-06 13:09:48 +00:00
Steve Holme
a10976b961 sspi: Fixed missing definition of ISC_REQ_USE_HTTP_STYLE
Some versions of Microsoft's sspi.h don't define this.
2014-11-06 13:04:24 +00:00
Steve Holme
93859e2c9a sasl: Removed non-SSPI Digest functions and defines from SSPI based builds
Introduced in commit 7e6d51a73c these functions and definitions are only
required by the internal challenge-response functions now.
2014-11-06 12:37:59 +00:00
Steve Holme
2d2a62e3d9 sasl_sspi: Added HTTP digest response generation code 2014-11-06 12:07:04 +00:00
Steve Holme
f0d3be29f2 http_digest: Added SSPI based challenge decoding code 2014-11-06 11:53:02 +00:00
Steve Holme
21fa0d86b1 http_digest: Added SSPI based clean-up code 2014-11-06 11:36:55 +00:00
Steve Holme
3d6b865654 http_digest: Added SSPI based authentication functions
This temporarily breaks HTTP digest authentication in SSPI based builds,
causing CURLE_NOT_BUILT_IN to be returned. A follow up commit will
resume normal operation.
2014-11-06 11:10:10 +00:00
Steve Holme
1033acd92d http_digest: Added required SSPI based variables to digest structure 2014-11-06 11:10:08 +00:00
Steve Holme
783c7f97ba http_digest: Fixed memory leaks from commit 6f8d8131b1 2014-11-05 21:45:10 +00:00
Steve Holme
f4af38120a sasl: Fixed compilation warning from commit 25264131e2
Added forward declaration of digestdata to overcome the following
compilation warning:

warning: 'struct digestdata' declared inside parameter list

Additionally made the ntlmdata forward declaration dependent on
USE_NTLM similar to how digestdata and kerberosdata are.
2014-11-05 18:36:57 +00:00
Steve Holme
259f4f3d01 sasl: Fixed HTTP digest challenges with spaces between auth parameters
Broken as part of the rework, in commit 7e6d51a73c, to assist with the
addition of HTTP digest via Windows SSPI.
2014-11-05 17:58:07 +00:00
Steve Holme
f697d7fdd5 http_digest: Fixed compilation errors from commit 6f8d8131b1
error: invalid operands to binary
warning: pointer targets in assignment differ in signedness
2014-11-05 15:48:19 +00:00
Steve Holme
6f8d8131b1 http_digest: Moved response generation into SASL module 2014-11-05 15:33:21 +00:00
Steve Holme
7e6d51a73c http_digest: Moved challenge decoding into SASL module 2014-11-05 14:39:13 +00:00
Steve Holme
25264131e2 http_digest: Moved clean-up function into SASL module 2014-11-05 13:51:11 +00:00
Steve Holme
d7bfce3951 http_digest: Moved algorithm definitions to SASL module 2014-11-05 13:40:08 +00:00
Gisle Vanem
3cfe3bc001 ssh: Fixed build on platforms where R_OK is not defined
Bug: http://curl.haxx.se/mail/lib-2014-11/0035.html
Reported-by: Jan Ehrhardt
2014-11-05 13:09:08 +00:00
Steve Holme
92e7e346f3 strdup: Removed irrelevant comment
...as Curl_memdup() duplicates an area of fix size memory, that may be
binary, and not a null terminated string.
2014-11-05 12:53:06 +00:00