Commit Graph

4677 Commits

Author SHA1 Message Date
Dan Fandrich 0dec3e5e6a Fixed a memory leak in the FTP code and an off-by-one heap buffer overflow. 2009-08-11 02:30:53 +00:00
Gunter Knauf 1cb921b7f3 fix cast for some systems which are broken due to absense of socklen_t, therefore now use curl_socklen_t. 2009-08-07 23:32:38 +00:00
Gunter Knauf 97c8bc9757 fixed cast added with last commit. 2009-08-06 12:02:00 +00:00
Gunter Knauf 2cad095425 cast to fix 64bit build warnings. From manpage:
POSIX.1-2001. Note that RFC 2553 defines a prototype where the last parameter cnt is of type size_t.
Many systems follow RFC 2553. Glibc 2.0 and 2.1 have size_t, but 2.2 has socklen_t.
2009-08-06 11:10:30 +00:00
Daniel Stenberg 35eb9fc6ad avoid possible NULL dereference caused by my previous fix 2009-08-03 14:07:57 +00:00
Daniel Stenberg 3a9c03bef3 indentation fixes only 2009-08-03 11:32:55 +00:00
Daniel Stenberg 781b82baf5 Reverted the zero-byte-in-name check to instead rely on the fact that strlen
and the name length differ in those cases and thus leave the matching function
unmodified from before, as the matching functions never have to bother with
the zero bytes in legitimate cases. Peter Sylvester helped me realize that
this fix is slightly better as it leaves more code unmodified and makes the
detection a bit more obvious in the code.
2009-08-03 08:45:19 +00:00
Daniel Stenberg 0b66efac9c Extended my embedded-zero-in-cert-name fix based on a comment from Scott
Cantor. My previous attempt was half-baked and didn't cover the normal CN
case.
2009-08-02 22:34:00 +00:00
Daniel Stenberg 6d891d2a3b - Curt Bogmine reported a problem with SNI enabled on a particular server. We
should introduce an option to disable SNI, but as we're in feature freeze
  now I've addressed the obvious bug here (pointed out by Peter Sylvester): we
  shouldn't try to enable SNI when SSLv2 or SSLv3 is explicitly selected.
  Code for OpenSSL and GnuTLS was fixed. NSS doesn't seem to have a particular
  option for SNI, or are we simply not using it?
2009-08-01 22:11:58 +00:00
Daniel Stenberg c0e8bed5bf - Scott Cantor posted the bug report #2829955
(http://curl.haxx.se/bug/view.cgi?id=2829955) mentioning the recent SSL cert
  verification flaw found and exploited by Moxie Marlinspike. The presentation
  he did at Black Hat is available here:
  https://www.blackhat.com/html/bh-usa-09/bh-usa-09-archives.html#Marlinspike

  Apparently at least one CA allowed a subjectAltName or CN that contain a
  zero byte, and thus clients that assumed they would never have zero bytes
  were exploited to OK a certificate that didn't actually match the site. Like
  if the name in the cert was "example.com\0theatualsite.com", libcurl would
  happily verify that cert for example.com.

  libcurl now better use the length of the extracted name, not assuming it is
  zero terminated.
2009-08-01 21:56:59 +00:00
Daniel Stenberg 0dce2ff8a0 - Tanguy Fautre pointed out that OpenSSL's function RAND_screen() (present
only in some OpenSSL installs - like on Windows) isn't thread-safe and we
  agreed that moving it to the global_init() function is a decent way to deal
  with this situation.
2009-08-01 11:09:02 +00:00
Daniel Stenberg 2642638fca - Alexander Beedie provided the patch for a noproxy problem: If I have set
CURLOPT_NOPROXY to "*", or to a host that should not use a proxy, I actually
  could still end up using a proxy if a proxy environment variable was set.
2009-08-01 11:02:10 +00:00
Daniel Stenberg 0684128209 - All the quote options (CURLOPT_QUOTE, CURLOPT_POSTQUOTE and
CURLOPT_PREQUOTE) now accept a preceeding asterisk before the command to
  send when using FTP, as a sign that libcurl shall simply ignore the response
  from the server instead of treating it as an error. Not treating a 400+ FTP
  response code as an error means that failed commands will not abort the
  chain of commands, nor will they cause the connection to get disconnected.
2009-07-27 18:36:56 +00:00
Daniel Stenberg 9b5c00a664 From: Johan van Selst
"you replaced the old SSLeay_add_ssl_algorithms() call
with OpenSSL_add_all_algorithms(), however unlike the name suggests,
the second function is not a superset of the first. When using SSL
both these functions will need to be called in order to offer complete
functionality"
2009-07-27 18:31:48 +00:00
Daniel Stenberg b347a7a96e - Bug report #2825989 (http://curl.haxx.se/bug/view.cgi?id=2825989) pointed
out that OpenSSL-powered libcurl didn't support the SHA-2 digest algorithm,
  and provided the solution too: to use OpenSSL_add_all_algorithms() instead
  of the older SSLeay_* alternative. OpenSSL_add_all_algorithms was added in
  OpenSSL 0.9.5
2009-07-26 17:33:36 +00:00
Gunter Knauf 8570883412 changes to silent compiler warnings with 64bit systems. 2009-07-24 22:20:22 +00:00
Gunter Knauf 1d5627b181 changes to silent compiler warnings with 64bit systems. 2009-07-24 22:06:19 +00:00
Gunter Knauf 038fff6c9f changes to silent compiler warnings with 64bit systems. 2009-07-23 04:53:08 +00:00
Gunter Knauf 21dd9a8021 fixed brace error. 2009-07-23 03:54:01 +00:00
Gunter Knauf 59934c1176 changes to silent compiler warnings with 64bit systems. 2009-07-23 02:48:05 +00:00
Gunter Knauf 2f6ff57d96 blocked sshkeycallback() with HAVE_LIBSSH2_KNOWNHOST_API to avoid compiler warnings. 2009-07-23 02:15:00 +00:00
Daniel Stenberg 47c392e135 - Added CURLOPT_SSH_KNOWNHOSTS, CURLOPT_SSH_KEYFUNCTION, CURLOPT_SSH_KEYDATA.
They introduce known_host support for SSH keys to libcurl. See docs for
  details.
2009-07-22 22:49:01 +00:00
Michal Marek 4c207a004c - David Binderman found a memory and fd leak in lib/gtls.c:load_file()
(https://bugzilla.novell.com/523919). When looking at the code, I found
  that also the ptr pointer can leak.
2009-07-22 09:48:32 +00:00
Kamil Dudka 5f0cae8037 - Claes Jakobsson improved the support for client certificates handling
in NSS-powered libcurl. Now the client certificates can be selected
  automatically by a NSS built-in hook. Additionally pre-login to all PKCS11
  slots is no more performed. It used to cause problems with HW tokens.

- Fixed reference counting for NSS client certificates. Now the PEM reader
  module should be always properly unloaded on Curl_nss_cleanup(). If the unload
  fails though, libcurl will try to reuse the already loaded instance.
2009-07-20 21:50:21 +00:00
Gunter Knauf d7f33b7e4e added a cast to silent compiler warning with 64bit systems. 2009-07-16 17:39:14 +00:00
Dan Fandrich b74b5e0602 Added nonblock.c to the non-automake makefiles (note that the dependencies
in the Watcom makefiles aren't quite correct).
2009-07-15 21:49:47 +00:00
Gunter Knauf b476530755 fixed typo. 2009-07-15 01:10:18 +00:00
Bill Hoffman a8ea1e9ef4 ENH: add optional support for c-ares 2009-07-14 19:03:31 +00:00
Bill Hoffman 340e3b952f ENH: move config.h.cmake to curl_config.h.cmake so it builds again 2009-07-14 13:46:45 +00:00
Bill Hoffman f5f9354093 ENH: add nonblock.c to build for CMake 2009-07-14 13:35:10 +00:00
Gunter Knauf f671d0513c renamed generated config.h to curl_config.h in order to avoid clashes when libcurl is used with other projects which also have a config.h. 2009-07-14 13:25:14 +00:00
Daniel Stenberg 4e75c70874 silence a compiler warning 2009-07-11 09:57:54 +00:00
Daniel Stenberg bdbfe1f8a9 add these new files to CVS as well 2009-07-09 21:55:26 +00:00
Daniel Stenberg d709cb2ae3 - Eric Wong introduced curlx_nonblock() that the curl tool now (re-)uses for
setting a file descriptor non-blocking. Used by the functionality Eric
  himself brough on June 15th.
2009-07-09 21:47:24 +00:00
Daniel Stenberg 5cf78472e1 - Constantine Sapuntzakis posted bug report #2813123
(http://curl.haxx.se/bug/view.cgi?id=2813123) and an a patch that fixes the
  problem:

  Url A is accessed using auth. Url A redirects to Url B (on a different
  server0. Url B reuses a persistent connection. Url B has auth, even though
  it's on a different server.

  Note: if Url B does not reuse a persistent connection, auth is not sent.
2009-07-08 07:00:40 +00:00
Gunter Knauf 2aaff16a87 added INET_ADDRSTRLEN define in case system headers dont provide. 2009-07-04 11:27:42 +00:00
Gunter Knauf 6236198d43 removed NIFLAGS which is no longer used; added NI_MAXHOST since its missing with some platforms. 2009-07-04 11:06:00 +00:00
Gunter Knauf 83fb285d40 Markus Koetter provided a patch to avoid getnameinfo() usage which broke a couple of both IPv4 and IPv6 autobuilds. 2009-07-04 01:04:23 +00:00
Daniel Stenberg 175fc5096d Tor Arntsen pointed out a missing #ifdef for IPv6, and I changed another one
to use the "standard" ENABLE_IPV6 one. Also, if port number cannot be figured
out to connect to after a name resolve (due to it not being IPv4 or IPv6),
that particular address will now simply be skipped.
2009-06-30 21:30:39 +00:00
Daniel Stenberg 4f551259dd - Markus Koetter made CURLOPT_FTPPORT (and curl's -P/--ftpport) support a port
range if given colon-separated after the host name/address part. Like
  "192.168.0.1:2000-10000"
2009-06-29 20:46:01 +00:00
Daniel Stenberg 9cb68c6e32 - Modified the separators used for CURLOPT_CERTINFO in multi-part outputs. I
don't know how they got wrong in the first place, but using this output
  format makes it possible to quite easily separate the string into an array
  of multiple items.
2009-06-29 20:45:42 +00:00
Dan Fandrich a9a89c604a Fixed a compiler warning. 2009-06-27 06:05:08 +00:00
Michal Marek ad1bfc5468 fix indentation. 2009-06-19 10:20:28 +00:00
Yang Tse 2c0c05e96d sclose() function-like macro definition used to close a socket,
now solely based on HAVE_CLOSESOCKET and HAVE_CLOSESOCKET_CAMEL
config file preprocessor definitions.
2009-06-19 00:41:03 +00:00
Michal Marek 0b317b72ae - When doing non-anonymous ftp via http proxies and the password is not
provided in the url, add it there (squid needs this).
2009-06-16 13:16:28 +00:00
Patrick Monnerat c32cf33a16 Replaced use of standard C library rand()/srand() by our own pseudo-random number generator. 2009-06-15 10:15:28 +00:00
Yang Tse 7eb59de7df DEBUGBUILD / CURLDEBUG decoupling follow-up 2009-06-15 02:30:22 +00:00
Yang Tse 5931cf77f4 DEBUGBUILD / CURLDEBUG decoupling follow-up 2009-06-15 02:29:49 +00:00
Yang Tse 169e94d68b improve usability with UNIX-like shells or a DOS command interpreters 2009-06-13 18:11:17 +00:00
Yang Tse 47e403640b include <limits.h> for INT_MAX definition 2009-06-12 02:47:35 +00:00