summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsbd <sbd@pkgsrc.org>2012-01-28 06:26:18 +0000
committersbd <sbd@pkgsrc.org>2012-01-28 06:26:18 +0000
commit309f68b7b9de9db02dae3fbc30f8607a9d97e244 (patch)
tree7a247f83f0bfff46ed35a1db93bec9062e9b7f4f
parentfe6e123c8fe3b79cbb04d5736074e78dda3298ee (diff)
downloadpkgsrc-309f68b7b9de9db02dae3fbc30f8607a9d97e244.tar.gz
Pullup ticket #3663 - requested by drochner
www/curl security update Revisions pulled up: - www/curl/Makefile 1.110 - www/curl/distinfo 1.73 - www/curl/patches/patch-ba 1.1 - www/curl/patches/patch-bb 1.1 - www/curl/patches/patch-bc 1.1 - www/curl/patches/patch-bd 1.1 - www/curl/patches/patch-be 1.1 - www/curl/patches/patch-bf 1.1 --- Module Name: pkgsrc Committed By: drochner Date: Thu Jan 26 11:25:55 UTC 2012 Modified Files: pkgsrc/www/curl: Makefile distinfo Added Files: pkgsrc/www/curl/patches: patch-ba patch-bb patch-bc patch-bd patch-be patch-bf Log Message: add patches from upstream to fix 2 security problems: -data injection attack for certain protocols (CVE-2012-0036) -SSL CBC IV vulnerability (OpenSSL related, CVE-2011-3389) bump PKGREV
-rw-r--r--www/curl/Makefile3
-rw-r--r--www/curl/distinfo8
-rw-r--r--www/curl/patches/patch-ba120
-rw-r--r--www/curl/patches/patch-bb33
-rw-r--r--www/curl/patches/patch-bc25
-rw-r--r--www/curl/patches/patch-bd19
-rw-r--r--www/curl/patches/patch-be27
-rw-r--r--www/curl/patches/patch-bf46
8 files changed, 279 insertions, 2 deletions
diff --git a/www/curl/Makefile b/www/curl/Makefile
index 9d43695dd71..62c479801d9 100644
--- a/www/curl/Makefile
+++ b/www/curl/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.109 2011/11/30 20:56:08 wiz Exp $
+# $NetBSD: Makefile,v 1.109.2.1 2012/01/28 06:26:18 sbd Exp $
DISTNAME= curl-7.23.1
+PKGREVISION= 1
CATEGORIES= www
MASTER_SITES= http://curl.haxx.se/download/ \
ftp://ftp.sunet.se/pub/www/utilities/curl/
diff --git a/www/curl/distinfo b/www/curl/distinfo
index 8bebfb89a28..3f2495d1eea 100644
--- a/www/curl/distinfo
+++ b/www/curl/distinfo
@@ -1,6 +1,12 @@
-$NetBSD: distinfo,v 1.72 2011/11/30 20:56:08 wiz Exp $
+$NetBSD: distinfo,v 1.72.2.1 2012/01/28 06:26:18 sbd Exp $
SHA1 (curl-7.23.1.tar.bz2) = 9bac69696446ead85e59d8488098ee84cf897b7e
RMD160 (curl-7.23.1.tar.bz2) = 96c45f38361d04a939e135c9e5fcf27ca1180abe
Size (curl-7.23.1.tar.bz2) = 2376653 bytes
SHA1 (patch-aa) = 14a1854429e12d0f7d0da040a09ef6d173a6dff2
+SHA1 (patch-ba) = b247fed2f7224a2d584f5370a18d8a609706859a
+SHA1 (patch-bb) = 86fd7e1d100b1991be43d3aa415be5a37a81db5f
+SHA1 (patch-bc) = 7ac1cf45003c541078b5deb96b8a373ce0631fcc
+SHA1 (patch-bd) = ab1b25ce6c5a057d6429d4ba4d79b1db27c2a3ae
+SHA1 (patch-be) = a5cf52d7ccc768c8be41e4f2ae53e90f998708a2
+SHA1 (patch-bf) = 7ae4442ea7e81293d91b7415b767708f1e2e8321
diff --git a/www/curl/patches/patch-ba b/www/curl/patches/patch-ba
new file mode 100644
index 00000000000..5dde8b3e963
--- /dev/null
+++ b/www/curl/patches/patch-ba
@@ -0,0 +1,120 @@
+$NetBSD: patch-ba,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2012-0036
+
+--- lib/escape.c.orig 2011-11-04 22:32:56.000000000 +0000
++++ lib/escape.c
+@@ -31,6 +31,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>
+@@ -84,7 +85,7 @@ char *curl_easy_escape(CURL *handle, con
+ 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;
+ CURLcode res;
+
+@@ -132,23 +133,29 @@ char *curl_easy_escape(CURL *handle, con
+ }
+
+ /*
+- * 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;
+@@ -164,16 +171,20 @@ char *curl_easy_unescape(CURL *handle, c
+
+ in = curlx_ultouc(hex); /* this long is never bigger than 255 anyway */
+
+- res = 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 +194,33 @@ char *curl_easy_unescape(CURL *handle, c
+ 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/www/curl/patches/patch-bb b/www/curl/patches/patch-bb
new file mode 100644
index 00000000000..7f45047537c
--- /dev/null
+++ b/www/curl/patches/patch-bb
@@ -0,0 +1,33 @@
+$NetBSD: patch-bb,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2012-0036
+
+--- lib/escape.h.orig 2011-03-19 15:16:07.000000000 +0000
++++ 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, <daniel@haxx.se>, et al.
++ * Copyright (C) 1998 - 2011, Daniel Stenberg, <daniel@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/www/curl/patches/patch-bc b/www/curl/patches/patch-bc
new file mode 100644
index 00000000000..1e91a633970
--- /dev/null
+++ b/www/curl/patches/patch-bc
@@ -0,0 +1,25 @@
+$NetBSD: patch-bc,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2012-0036
+
+--- lib/imap.c.orig 2011-11-04 22:32:56.000000000 +0000
++++ lib/imap.c
+@@ -947,17 +947,12 @@ static CURLcode imap_parse_url_path(stru
+ 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/www/curl/patches/patch-bd b/www/curl/patches/patch-bd
new file mode 100644
index 00000000000..080e8100ed1
--- /dev/null
+++ b/www/curl/patches/patch-bd
@@ -0,0 +1,19 @@
+$NetBSD: patch-bd,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2012-0036
+
+--- lib/pop3.c.orig 2011-11-04 22:32:56.000000000 +0000
++++ lib/pop3.c
+@@ -899,11 +899,7 @@ static CURLcode pop3_parse_url_path(stru
+ 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/www/curl/patches/patch-be b/www/curl/patches/patch-be
new file mode 100644
index 00000000000..1930af54371
--- /dev/null
+++ b/www/curl/patches/patch-be
@@ -0,0 +1,27 @@
+$NetBSD: patch-be,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2012-0036
+
+--- lib/smtp.c.orig 2011-11-04 22:32:57.000000000 +0000
++++ lib/smtp.c
+@@ -1243,7 +1243,6 @@ static CURLcode smtp_connect(struct conn
+ struct SessionHandle *data = conn->data;
+ struct pingpong *pp = &smtpc->pp;
+ const char *path = conn->data->state.path;
+- int len;
+ char localhost[HOSTNAME_MAX + 1];
+
+ *done = FALSE; /* default to not done yet */
+@@ -1315,9 +1314,9 @@ static CURLcode smtp_connect(struct 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
+ */
diff --git a/www/curl/patches/patch-bf b/www/curl/patches/patch-bf
new file mode 100644
index 00000000000..ea1bca6a4ae
--- /dev/null
+++ b/www/curl/patches/patch-bf
@@ -0,0 +1,46 @@
+$NetBSD: patch-bf,v 1.1.2.2 2012/01/28 06:26:19 sbd Exp $
+
+CVE-2011-3389
+
+--- lib/ssluse.c.orig 2011-11-06 15:58:24.000000000 +0000
++++ lib/ssluse.c
+@@ -1420,6 +1420,7 @@ ossl_connect_step1(struct connectdata *c
+ 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
+@@ -1525,16 +1526,27 @@ ossl_connect_step1(struct connectdata *c
+ If someone writes an application with libcurl and openssl who wants to
+ enable the feature, one can do this in the SSL callback.
+
++ 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;
++
+ #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
++#ifdef SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
++ ctx_options &= ~SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS;
+ #endif
+
+- SSL_CTX_set_options(connssl->ctx, CURL_CTX_OPTIONS);
++ SSL_CTX_set_options(connssl->ctx, ctx_options);
+
+ /* disable SSLv2 in the default case (i.e. allow SSLv3 and TLSv1) */
+ if(data->set.ssl.version == CURL_SSLVERSION_DEFAULT)