Commit Graph

7158 Commits

Author SHA1 Message Date
Steve Holme 84a9f092dc Updated copyright year for recent changes 2014-01-04 17:41:10 +00:00
Marc Hoersken 8fc4abedf1 conncache.c: fix possible dereference of null pointer 2014-01-04 16:34:58 +01:00
Daniel Stenberg 602d28a210 FTP parselist: fix "total" parser
A regression introduced in 7f3b87d878 (present in the 7.21.4 release)
broke the total parser. Now skip the whitespace and the digits.

Reported-by: Justin Maggard
Bug: http://curl.haxx.se/mail/lib-2014-01/0019.html
2014-01-04 00:38:43 +01:00
Marc Hoersken 3b6420c0a5 Makefile.vc6: follow up fix for 11e8066 and 92b9ae5 2014-01-03 16:55:49 +01:00
Daniel Stenberg bf24b64e83 progresscallback: make CURLE_ABORTED_BY_CALLBACK get returned better
When the progress callback returned 1 at a very early state, the code
would not make CURLE_ABORTED_BY_CALLBACK get returned but the process
would still be interrupted. In the HTTP case, this would then cause a
CURLE_GOT_NOTHING to erroneously get returned instead.

Reported-by: Petr Novak
Bug: http://curl.haxx.se/bug/view.cgi?id=1318
2014-01-03 14:09:59 +01:00
Daniel Stenberg 231b23acbb pipeline: remove print_pipeline()
This is a debug function only and serves no purpose in production code,
it only slows things down. I left the code #ifdef'ed for possible future
pipeline debugging.

Also, this was a global function without proper namespace usage.

Reported-by: He Qin
Bug: http://curl.haxx.se/bug/view.cgi?id=1320
2014-01-03 12:04:14 +01:00
Daniel Stenberg 3529162405 openssl: allow explicit sslv2 selection
If OpenSSL is built to support SSLv2 this brings back the ability to
explicitly select that as a protocol level.

Reported-by: Steve Holme
Bug: http://curl.haxx.se/mail/lib-2014-01/0013.html
2014-01-03 11:52:49 +01:00
Steve Holme c50d3ed075 Updated copyright year for recent changes 2014-01-02 23:53:29 +00:00
Marc Hoersken 61288cbdef vtls/nssg.h: fixed include references to moved file 2014-01-03 00:32:05 +01:00
Barry Abrahamson 4bb7400529 OpenSSL: Fix forcing SSLv3 connections
Some feedback provided by byte_bucket on IRC pointed out that commit
db11750cfa wasn’t really correct because it allows for “upgrading” to a
newer protocol when it should be only allowing for SSLv3.

This change fixes that.

When SSLv3 connection is forced, don't allow SSL negotiations for newer
versions.  Feedback provided by byte_bucket in #curl.  This behavior is
also consistent with the other force flags like --tlsv1.1 which doesn't
allow for TLSv1.2 negotiation, etc

Feedback-by: byte_bucket
Bug: http://curl.haxx.se/bug/view.cgi?id=1319
2014-01-02 23:41:33 +01:00
Guenter Knauf 303172d220 Trial to fix the nmake Makefile for vtls files. 2014-01-02 22:16:21 +01:00
Guenter Knauf e9b9e287c1 Fix NetWare build for vtls files. 2014-01-02 20:40:33 +01:00
Barry Abrahamson db11750cfa OpenSSL: Fix forcing SSLv3 connections
Since ad34a2d5c8 (present in 7.34.0 release) forcing
SSLv3 will always return the error "curl: (35) Unsupported SSL protocol
version" Can be replicated with `curl -I -3 https://www.google.com/`.
This fix simply allows for v3 to be forced.
2014-01-01 21:36:47 +01:00
Steve Holme 34365e4b03 imap: Fixed line length warning 2013-12-31 12:16:33 +00:00
Steve Holme 60bd22620a mprintf: Replaced internal usage of FORMAT_OFF_T and FORMAT_OFF_TU
Following commit 0aafd77fa4, replaced the internal usage of
FORMAT_OFF_T and FORMAT_OFF_TU with the external versions that we
expect API programmers to use.

This negates the need for separate definitions which were subtly
different under different platforms/compilers.
2013-12-31 11:10:42 +00:00
Steve Holme 0aafd77fa4 mprintf: Added support for I, I32 and I64 size specifiers
Added support to the built-in printf() replacement functions, for these
non-ANSI extensions when compiling under Visual Studio, Borland, Watcom
and MinGW.

This fixes problems when generating libcurl source code that contains
curl_off_t variables.
2013-12-30 10:07:14 +00:00
Steve Holme 610a55388b connect.c: Fixed compilation warning
warning: 'res' may be used uninitialized in this function
2013-12-28 19:44:07 +00:00
Björn Stenberg 4e1ece2e44 connect: Try all addresses in first connection attempt
Fixes a bug when all addresses in the first family fail immediately, due
to "Network unreachable" for example, curl would hang and never try the
next address family.

Iterate through all address families when to trying establish the first
connection attempt.

Bug: http://curl.haxx.se/bug/view.cgi?id=1315
Reported-by: Michal Górny and Anthony G. Basile
2013-12-28 13:17:56 +00:00
Steve Holme c9dd4022f4 sendf.c: Fixed compilation warning from f2d234a4dd
sendf.c:450:81: warning: Longer than 79 columns
2013-12-27 12:08:37 +00:00
Steve Holme f2d234a4dd FILE: Fixed sending of data would always return CURLE_WRITE_ERROR
Introduced in commit 2a4ee0d221 sending of data via the FILE
protocol would always return CURLE_WRITE_ERROR regardless of whether
CURL_WRITEFUNC_PAUSE was returned from the callback function or not.
2013-12-27 10:58:31 +00:00
Daniel Stenberg 2a4ee0d221 FILE: we don't support paused transfers using this protocol
Make sure that we detect such attempts and return a proper error code
instead of silently handling this in problematic ways.

Updated the documentation to mention this limitation.

Bug: http://curl.haxx.se/bug/view.cgi?id=1286
2013-12-26 23:50:34 +01:00
Steve Holme f88f9bed00 vtls: Updated comments referencing sslgen.c and ssluse.c 2013-12-26 21:42:22 +00:00
Steve Holme 9aa6e4357a vtls: Fixed up include of vtls.h 2013-12-26 21:25:51 +00:00
Daniel Stenberg 7b057f53fd curl_dofree: allow free(NULL)
Previously this memdebug free() replacement didn't properly work with a
NULL argument which has made us write code that avoids calling
free(NULL) - which causes some extra nuisance and unnecessary code.
Starting now, we should allow free(NULL) even when built with the
memdebug system enabled.

free(NULL) is permitted by POSIX
2013-12-25 23:30:25 +01:00
Daniel Stenberg 0ff0a994ad Curl_thread_create: use Curl_safefree to allow NULL better
free() itself allows a NULL input but our memory debug system requires
Curl_safefree() to be used instead when a "legitimate" NULL may be freed. Like
in the code here.

Pointed-out-by: Steve Holme
2013-12-25 00:53:15 +01:00
Luke Dashjr e8b57d1e84 threaded resolver: Use pthread_t * for curl_thread_t
... since pthread_t may be non-scalar and/or may represent a real thread
with scalar 0.

Bug: http://curl.haxx.se/bug/view.cgi?id=1314
2013-12-25 00:28:28 +01:00
Steve Holme 7fd490732a imap: Fixed auth preference not being honored when CAPABILITY not supported
If a user indicated they preferred to authenticate using a SASL
mechanism, but SASL authentication wasn't supported by the server, curl
would always fall back to clear text when CAPABILITY wasn't supported,
even though the user didn't want to use this.
2013-12-24 22:50:33 +00:00
Steve Holme 0c762f1c92 pop3: Fixed auth preference not being honored when CAPA not supported
If a user indicated they preferred to authenticate using APOP or a SASL
mechanism, but neither were supported by the server, curl would always
fall back to clear text when CAPA wasn't supported, even though the
user didn't want to use this.

This also fixes the auto build failure caused by commit 6f2d5f0562.
2013-12-24 22:49:36 +00:00
Daniel Stenberg 2618e4caae Curl_pp_readresp: use memmove not memcpy, possibly overlapping areas
Fixes commit 1deac31eba
2013-12-24 21:29:18 +01:00
Steve Holme 6f2d5f0562 pop3: Fixed APOP being determined by CAPA response rather than by timestamp
This commit replaces that of 9f260b5d66 because according to RFC-2449,
section 6, there is no APOP capability "...even though APOP is an
optional command in [POP3].  Clients discover server support of APOP by
the presence in the greeting banner of an initial challenge enclosed in
angle brackets."
2013-12-24 16:34:55 +00:00
Daniel Stenberg 2715d7f948 FILE: don't wait due to CURLOPT_MAX_RECV_SPEED_LARGE
The FILE:// code doesn't support this option - and it doesn't make sense
to support it as long as it works as it does since then it'd only block
even longer.

But: setting CURLOPT_MAX_RECV_SPEED_LARGE would make the transfer first
get done and then libcurl would wait until the average speed would get
low enough. This happened because the transfer happens completely in the
DO state for FILE:// but then it would still unconditionally continue in
to the PERFORM state where the speed check is made.

Starting now, the code will skip from DO_DONE to DONE immediately if no
socket is set to be recv()ed or send()ed to.

Bug: http://curl.haxx.se/bug/view.cgi?id=1312
Reported-by: Mohammad AlSaleh
2013-12-22 23:44:14 +01:00
Steve Holme cf2051764c email: Fixed segfault introduced in commit 195b63f99c 2013-12-22 00:16:52 +00:00
Daniel Stenberg 3ce2a3991b code police: fix indent level to silence checksrc complaints 2013-12-22 01:01:19 +01:00
Steve Holme 195b63f99c email: Extended the login options to support multiple auth mechanisms 2013-12-21 23:49:37 +00:00
Daniel Stenberg 1deac31eba Curl_pp_readresp: replace stupid loop with memcpy 2013-12-22 00:29:43 +01:00
Daniel Stenberg bf468fb589 Curl_pp_readresp: zero terminate line
The comment in the code mentions the zero terminating after having
copied data, but it mistakingly zero terminated the source data and not
the destination! This caused the test 864 problem discussed on the list:

http://curl.haxx.se/mail/lib-2013-12/0113.html
Signed-off-by: Daniel Stenberg <daniel@haxx.se>
2013-12-22 00:20:13 +01:00
Steve Holme ca4506b46a Revert "pop3: Added debug information to assist with test864 failure"
This reverts commit 727d798d68.
2013-12-21 12:50:59 +00:00
Steve Holme 727d798d68 pop3: Added debug information to assist with test864 failure 2013-12-21 11:17:30 +00:00
Steve Holme 812c5ace75 pop3: Fixed APOP timestamp detection from commit 1cfb436a2f 2013-12-20 20:17:59 +00:00
Daniel Stenberg c3a02c3e54 Makefile.inc: use standard source header 2013-12-20 17:12:42 +01:00
Daniel Stenberg 565c5b3dc3 Makefile.inc: specify the vtls sources+headers separately 2013-12-20 17:12:42 +01:00
Daniel Stenberg 11e8066ef9 vtls: renamed sslgen.[ch] to vtls.[ch] 2013-12-20 17:12:42 +01:00
Daniel Stenberg 92b9ae5c5d openssl: renamed backend files to openssl.[ch] 2013-12-20 17:12:42 +01:00
Daniel Stenberg a47c142a88 vtls: moved all TLS/SSL source and header files into subdir 2013-12-20 17:12:42 +01:00
Daniel Stenberg eccf4fb7ee vtls: created subdir, moved sslgen.[ch] there, updated all include lines 2013-12-20 17:12:42 +01:00
Steve Holme 9f260b5d66 pop3: Fixed selection of APOP when server replies with an invalid timestamp
Although highlighted by a bug in commit 1cfb436a2f, APOP
authentication could be chosen if the server was to reply with an empty
or missing timestamp in the server greeting and APOP was given in the
capability list by the server.
2013-12-20 14:51:45 +00:00
Steve Holme 0452976711 pop3: Fixed processing of more than one response when sent in same packet
Added a loop to pop3_statemach_act() in which Curl_pp_readresp() is
called until the cache is drained. Without this multiple responses
received in a single packet could result in a hang or delay.
2013-12-20 07:20:49 +00:00
Steve Holme 94d820b4cb pop3: Moved CAPA response handling to pop3_state_capa_resp()
Similar to the processing of untagged CAPABILITY responses in IMAP and
multi-line EHLO responses in SMTP, moved the processing of multi-line
CAPA responses to pop3_state_capa_resp().
2013-12-19 23:06:42 +00:00
Steve Holme 1cfb436a2f pop3: Moved APOP detection into pop3_state_servergreet_resp()
In an effort to reduce what pop3_endofresp() does and bring the POP3
source back inline with the IMAP and SMTP protocols, moved the APOP
detection into pop3_state_servergreet_resp().
2013-12-19 23:06:33 +00:00
Steve Holme 48043f87b6 imap/pop3/smtp: Added support for SASL authentication downgrades
Added support for downgrading the SASL authentication mechanism when the
decoding of CRAM-MD5, DIGEST-MD5 and NTLM messages fails. This enhances
the previously added support for graceful cancellation by allowing the
client to retry a lesser SASL mechanism such as LOGIN or PLAIN, or even
APOP / clear text (in the case of POP3 and IMAP) when supported by the
server.
2013-12-18 20:45:17 +00:00