Skip to content
Snippets Groups Projects
  1. Aug 29, 2013
    • Daniel Stenberg's avatar
      easy: rename struct monitor to socketmonitor · 2f9b64ac
      Daniel Stenberg authored
      'struct monitor', introduced in 6cf8413e, already exists in an IRIX
      header file (sys/mon.h) which gets included via various standard headers
      by lib/easy.c
      
      cc-1101 cc: ERROR File = ../../curl/lib/easy.c, Line = 458
      "monitor" has already been declared in the current scope.
      
      Reported-by: Tor Arntsen
      2f9b64ac
  2. Aug 27, 2013
    • Daniel Stenberg's avatar
      multi_socket: improved 100-continue timeout handling · a691e044
      Daniel Stenberg authored
      When waiting for a 100-continue response from the server, the
      Curl_readwrite() will refuse to run if called until the timeout has been
      reached.
      
      We timeout code in multi_socket() allows code to run slightly before the
      actual timeout time, so for test 154 it could lead to the function being
      executed but refused in Curl_readwrite() and then the application would
      just sit idling forever.
      
      This was detected with runtests.pl -e on test 154.
      a691e044
  3. Aug 26, 2013
    • Daniel Stenberg's avatar
      security.h: rename to curl_sec.h to avoid name collision · 460fb120
      Daniel Stenberg authored
      I brought back security.h in commit bb552933. As we actually
      already found out back in 2005 in commit 62970da6, the file name
      security.h causes problems so I renamed it curl_sec.h instead.
      460fb120
    • Kyle L. Huff's avatar
      smtp: added basic SASL XOAUTH2 support · 90ab65c6
      Kyle L. Huff authored
      Added the ability to use an XOAUTH2 bearer token [RFC6750] with SMTP for
      authentication using RFC6749 "OAuth 2.0 Authorization Framework".
      
      The bearer token is expected to be valid for the user specified in
      conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has
      an advertised auth mechanism of "XOAUTH2", the user and access token are
      formatted as a base64 encoded string and sent to the server as
      "AUTH XOAUTH2 <bearer token>".
      90ab65c6
    • Kyle L. Huff's avatar
      imap: added basic SASL XOAUTH2 support · 34122800
      Kyle L. Huff authored
      Added the ability to use an XOAUTH2 bearer token [RFC6750] with IMAP for
      authentication using RFC6749 "OAuth 2.0 Authorization Framework".
      
      The bearer token is expected to be valid for the user specified in
      conn->user. If CURLOPT_XOAUTH2_BEARER is defined and the connection has
      an advertised auth mechanism of "XOAUTH2", the user and access token are
      formatted as a base64 encoded string and sent to the server as
      "A001 AUTHENTICATE XOAUTH2 <bearer token>".
      34122800
    • Steve Holme's avatar
      security.h: Fixed compilation warning · 7f41eab3
      Steve Holme authored
      ISO C forbids forward references to 'enum' types
      7f41eab3
  4. Aug 25, 2013
    • Kyle L. Huff's avatar
      options: added basic SASL XOAUTH2 support · 06c1bea7
      Kyle L. Huff authored
      Added the ability to specify an XOAUTH2 bearer token [RFC6750] via the
      option CURLOPT_XOAUTH2_BEARER for authentication using RFC6749 "OAuth
      2.0 Authorization Framework".
      06c1bea7
    • Kyle L. Huff's avatar
      sasl: added basic SASL XOAUTH2 support · 19a05c90
      Kyle L. Huff authored
      Added the ability to generated a base64 encoded XOAUTH2 token
      containing: "user=<username>^Aauth=Bearer <bearer token>^A^A"
      as per RFC6749 "OAuth 2.0 Authorization Framework".
      19a05c90
    • Daniel Stenberg's avatar
      FTP: remove krb4 support · bb552933
      Daniel Stenberg authored
      We've announced this pending removal for a long time and we've
      repeatedly asked if anyone would care or if anyone objects. Nobody has
      objected. It has probably not even been working for a good while since
      nobody has tested/used this code recently.
      
      The stuff in krb4.h that was generic enough to be used by other sources
      is now present in security.h
      bb552933
    • Daniel Stenberg's avatar
  5. Aug 22, 2013
  6. Aug 21, 2013
  7. Aug 20, 2013
    • Daniel Stenberg's avatar
      CURLM_ADDED_ALREADY: new error code · 19122c07
      Daniel Stenberg authored
      Doing curl_multi_add_handle() on an easy handle that is already added to
      a multi handle now returns this error code. It previously returned
      CURLM_BAD_EASY_HANDLE for this condition.
      19122c07
    • Daniel Stenberg's avatar
      multi_init: moved init code here from add_handle · c346c4c8
      Daniel Stenberg authored
      The closure_handle is "owned" by the multi handle and it is
      unconditional so the setting up of it should be in the Curl_multi_handle
      function rather than curl_multi_add_handle.
      c346c4c8
    • Daniel Stenberg's avatar
      multi: remove dns cache creation code from *add_handle · bc7d806e
      Daniel Stenberg authored
      As it is done unconditionally in multi_init() this code will never run!
      bc7d806e
    • Daniel Stenberg's avatar
      curl_easy_perform_ev: debug/test function · 6cf8413e
      Daniel Stenberg authored
      This function is meant to work *exactly* as curl_easy_perform() but will
      use the event-based libcurl API internally instead of
      curl_multi_perform(). To avoid relying on an actual event-based library
      and to not use non-portable functions (like epoll or similar), there's a
      rather inefficient emulation layer implemented on top of Curl_poll()
      instead.
      
      There's currently some convenience logging done in curl_easy_perform_ev
      which helps when tracking down problems. They may be suitable to remove
      or change once things seem to be fine enough.
      
      curl has a new --test-event option when built with debug enabled that
      then uses curl_easy_perform_ev() instead of curl_easy_perform(). If
      built without debug, using --test-event will only output a warning
      message.
      
      NOTE: curl_easy_perform_ev() is not part if the public API on purpose.
      It is only present in debug builds of libcurl and MUST NOT be considered
      stable even then. Use it for libcurl-testing purposes only.
      
      runtests.pl now features an -e command line option that makes it use
      --test-event for all curl command line tests. The man page is updated.
      6cf8413e
    • Gisle Vanem's avatar
    • Jonathan Nieder's avatar
      url: handle arbitrary-length username and password before '@' · 2f1a0bc0
      Jonathan Nieder authored
      libcurl quietly truncates usernames, passwords, and options from
      before an '@' sign in a URL to 255 (= MAX_CURL_PASSWORD_LENGTH - 1)
      characters to fit in fixed-size buffers on the stack.  Allocate a
      buffer large enough to fit the parsed fields on the fly instead to
      support longer passwords.
      
      After this change, there are no more uses of MAX_CURL_OPTIONS_LENGTH
      left, so stop defining that constant while at it.  The hardcoded max
      username and password length constants, on the other hand, are still
      used in HTTP proxy credential handling (which this patch doesn't
      touch).
      
      Reported-by: Colby Ranger
      2f1a0bc0
    • Jonathan Nieder's avatar
      url: handle exceptional cases first in parse_url_login() · 09ddb1d6
      Jonathan Nieder authored
      Instead of nesting "if(success)" blocks and leaving the reader in
      suspense about what happens in the !success case, deal with failure
      cases early, usually with a simple goto to clean up and return from
      the function.
      
      No functional change intended.  The main effect is to decrease the
      indentation of this function slightly.
      09ddb1d6
    • Jonathan Nieder's avatar
      Curl_setopt: handle arbitrary-length username and password · 15f76bf7
      Jonathan Nieder authored
      libcurl truncates usernames, passwords, and options set with
      curl_easy_setopt to 255 (= MAX_CURL_PASSWORD_LENGTH - 1) characters.
      This doesn't affect the return value from curl_easy_setopt(), so from
      the caller's point of view, there is no sign anything strange has
      happened, except that authentication fails.
      
      For example:
      
        # Prepare a long (300-char) password.
        s=0123456789; s=$s$s$s$s$s$s$s$s$s$s; s=$s$s$s;
        # Start a server.
        nc -l -p 8888 | tee out & pid=$!
        # Tell curl to pass the password to the server.
        curl --user me:$s http://localhost:8888 & sleep 1; kill $pid
        # Extract the password.
        userpass=$(
      	awk '/Authorization: Basic/ {print $3}' <out |
      	tr -d '\r' |
      	base64 -d
        )
        password=${userpass#me:}
        echo ${#password}
      
      Expected result: 300
      Actual result: 255
      
      The fix is simple: allocate appropriately sized buffers on the heap
      instead of trying to squeeze the provided values into fixed-size
      on-stack buffers.
      
      Bug: http://bugs.debian.org/719856
      Reported-by: Colby Ranger
      15f76bf7
    • Jonathan Nieder's avatar
      netrc: handle longer username and password · 36585b53
      Jonathan Nieder authored
      libcurl truncates usernames and passwords it reads from .netrc to
      LOGINSIZE and PASSWORDSIZE (64) characters without any indication to
      the user, to ensure the values returned from Curl_parsenetrc fit in a
      caller-provided buffer.
      
      Fix the interface by passing back dynamically allocated buffers
      allocated to fit the user's input.  The parser still relies on a
      256-character buffer to read each line, though.
      
      So now you can include an ~246-character password in your .netrc,
      instead of the previous limit of 63 characters.
      
      Reported-by: Colby Ranger
      36585b53
    • Jonathan Nieder's avatar
      url: allocate username, password, and options on the heap · 11baffbf
      Jonathan Nieder authored
      This makes it possible to increase the size of the buffers when needed
      in later patches.  No functional change yet.
      11baffbf
    • Jonathan Nieder's avatar
      url: use goto in create_conn() for exception handling · 53333a43
      Jonathan Nieder authored
      Instead of remembering before each "return" statement which temporary
      allocations, if any, need to be freed, take care to set pointers to
      NULL when no longer needed and use a goto to a common block to exit
      the function and free all temporaries.
      
      No functional change intended.  Currently the only temporary buffer in
      this function is "proxy" which is already correctly freed when
      appropriate, but there will be more soon.
      53333a43
    • Jonathan Nieder's avatar
      sasl: allow arbitrarily long username and password · c56f9797
      Jonathan Nieder authored
      Use appropriately sized buffers on the heap instead of fixed-size
      buffers on the stack, to allow for longer usernames and passwords.
      
      Callers never pass anything longer than MAX_CURL_USER_LENGTH (resp.
      MAX_CURL_PASSWORD_LENGTH), so no functional change inteded yet.
      c56f9797
  8. Aug 19, 2013
  9. Aug 14, 2013
  10. Aug 12, 2013
    • Kamil Dudka's avatar
      nss: make sure that NSS is initialized · 204126a5
      Kamil Dudka authored
      ... prior to calling PK11_GenerateRandom()
      204126a5
    • Daniel Stenberg's avatar
      multi: s/easy/data · 2ae3d28f
      Daniel Stenberg authored
      With everything being struct SessionHandle pointers now, this rename
      makes multi.c use the library-wide practise of calling that pointer
      'data' instead of the previously used 'easy'.
      2ae3d28f
    • Daniel Stenberg's avatar
      cleanup: removed one function, made one static · 8a42c2ef
      Daniel Stenberg authored
      Moved Curl_easy_addmulti() from easy.c to multi.c, renamed it to
      easy_addmulti and made it static.
      
      Removed Curl_easy_initHandleData() and uses of it since it was emptied
      in commit cdda92ab67b47d74a.
      8a42c2ef
    • Daniel Stenberg's avatar
      SessionHandle: the protocol specific pointer is now a void * · e79535bc
      Daniel Stenberg authored
      All protocol handler structs are now opaque (void *) in the
      SessionHandle struct and moved in the request-specific sub-struct
      'SingleRequest'. The intension is to keep the protocol specific
      knowledge in their own dedicated source files [protocol].c etc.
      
      There's some "leakage" where this policy is violated, to be addressed at
      a later point in time.
      e79535bc
    • Daniel Stenberg's avatar
      urldata: clean up the use of the protocol specific structs · 4ad8e142
      Daniel Stenberg authored
      1 - always allocate the struct in protocol->setup_connection. Some
      protocol handlers had to get this function added.
      
      2 - always free at the end of a request. This is also an attempt to keep
      less memory in the handle after it is completed.
      4ad8e142
  11. Aug 09, 2013
  12. Aug 08, 2013
    • Daniel Stenberg's avatar
      global dns cache: fix memory leak · d20def20
      Daniel Stenberg authored
      The take down of the global dns cache didn't take CURLOPT_RESOLVE names
      into account.
      d20def20
    • Daniel Stenberg's avatar
      global dns cache: didn't work [regression] · d2b36e46
      Daniel Stenberg authored
      CURLOPT_DNS_USE_GLOBAL_CACHE broke in commit c4312741 (been
      broken since the libcurl 7.29.0 release). While this option has been
      documented as deprecated for almost a decade and nobody even reported
      this bug, it should remain functional.
      
      Added test case 1512 to verify
      d2b36e46
    • Daniel Stenberg's avatar
      FTP: renamed several local functions · 058b86e6
      Daniel Stenberg authored
      The previous naming scheme ftp_state_post_XXXX() wasn't really helpful
      as it wasn't always immediately after 'xxxx' and it wasn't easy to
      understand what it does based on such a name.
      
      This new one is instead ftp_state_yyyy() where yyyy describes what it
      does or sends.
      058b86e6
  13. Aug 06, 2013
    • Daniel Stenberg's avatar
      FTP: when EPSV gets a 229 but fails to connect, retry with PASV · 7cc00d9a
      Daniel Stenberg authored
      This is a regression as this logic used to work. It isn't clear when it
      broke, but I'm assuming in 7.28.0 when we went all-multi internally.
      
      This likely never worked with the multi interface. As the failed
      connection is detected once the multi state has reached DO_MORE, the
      Curl_do_more() function was now expanded somewhat so that the
      ftp_do_more() function can request to go "back" to the previous state
      when it makes another attempt - using PASV.
      
      Added test case 1233 to verify this fix. It has the little issue that it
      assumes no service is listening/accepting connections on port 1...
      
      Reported-by: byte_bucket in the #curl IRC channel
      7cc00d9a
    • Nick Zitzmann's avatar
      md5: remove use of CommonCrypto-to-OpenSSL macros for the benefit of Leopard · 230e16dc
      Nick Zitzmann authored
      For some reason, OS X 10.5's GCC suddenly stopped working correctly with
      macros that change MD5_Init etc. in the code to CC_MD5_Init etc., so I
      worked around this by removing use of the macros and inserting static
      functions that just call CommonCrypto's implementations of the functions
      instead.
      230e16dc
  14. Aug 05, 2013
    • Guenter Knauf's avatar
      Simplify check for trusted certificates. · 0ce410a6
      Guenter Knauf authored
      This changes the previous check for untrusted certs to a check for
      certs explicitely marked as trusted.
      The change is backward-compatible (tested with certdata.txt v1.80).
      0ce410a6
Loading