Hello community,

here is the log from the commit of package curl for openSUSE:11.4
checked in at Tue Jan 24 13:46:22 CET 2012.



--------
--- old-versions/11.4/all/curl/curl.changes     2010-10-22 18:41:27.000000000 
+0200
+++ 11.4/curl/curl.changes      2012-01-22 15:44:59.000000000 +0100
@@ -1,0 +2,10 @@
+Sun Jan 22 14:44:22 UTC 2012 - mma...@suse.cz
+
+- Fix IMAP, POP3 and SMTP URL sanitization (bnc#740452,
+  CVE-2012-0036)
+- Disable SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option when built
+  against an older OpenSSL version (CVE-2010-4180).
+- Don't enable SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS (bnc#742306,
+  CVE-2011-3389).
+
+-------------------------------------------------------------------

Package does not exist at destination yet. Using Fallback 
old-versions/11.4/all/curl
Destination is old-versions/11.4/UPDATES/all/curl
calling whatdependson for 11.4-i586


New:
----
  0001-CURL_DOES_CONVERSIONS-cleanup.patch
  0002-URL-sanitize-reject-URLs-containing-bad-data.patch
  0003-OpenSSL-SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG-opti.patch
  0004-OpenSSL-don-t-disable-security-work-around.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ curl.spec ++++++
--- /var/tmp/diff_new_pack.dA1A54/_old  2012-01-24 13:46:08.000000000 +0100
+++ /var/tmp/diff_new_pack.dA1A54/_new  2012-01-24 13:46:08.000000000 +0100
@@ -1,7 +1,7 @@
 #
-# spec file for package curl (Version 7.21.2)
+# spec file for package curl
 #
-# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -41,7 +41,7 @@
 %endif
 #define cvs_suffix -20090302
 Version:        7.21.2
-Release:        2
+Release:        10.<RELEASE11>
 AutoReqProv:    on
 # bug437293
 %ifarch ppc64
@@ -54,6 +54,10 @@
 Url:            http://curl.haxx.se/
 Source:         curl-%version%{?cvs_suffix}.tar.bz2
 Source2:        baselibs.conf
+Patch1:         0001-CURL_DOES_CONVERSIONS-cleanup.patch
+Patch2:         0002-URL-sanitize-reject-URLs-containing-bad-data.patch
+Patch3:         0003-OpenSSL-SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG-opti.patch
+Patch4:         0004-OpenSSL-don-t-disable-security-work-around.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 
 %description
@@ -87,6 +91,10 @@
 
 %prep
 %setup -q -n curl-%version%{?cvs_suffix}
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
 
 %build
 # local hack to make curl-config --libs stop printing libraries it depends on

++++++ 0001-CURL_DOES_CONVERSIONS-cleanup.patch ++++++
++++ 1562 lines (skipped)

++++++ 0002-URL-sanitize-reject-URLs-containing-bad-data.patch ++++++
>From 4d7922844dcd94fd9220e331a7fd06acd1fddabd Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <dan...@haxx.se>
Date: Fri, 23 Dec 2011 13:24:16 +0100
Subject: [PATCH] URL sanitize: reject URLs containing bad data

Protocols (IMAP, POP3 and SMTP) that use the path part of a URL in a
decoded manner now use the new Curl_urldecode() function to reject URLs
with embedded control codes (anything that is or decodes to a byte value
less than 32).

URLs containing such codes could easily otherwise be used to do harm and
allow users to do unintended actions with otherwise innocent tools and
applications. Like for example using a URL like
pop3://pop3.example.com/1%0d%0aDELE%201 when the app wants a URL to get
a mail and instead this would delete one.

This flaw is considered a security vulnerability: CVE-2012-0036

Security advisory at: http://curl.haxx.se/docs/adv_20120124.html

Reported by: Dan Fandrich

cherry-picked from commit 400055bfaaa1b13b3f3051f69df9630da793dc8b

Conflicts:

        lib/escape.c
        lib/pop3.c
        lib/smtp.c
---
 lib/escape.c |   65 ++++++++++++++++++++++++++++++++++++++++++++++-----------
 lib/escape.h |   10 ++++++--
 lib/imap.c   |    7 +-----
 lib/pop3.c   |    6 +----
 lib/smtp.c   |    7 ++---
 5 files changed, 64 insertions(+), 31 deletions(-)

diff --git a/lib/escape.c b/lib/escape.c
index 4e8dd6e..2fb8626 100644
--- a/lib/escape.c
+++ b/lib/escape.c
@@ -34,6 +34,7 @@
 #include "urldata.h"
 #include "warnless.h"
 #include "non-ascii.h"
+#include "escape.h"
 
 #define _MPRINTF_REPLACE /* use our functions only */
 #include <curl/mprintf.h>
@@ -87,7 +88,7 @@ char *curl_easy_escape(CURL *handle, const char *string, int 
inlength)
   char *testing_ptr = NULL;
   unsigned char in; /* we need to treat the characters unsigned */
   size_t newlen = alloc;
-  int strindex=0;
+  size_t strindex=0;
   size_t length;
 
   ns = malloc(alloc);
@@ -134,22 +135,29 @@ char *curl_easy_escape(CURL *handle, const char *string, 
int inlength)
 }
 
 /*
- * Unescapes the given URL escaped string of given length. Returns a
- * pointer to a malloced string with length given in *olen.
- * If length == 0, the length is assumed to be strlen(string).
- * If olen == NULL, no output length is stored.
+ * Curl_urldecode() URL decodes the given string.
+ *
+ * Optionally detects control characters (byte codes lower than 32) in the
+ * data and rejects such data.
+ *
+ * Returns a pointer to a malloced string in *ostring with length given in
+ * *olen. If length == 0, the length is assumed to be strlen(string).
+ *
  */
-char *curl_easy_unescape(CURL *handle, const char *string, int length,
-                         int *olen)
+CURLcode Curl_urldecode(struct SessionHandle *data,
+                        const char *string, size_t length,
+                        char **ostring, size_t *olen,
+                        bool reject_ctrl)
 {
-  int alloc = (length?length:(int)strlen(string))+1;
+  size_t alloc = (length?length:strlen(string))+1;
   char *ns = malloc(alloc);
   unsigned char in;
-  int strindex=0;
+  size_t strindex=0;
   unsigned long hex;
+  CURLcode res;
 
   if(!ns)
-    return NULL;
+    return CURLE_OUT_OF_MEMORY;
 
   while(--alloc > 0) {
     in = *string;
@@ -165,15 +173,20 @@ char *curl_easy_unescape(CURL *handle, const char 
*string, int length,
 
       in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */
 
-      if(Curl_convert_from_network(handle, &in, 1)) {
+      res = Curl_convert_from_network(data, &in, 1);
+      if(res) {
         /* Curl_convert_from_network calls failf if unsuccessful */
         free(ns);
-        return NULL;
+        return res;
       }
 
       string+=2;
       alloc-=2;
     }
+    if(reject_ctrl && (in < 0x20)) {
+      free(ns);
+      return CURLE_URL_MALFORMAT;
+    }
 
     ns[strindex++] = in;
     string++;
@@ -183,7 +196,33 @@ char *curl_easy_unescape(CURL *handle, const char *string, 
int length,
   if(olen)
     /* store output size */
     *olen = strindex;
-  return ns;
+
+  if(ostring)
+    /* store output string */
+    *ostring = ns;
+
+  return CURLE_OK;
+}
+
+/*
+ * Unescapes the given URL escaped string of given length. Returns a
+ * pointer to a malloced string with length given in *olen.
+ * If length == 0, the length is assumed to be strlen(string).
+ * If olen == NULL, no output length is stored.
+ */
+char *curl_easy_unescape(CURL *handle, const char *string, int length,
+                         int *olen)
+{
+  char *str = NULL;
+  size_t inputlen = length;
+  size_t outputlen;
+  CURLcode res = Curl_urldecode(handle, string, inputlen, &str, &outputlen,
+                                FALSE);
+  if(res)
+    return NULL;
+  if(olen)
+    *olen = curlx_uztosi(outputlen);
+  return str;
 }
 
 /* For operating systems/environments that use different malloc/free
diff --git a/lib/escape.h b/lib/escape.h
index 04b06a9..4c7f841 100644
--- a/lib/escape.h
+++ b/lib/escape.h
@@ -1,5 +1,5 @@
-#ifndef __ESCAPE_H
-#define __ESCAPE_H
+#ifndef HEADER_CURL_ESCAPE_H
+#define HEADER_CURL_ESCAPE_H
 
 /***************************************************************************
  *                                  _   _ ____  _
@@ -8,7 +8,7 @@
  *                            | (__| |_| |  _ <| |___
  *                             \___|\___/|_| \_\_____|
  *
- * Copyright (C) 1998 - 2006, Daniel Stenberg, <dan...@haxx.se>, et al.
+ * Copyright (C) 1998 - 2011, Daniel Stenberg, <dan...@haxx.se>, et al.
  *
  * This software is licensed as described in the file COPYING, which
  * you should have received as part of this distribution. The terms
@@ -25,5 +25,9 @@
 /* Escape and unescape URL encoding in strings. The functions return a new
  * allocated string or NULL if an error occurred.  */
 
+CURLcode Curl_urldecode(struct SessionHandle *data,
+                        const char *string, size_t length,
+                        char **ostring, size_t *olen,
+                        bool reject_crlf);
 
 #endif
diff --git a/lib/imap.c b/lib/imap.c
index 7afa753..ea232f3 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -904,17 +904,12 @@ static CURLcode imap_parse_url_path(struct connectdata 
*conn)
   struct imap_conn *imapc = &conn->proto.imapc;
   struct SessionHandle *data = conn->data;
   const char *path = data->state.path;
-  int len;
 
   if(!*path)
     path = "INBOX";
 
   /* url decode the path and use this mailbox */
-  imapc->mailbox = curl_easy_unescape(data, path, 0, &len);
-  if(!imapc->mailbox)
-    return CURLE_OUT_OF_MEMORY;
-
-  return CURLE_OK;
+  return Curl_urldecode(data, path, 0, &imapc->mailbox, NULL, TRUE);
 }
 
 /* call this when the DO phase has completed */
diff --git a/lib/pop3.c b/lib/pop3.c
index 25b4925..c1c7bfd 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -850,11 +850,7 @@ static CURLcode pop3_parse_url_path(struct connectdata 
*conn)
   const char *path = data->state.path;
 
   /* url decode the path and use this mailbox */
-  pop3c->mailbox = curl_easy_unescape(data, path, 0, NULL);
-  if (!pop3c->mailbox)
-    return CURLE_OUT_OF_MEMORY;
-
-  return CURLE_OK;
+  return Curl_urldecode(data, path, 0, &pop3c->mailbox, NULL, TRUE);
 }
 
 /* call this when the DO phase has completed */
diff --git a/lib/smtp.c b/lib/smtp.c
index 2410ceb..86e7851 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -1043,7 +1043,6 @@ static CURLcode smtp_connect(struct connectdata *conn,
   struct SessionHandle *data=conn->data;
   struct pingpong *pp=&smtpc->pp;
   const char *path = conn->data->state.path;
-  int len;
   char localhost[1024 + 1];
 
   *done = FALSE; /* default to not done yet */
@@ -1117,9 +1116,9 @@ static CURLcode smtp_connect(struct connectdata *conn,
   }
 
   /* url decode the path and use it as domain with EHLO */
-  smtpc->domain = curl_easy_unescape(conn->data, path, 0, &len);
-  if(!smtpc->domain)
-    return CURLE_OUT_OF_MEMORY;
+  result = Curl_urldecode(conn->data, path, 0, &smtpc->domain, NULL, TRUE);
+  if(result)
+    return result;
 
   /* When we connect, we start in the state where we await the server greeting
    */
-- 
1.7.7

++++++ 0003-OpenSSL-SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG-opti.patch ++++++
>From e55b66096569f4a0cd06a5e6dc2ae8aad4bfefcf Mon Sep 17 00:00:00 2001
From: Yang Tse <yangs...@gmail.com>
Date: Wed, 18 Jan 2012 04:33:49 +0100
Subject: [PATCH] OpenSSL: SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option is
 no longer enabled

SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed successfull
interoperability with web server Netscape Enterprise Server 2.0.1 released
back in 1996 more than 15 years ago.

Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has
become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
CVE-2010-4180 when using previous OpenSSL versions we no longer enable
this option regardless of OpenSSL version and SSL_OP_ALL definition.

chery-picked from commit a20daf90e358c1476a325ea665d533f7a27e3364
---
 lib/ssluse.c |   28 +++++++++++++++++++++-------
 1 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/lib/ssluse.c b/lib/ssluse.c
index 220b689..73fb8d3 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1425,6 +1425,7 @@ ossl_connect_step1(struct connectdata *conn,
   X509_LOOKUP *lookup=NULL;
   curl_socket_t sockfd = conn->sock[sockindex];
   struct ssl_connect_data *connssl = &conn->ssl[sockindex];
+  long ctx_options;
 #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
   bool sni;
 #ifdef ENABLE_IPV6
@@ -1504,20 +1505,33 @@ ossl_connect_step1(struct connectdata *conn,
      If someone writes an application with libcurl and openssl who wants to
      enable the feature, one can do this in the SSL callback.
 
+     SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG option enabling allowed proper
+     interoperability with web server Netscape Enterprise Server 2.0.1 which
+     was released back in 1996.
+
+     Due to CVE-2010-4180, option SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG has
+     become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
+     CVE-2010-4180 when using previous OpenSSL versions we no longer enable
+     this option regardless of OpenSSL version and SSL_OP_ALL definition.
   */
+
+  ctx_options = SSL_OP_ALL;
+
 #ifdef SSL_OP_NO_TICKET
-  /* expect older openssl releases to not have this define so only use it if
-     present */
-#define CURL_CTX_OPTIONS SSL_OP_ALL|SSL_OP_NO_TICKET
-#else
-#define CURL_CTX_OPTIONS SSL_OP_ALL
+  ctx_options |= SSL_OP_NO_TICKET;
 #endif
 
-  SSL_CTX_set_options(connssl->ctx, CURL_CTX_OPTIONS);
+#if defined(SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG) && \
+  (SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG == 0x00000008L)
+  /* mitigate CVE-2010-4180 */
+  ctx_options &= ~SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG;
+#endif
 
   /* disable SSLv2 in the default case (i.e. allow SSLv3 and TLSv1) */
   if(data->set.ssl.version == CURL_SSLVERSION_DEFAULT)
-    SSL_CTX_set_options(connssl->ctx, SSL_OP_NO_SSLv2);
+    ctx_options |= SSL_OP_NO_SSLv2;
+
+  SSL_CTX_set_options(connssl->ctx, ctx_options);
 
 #if 0
   /*
-- 
1.7.7

++++++ 0004-OpenSSL-don-t-disable-security-work-around.patch ++++++
>From 261656dcfd35a2b048200f84f4a1c85c1a6c7769 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <dan...@haxx.se>
Date: Thu, 19 Jan 2012 10:38:14 +0100
Subject: [PATCH] OpenSSL: don't disable security work-around

OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability
(http://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit
to SSL_OP_ALL that _disables_ that work-around despite the fact that
SSL_OP_ALL is documented to do "rather harmless" workarounds.

The libcurl code uses the SSL_OP_ALL define and thus logically always
disables the OpenSSL fix.

In order to keep the secure work-around workding, the
SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit must not be set and this change
makes sure of this.

Reported by: product-security at Apple

cherry-picked from commit 0158c2bdd51af5a7b334b4dd7360bbd7e3858409
---
 lib/ssluse.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/lib/ssluse.c b/lib/ssluse.c
index 73fb8d3..c9dfc3a 100644
--- a/lib/ssluse.c
+++ b/lib/ssluse.c
@@ -1513,6 +1513,13 @@ ossl_connect_step1(struct connectdata *conn,
      become ineffective as of OpenSSL 0.9.8q and 1.0.0c. In order to mitigate
      CVE-2010-4180 when using previous OpenSSL versions we no longer enable
      this option regardless of OpenSSL version and SSL_OP_ALL definition.
+
+     OpenSSL added a work-around for a SSL 3.0/TLS 1.0 CBC vulnerability
+     (http://www.openssl.org/~bodo/tls-cbc.txt). In 0.9.6e they added a bit to
+     SSL_OP_ALL that _disables_ that work-around despite the fact that
+     SSL_OP_ALL is documented to do "rather harmless" workarounds. In order to
+     keep the secure work-around, the SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS bit
+     must not be set.
   */
 
   ctx_options = SSL_OP_ALL;
@@ -1527,6 +1534,10 @@ ossl_connect_step1(struct connectdata *conn,
   ctx_options &= ~SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG;
 #endif
 
+#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
+  ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+#endif
+
   /* disable SSLv2 in the default case (i.e. allow SSLv3 and TLSv1) */
   if(data->set.ssl.version == CURL_SSLVERSION_DEFAULT)
     ctx_options |= SSL_OP_NO_SSLv2;
-- 
1.7.7


continue with "q"...



Remember to have fun...

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to