Skip to content
  1. Aug 01, 2015
  2. Jul 30, 2015
    • Kamil Dudka's avatar
      http: move HTTP/2 cleanup code off http_disconnect() · f7dcc7c1
      Kamil Dudka authored
      Otherwise it would never be called for an HTTP/2 connection, which has
      its own disconnect handler.
      
      I spotted this while debugging <https://bugzilla.redhat.com/1248389>
      where the http_disconnect() handler was called on an FTP session handle
      causing 'dnf' to crash.  conn->data->req.protop of type (struct FTP *)
      was reinterpreted as type (struct HTTP *) which resulted in SIGSEGV in
      Curl_add_buffer_free() after printing the "Connection cache is full,
      closing the oldest one." message.
      
      A previously working version of libcurl started to crash after it was
      recompiled with the HTTP/2 support despite the HTTP/2 protocol was not
      actually used.  This commit makes it work again although I suspect the
      root cause (reinterpreting session handle data of incompatible protocol)
      still has to be fixed.  Otherwise the same will happen when mixing FTP
      and HTTP/2 connections and exceeding the connection cache limit.
      
      Reported-by: Tomas Tomecek
      Bug: https://bugzilla.redhat.com/1248389
      f7dcc7c1
  3. Jul 24, 2015
    • Michael Kaufmann's avatar
      HTTP: ignore "Content-Encoding: compress" · c5d060ca
      Michael Kaufmann authored
      Currently, libcurl rejects responses with "Content-Encoding: compress"
      when CURLOPT_ACCEPT_ENCODING is set to "". I think that libcurl should
      treat the Content-Encoding "compress" the same as other
      Content-Encodings that it does not support, e.g. "bzip2". That means
      just ignoring it.
      c5d060ca
  4. Jul 23, 2015
    • Marcel Raad's avatar
      openssl: work around MSVC warning · 98835eed
      Marcel Raad authored
      MSVC 12 complains:
      
      lib\vtls\openssl.c(1554): warning C4701: potentially uninitialized local
      variable 'verstr' used It's a false positive, but as it's normally not,
      I have enabled warning-as-error for that warning.
      98835eed
    • Kamil Dudka's avatar
      http2: verify success of strchr() in http2_send() · da650c1e
      Kamil Dudka authored
      Detected by Coverity.
      
      Error: NULL_RETURNS:
      lib/http2.c:1301: returned_null: "strchr" returns null (checked 103 out of 109 times).
      lib/http2.c:1301: var_assigned: Assigning: "hdbuf" = null return value from "strchr".
      lib/http2.c:1302: dereference: Incrementing a pointer which might be null: "hdbuf".
      1300|
      1301|     hdbuf = strchr(hdbuf, 0x0a);
      1302|->   ++hdbuf;
      1303|
      1304|     authority_idx = 0;
      da650c1e
  5. Jul 22, 2015
  6. Jul 21, 2015
  7. Jul 20, 2015
  8. Jul 17, 2015
  9. Jul 16, 2015
    • David Woodhouse's avatar
      ntlm_wb: Fix theoretical memory leak · 60b19630
      David Woodhouse authored
      Static analysis indicated that my commit 9008f3d5 ("ntlm_wb: Fix
      hard-coded limit on NTLM auth packet size") introduced a potential
      memory leak on an error path, because we forget to free the buffer
      before returning an error.
      
      Fix this.
      
      Although actually, it never happens in practice because we never *get*
      here with state == NTLMSTATE_TYPE1. The state is always zero. That
      might want cleaning up in a separate patch.
      
      Reported-by: Terri Oda
      60b19630
    • Jay Satiro's avatar
      de74e856
  10. Jul 14, 2015
    • John Malmberg's avatar
      openssl: VMS support for SHA256 · 79416fb2
      John Malmberg authored
      setup-vms.h: More symbols for SHA256, hacks for older VAX
      
      openssl.h: Use OpenSSL OPENSSL_NO_SHA256 macro to allow building on VAX.
      
      openssl.c: Use OpenSSL version checks and OPENSSL_NO_SHA256 macro to
      allow building on VAX and 64 bit VMS.
      79416fb2
  11. Jul 07, 2015
  12. Jul 02, 2015
  13. Jul 01, 2015
  14. Jun 24, 2015
  15. Jun 18, 2015
  16. Jun 17, 2015
    • Daniel Stenberg's avatar
      openssl: fix build with BoringSSL · 46d0eba2
      Daniel Stenberg authored
      OPENSSL_load_builtin_modules does not exist in BoringSSL. Regression
      from cae43a10
      46d0eba2
    • Paul Howarth's avatar
      openssl: Fix build with openssl < ~ 0.9.8f · 4a239862
      Paul Howarth authored
      The symbol SSL3_MT_NEWSESSION_TICKET appears to have been introduced at
      around openssl 0.9.8f, and the use of it in lib/vtls/openssl.c breaks
      builds with older openssls (certainly with 0.9.8b, which is the latest
      older version I have to try with).
      4a239862
    • Daniel Stenberg's avatar
      FTP: do the HTTP CONNECT for data connection blocking · b88f980a
      Daniel Stenberg authored
      ** WORK-AROUND **
      
      The introduced non-blocking general behaviour for Curl_proxyCONNECT()
      didn't work for the data connection establishment unless it was very
      fast. The newly introduced function argument makes it operate in a more
      blocking manner, more like it used to work in the past. This blocking
      approach is only used when the FTP data connecting through HTTP proxy.
      
      Blocking like this is bad. A better fix would make it work more
      asynchronously.
      
      Bug: https://github.com/bagder/curl/issues/278
      b88f980a
    • Kamil Dudka's avatar
      http: do not leak basic auth credentials on re-used connections · 24a8359b
      Kamil Dudka authored
      CVE-2015-3236
      
      This partially reverts commit curl-7_39_0-237-g87c4abb
      
      Reported-by: Tomas Tomecek, Kamil Dudka
      Bug: http://curl.haxx.se/docs/adv_20150617A.html
      24a8359b
    • Daniel Stenberg's avatar
      SMB: rangecheck values read off incoming packet · 50c7f17e
      Daniel Stenberg authored
      CVE-2015-3237
      
      Detected by Coverity. CID 1299430.
      
      Bug: http://curl.haxx.se/docs/adv_20150617B.html
      50c7f17e
    • Jay Satiro's avatar
      schannel: schannel_recv overhaul · 3e7ec1e8
      Jay Satiro authored
      This commit is several drafts squashed together. The changes from each
      draft are noted below. If any changes are similar and possibly
      contradictory the change in the latest draft takes precedence.
      
      Bug: https://github.com/bagder/curl/issues/244
      Reported-by: Chris Araman
      
      %%
      %% Draft 1
      %%
      - return 0 if len == 0. that will have to be documented.
      - continue on and process the caches regardless of raw recv
      - if decrypted data will be returned then set the error code to CURLE_OK
      and return its count
      - if decrypted data will not be returned and the connection has closed
      (eg nread == 0) then return 0 and CURLE_OK
      - if decrypted data will not be returned and the connection *hasn't*
      closed then set the error code to CURLE_AGAIN --only if an error code
      isn't already set-- and return -1
      - narrow the Win2k workaround to only Win2k
      
      %%
      %% Draft 2
      %%
      - Trying out a change in flow to handle corner cases.
      
      %%
      %% Draft 3
      %%
      - Back out the lazier decryption change made in draft2.
      
      %%
      %% Draft 4
      %%
      - Some formatting and branching changes
      - Decrypt all encrypted cached data when len == 0
      - Save connection closed state
      - Change special Win2k check to use connection closed state
      
      %%
      %% Draft 5
      %%
      - Default to CURLE_AGAIN in cleanup if an error code wasn't set and the
      connection isn't closed.
      
      %%
      %% Draft 6
      %%
      - Save the last error only if it is an unrecoverable error.
      
      Prior to this I saved the last error state in all cases; unfortunately
      the logic to cover that in all cases would lead to some muddle and I'm
      concerned that could then lead to a bug in the future so I've replaced
      it by only recording an unrecoverable error and that state will persist.
      
      - Do not recurse on renegotiation.
      
      Instead we'll continue on to process any trailing encrypted data
      received during the renegotiation only.
      
      - Move the err checks in cleanup after the check for decrypted data.
      
      In either case decrypted data is always returned but I think it's easier
      to understand when those err checks come after the decrypted data check.
      
      %%
      %% Draft 7
      %%
      - Regardless of len value go directly to cleanup if there is an
      unrecoverable error or a close_notify was already received. Prior to
      this change we only acknowledged those two states if len != 0.
      
      - Fix a bug in connection closed behavior: Set the error state in the
      cleanup, because we don't know for sure it's an error until that time.
      
      - (Related to above) In the case the connection is closed go "greedy"
      with the decryption to make sure all remaining encrypted data has been
      decrypted even if it is not needed at that time by the caller. This is
      necessary because we can only tell if the connection closed gracefully
      (close_notify) once all encrypted data has been decrypted.
      
      - Do not renegotiate when an unrecoverable error is pending.
      
      %%
      %% Draft 8
      %%
      - Don't show 'server closed the connection' info message twice.
      
      - Show an info message if server closed abruptly (missing close_notify).
      3e7ec1e8
  17. Jun 15, 2015