From 972dcfcdbfe75dcfeb777150c136576cf1a71e99 Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 9 Oct 2015 22:59:03 +0200 Subject: initial commit for Enea Linux 5.0 arm Signed-off-by: Tudor Florea --- meta/recipes-support/curl/curl/CVE-2014-3613.patch | 269 +++++++++++++ meta/recipes-support/curl/curl/CVE-2014-3620.patch | 69 ++++ meta/recipes-support/curl/curl/CVE-2014-3707.patch | 416 +++++++++++++++++++++ meta/recipes-support/curl/curl/CVE-2014-8150.patch | 29 ++ meta/recipes-support/curl/curl/CVE-2015-3143.patch | 38 ++ meta/recipes-support/curl/curl/CVE-2015-3144.patch | 45 +++ meta/recipes-support/curl/curl/CVE-2015-3145.patch | 70 ++++ meta/recipes-support/curl/curl/CVE-2015-3153.patch | 90 +++++ meta/recipes-support/curl/curl/configure_ac.patch | 13 + meta/recipes-support/curl/curl/pkgconfig_fix.patch | 32 ++ meta/recipes-support/curl/curl_7.37.1.bb | 66 ++++ 11 files changed, 1137 insertions(+) create mode 100644 meta/recipes-support/curl/curl/CVE-2014-3613.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2014-3620.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2014-3707.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2014-8150.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2015-3143.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2015-3144.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2015-3145.patch create mode 100644 meta/recipes-support/curl/curl/CVE-2015-3153.patch create mode 100644 meta/recipes-support/curl/curl/configure_ac.patch create mode 100644 meta/recipes-support/curl/curl/pkgconfig_fix.patch create mode 100644 meta/recipes-support/curl/curl_7.37.1.bb (limited to 'meta/recipes-support/curl') diff --git a/meta/recipes-support/curl/curl/CVE-2014-3613.patch b/meta/recipes-support/curl/curl/CVE-2014-3613.patch new file mode 100644 index 0000000000..3e2fee0413 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2014-3613.patch @@ -0,0 +1,269 @@ +From 545e322cc8c383ccdfb4ad85a1634c2b719a1adf Mon Sep 17 00:00:00 2001 +From: Tim Ruehsen +Date: Tue, 19 Aug 2014 21:01:28 +0200 +Subject: [PATCH] cookies: only use full host matches for hosts used as IP + address + +By not detecting and rejecting domain names for partial literal IP +addresses properly when parsing received HTTP cookies, libcurl can be +fooled to both send cookies to wrong sites and to allow arbitrary sites +to set cookies for others. + +CVE-2014-3613 + +Bug: http://curl.haxx.se/docs/adv_20140910A.html + +Upstream-Status: Backport + +Signed-off-by: Chong Lu +--- + lib/cookie.c | 50 ++++++++++++++++++++++++++++++++++++++---------- + tests/data/test1105 | 3 +-- + tests/data/test31 | 55 +++++++++++++++++++++++++++-------------------------- + tests/data/test8 | 3 ++- + 4 files changed, 71 insertions(+), 40 deletions(-) + +diff --git a/lib/cookie.c b/lib/cookie.c +index 0590643..46904ac 100644 +--- a/lib/cookie.c ++++ b/lib/cookie.c +@@ -93,10 +93,11 @@ Example set of cookies: + #include "curl_memory.h" + #include "share.h" + #include "strtoofft.h" + #include "rawstr.h" + #include "curl_memrchr.h" ++#include "inet_pton.h" + + /* The last #include file should be: */ + #include "memdebug.h" + + static void freecookie(struct Cookie *co) +@@ -317,10 +318,32 @@ static void remove_expired(struct CookieInfo *cookies) + } + co = nx; + } + } + ++/* ++ * Return true if the given string is an IP(v4|v6) address. ++ */ ++static bool isip(const char *domain) ++{ ++ struct in_addr addr; ++#ifdef ENABLE_IPV6 ++ struct in6_addr addr6; ++#endif ++ ++ if(Curl_inet_pton(AF_INET, domain, &addr) ++#ifdef ENABLE_IPV6 ++ || Curl_inet_pton(AF_INET6, domain, &addr6) ++#endif ++ ) { ++ /* domain name given as IP address */ ++ return TRUE; ++ } ++ ++ return FALSE; ++} ++ + /**************************************************************************** + * + * Curl_cookie_add() + * + * Add a single cookie line to the cookie keeping object. +@@ -437,28 +460,31 @@ Curl_cookie_add(struct SessionHandle *data, + badcookie = TRUE; /* out of memory bad */ + break; + } + } + else if(Curl_raw_equal("domain", name)) { ++ bool is_ip; ++ + /* Now, we make sure that our host is within the given domain, + or the given domain is not valid and thus cannot be set. */ + + if('.' == whatptr[0]) + whatptr++; /* ignore preceding dot */ + +- if(!domain || tailmatch(whatptr, domain)) { +- const char *tailptr=whatptr; +- if(tailptr[0] == '.') +- tailptr++; +- strstore(&co->domain, tailptr); /* don't prefix w/dots +- internally */ ++ is_ip = isip(domain ? domain : whatptr); ++ ++ if(!domain ++ || (is_ip && !strcmp(whatptr, domain)) ++ || (!is_ip && tailmatch(whatptr, domain))) { ++ strstore(&co->domain, whatptr); + if(!co->domain) { + badcookie = TRUE; + break; + } +- co->tailmatch=TRUE; /* we always do that if the domain name was +- given */ ++ if(!is_ip) ++ co->tailmatch=TRUE; /* we always do that if the domain name was ++ given */ + } + else { + /* we did not get a tailmatch and then the attempted set domain + is not a domain to which the current host belongs. Mark as + bad. */ +@@ -966,17 +992,21 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c, + struct Cookie *newco; + struct Cookie *co; + time_t now = time(NULL); + struct Cookie *mainco=NULL; + size_t matches = 0; ++ bool is_ip; + + if(!c || !c->cookies) + return NULL; /* no cookie struct or no cookies in the struct */ + + /* at first, remove expired cookies */ + remove_expired(c); + ++ /* check if host is an IP(v4|v6) address */ ++ is_ip = isip(host); ++ + co = c->cookies; + + while(co) { + /* only process this cookie if it is not expired or had no expire + date AND that if the cookie requires we're secure we must only +@@ -984,12 +1014,12 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c, + if((!co->expires || (co->expires > now)) && + (co->secure?secure:TRUE)) { + + /* now check if the domain is correct */ + if(!co->domain || +- (co->tailmatch && tailmatch(co->domain, host)) || +- (!co->tailmatch && Curl_raw_equal(host, co->domain)) ) { ++ (co->tailmatch && !is_ip && tailmatch(co->domain, host)) || ++ ((!co->tailmatch || is_ip) && Curl_raw_equal(host, co->domain)) ) { + /* the right part of the host matches the domain stuff in the + cookie data */ + + /* now check the left part of the path with the cookies path + requirement */ +diff --git a/tests/data/test1105 b/tests/data/test1105 +index 25f194c..9564775 100644 +--- a/tests/data/test1105 ++++ b/tests/data/test1105 +@@ -57,10 +57,9 @@ userid=myname&password=mypassword + # Netscape HTTP Cookie File + # http://curl.haxx.se/docs/http-cookies.html + # This file was generated by libcurl! Edit at your own risk. + + 127.0.0.1 FALSE /we/want/ FALSE 0 foobar name +-.127.0.0.1 TRUE "/silly/" FALSE 0 mismatch this +-.0.0.1 TRUE / FALSE 0 partmatch present ++127.0.0.1 FALSE "/silly/" FALSE 0 mismatch this + + + +diff --git a/tests/data/test31 b/tests/data/test31 +index 38af83b..dfcac04 100644 +--- a/tests/data/test31 ++++ b/tests/data/test31 +@@ -49,11 +49,12 @@ Set-Cookie: nodomainnovalue + Set-Cookie: nodomain=value; expires=Fri Feb 2 11:56:27 GMT 2035 + Set-Cookie: novalue; domain=reallysilly + Set-Cookie: test=yes; domain=foo.com; expires=Sat Feb 2 11:56:27 GMT 2030 + Set-Cookie: test2=yes; domain=se; expires=Sat Feb 2 11:56:27 GMT 2030 + Set-Cookie: magic=yessir; path=/silly/; HttpOnly +-Set-Cookie: blexp=yesyes; domain=.0.0.1; domain=.0.0.1; expiry=totally bad; ++Set-Cookie: blexp=yesyes; domain=127.0.0.1; domain=127.0.0.1; expiry=totally bad; ++Set-Cookie: partialip=nono; domain=.0.0.1; + + boo + + + +@@ -93,36 +94,36 @@ Accept: */* + + # Netscape HTTP Cookie File + # http://curl.haxx.se/docs/http-cookies.html + # This file was generated by libcurl! Edit at your own risk. + +-.127.0.0.1 TRUE /silly/ FALSE 0 ismatch this +-.127.0.0.1 TRUE /overwrite FALSE 0 overwrite this2 +-.127.0.0.1 TRUE /secure1/ TRUE 0 sec1value secure1 +-.127.0.0.1 TRUE /secure2/ TRUE 0 sec2value secure2 +-.127.0.0.1 TRUE /secure3/ TRUE 0 sec3value secure3 +-.127.0.0.1 TRUE /secure4/ TRUE 0 sec4value secure4 +-.127.0.0.1 TRUE /secure5/ TRUE 0 sec5value secure5 +-.127.0.0.1 TRUE /secure6/ TRUE 0 sec6value secure6 +-.127.0.0.1 TRUE /secure7/ TRUE 0 sec7value secure7 +-.127.0.0.1 TRUE /secure8/ TRUE 0 sec8value secure8 +-.127.0.0.1 TRUE /secure9/ TRUE 0 secure very1 +-#HttpOnly_.127.0.0.1 TRUE /p1/ FALSE 0 httpo1 value1 +-#HttpOnly_.127.0.0.1 TRUE /p2/ FALSE 0 httpo2 value2 +-#HttpOnly_.127.0.0.1 TRUE /p3/ FALSE 0 httpo3 value3 +-#HttpOnly_.127.0.0.1 TRUE /p4/ FALSE 0 httpo4 value4 +-#HttpOnly_.127.0.0.1 TRUE /p4/ FALSE 0 httponly myvalue1 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec myvalue2 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec2 myvalue3 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec3 myvalue4 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec4 myvalue5 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec5 myvalue6 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec6 myvalue7 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec7 myvalue8 +-#HttpOnly_.127.0.0.1 TRUE /p4/ TRUE 0 httpandsec8 myvalue9 +-.127.0.0.1 TRUE / FALSE 0 partmatch present ++127.0.0.1 FALSE /silly/ FALSE 0 ismatch this ++127.0.0.1 FALSE /overwrite FALSE 0 overwrite this2 ++127.0.0.1 FALSE /secure1/ TRUE 0 sec1value secure1 ++127.0.0.1 FALSE /secure2/ TRUE 0 sec2value secure2 ++127.0.0.1 FALSE /secure3/ TRUE 0 sec3value secure3 ++127.0.0.1 FALSE /secure4/ TRUE 0 sec4value secure4 ++127.0.0.1 FALSE /secure5/ TRUE 0 sec5value secure5 ++127.0.0.1 FALSE /secure6/ TRUE 0 sec6value secure6 ++127.0.0.1 FALSE /secure7/ TRUE 0 sec7value secure7 ++127.0.0.1 FALSE /secure8/ TRUE 0 sec8value secure8 ++127.0.0.1 FALSE /secure9/ TRUE 0 secure very1 ++#HttpOnly_127.0.0.1 FALSE /p1/ FALSE 0 httpo1 value1 ++#HttpOnly_127.0.0.1 FALSE /p2/ FALSE 0 httpo2 value2 ++#HttpOnly_127.0.0.1 FALSE /p3/ FALSE 0 httpo3 value3 ++#HttpOnly_127.0.0.1 FALSE /p4/ FALSE 0 httpo4 value4 ++#HttpOnly_127.0.0.1 FALSE /p4/ FALSE 0 httponly myvalue1 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec myvalue2 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec2 myvalue3 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec3 myvalue4 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec4 myvalue5 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec5 myvalue6 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec6 myvalue7 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec7 myvalue8 ++#HttpOnly_127.0.0.1 FALSE /p4/ TRUE 0 httpandsec8 myvalue9 ++127.0.0.1 FALSE / FALSE 0 partmatch present + 127.0.0.1 FALSE /we/want/ FALSE 2054030187 nodomain value + #HttpOnly_127.0.0.1 FALSE /silly/ FALSE 0 magic yessir +-.0.0.1 TRUE /we/want/ FALSE 0 blexp yesyes ++127.0.0.1 FALSE /we/want/ FALSE 0 blexp yesyes + + + +diff --git a/tests/data/test8 b/tests/data/test8 +index 4d54541..030fd55 100644 +--- a/tests/data/test8 ++++ b/tests/data/test8 +@@ -40,11 +40,12 @@ Set-Cookie: mismatch=this; domain=%HOSTIP; path="/silly/"; + Set-Cookie: partmatch=present; domain=.0.0.1; path=/w; + Set-Cookie: duplicate=test; domain=.0.0.1; domain=.0.0.1; path=/donkey; + Set-Cookie: cookie=yes; path=/we; + Set-Cookie: cookie=perhaps; path=/we/want; + Set-Cookie: nocookie=yes; path=/WE; +-Set-Cookie: blexp=yesyes; domain=.0.0.1; domain=.0.0.1; expiry=totally bad; ++Set-Cookie: blexp=yesyes; domain=%HOSTIP; domain=%HOSTIP; expiry=totally bad; ++Set-Cookie: partialip=nono; domain=.0.0.1; + + + + perl -e 'if ("%HOSTIP" !~ /\.0\.0\.1$/) {print "Test only works for HOSTIPs ending with .0.0.1"; exit(1)}' + +-- +2.1.0 + diff --git a/meta/recipes-support/curl/curl/CVE-2014-3620.patch b/meta/recipes-support/curl/curl/CVE-2014-3620.patch new file mode 100644 index 0000000000..d11f1908af --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2014-3620.patch @@ -0,0 +1,69 @@ +From fd7ae600adf23a9a1ed619165c5058bdec216e9c Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Tue, 19 Aug 2014 21:11:20 +0200 +Subject: [PATCH] cookies: reject incoming cookies set for TLDs + +Test 61 was modified to verify this. + +CVE-2014-3620 + +Reported-by: Tim Ruehsen +URL: http://curl.haxx.se/docs/adv_20140910B.html + +Upstream-Status: Backport + +Signed-off-by: Chong Lu +--- + lib/cookie.c | 6 ++++++ + tests/data/test61 | 1 + + 2 files changed, 7 insertions(+) + +diff --git a/lib/cookie.c b/lib/cookie.c +index 46904ac..375485f 100644 +--- a/lib/cookie.c ++++ b/lib/cookie.c +@@ -461,19 +461,25 @@ Curl_cookie_add(struct SessionHandle *data, + break; + } + } + else if(Curl_raw_equal("domain", name)) { + bool is_ip; ++ const char *dotp; + + /* Now, we make sure that our host is within the given domain, + or the given domain is not valid and thus cannot be set. */ + + if('.' == whatptr[0]) + whatptr++; /* ignore preceding dot */ + + is_ip = isip(domain ? domain : whatptr); + ++ /* check for more dots */ ++ dotp = strchr(whatptr, '.'); ++ if(!dotp) ++ domain=":"; ++ + if(!domain + || (is_ip && !strcmp(whatptr, domain)) + || (!is_ip && tailmatch(whatptr, domain))) { + strstore(&co->domain, whatptr); + if(!co->domain) { +diff --git a/tests/data/test61 b/tests/data/test61 +index d2de279..e6dbbb9 100644 +--- a/tests/data/test61 ++++ b/tests/data/test61 +@@ -21,10 +21,11 @@ Set-Cookie: test=yes; httponly; domain=foo.com; expires=Fri Feb 2 11:56:27 GMT 2 + SET-COOKIE: test2=yes; domain=host.foo.com; expires=Fri Feb 2 11:56:27 GMT 2035 + Set-Cookie: test3=maybe; domain=foo.com; path=/moo; secure + Set-Cookie: test4=no; domain=nope.foo.com; path=/moo; secure + Set-Cookie: test5=name; domain=anything.com; path=/ ; secure + Set-Cookie: fake=fooledyou; domain=..com; path=/; ++Set-Cookie: supercookie=fooledyou; domain=.com; path=/;^M + Content-Length: 4 + + boo + + +-- +2.1.0 + diff --git a/meta/recipes-support/curl/curl/CVE-2014-3707.patch b/meta/recipes-support/curl/curl/CVE-2014-3707.patch new file mode 100644 index 0000000000..7ff38a65e8 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2014-3707.patch @@ -0,0 +1,416 @@ +From 3696fc1ba79d9b34660c44150be5e93ecf87dd9e Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Fri, 17 Oct 2014 12:59:32 +0200 +Subject: [PATCH] curl_easy_duphandle: CURLOPT_COPYPOSTFIELDS read out of + bounds + +When duplicating a handle, the data to post was duplicated using +strdup() when it could be binary and contain zeroes and it was not even +zero terminated! This caused read out of bounds crashes/segfaults. + +Since the lib/strdup.c file no longer is easily shared with the curl +tool with this change, it now uses its own version instead. + +Bug: http://curl.haxx.se/docs/adv_20141105.html +CVE: CVE-2014-3707 +Reported-By: Symeon Paraschoudis +--- + lib/formdata.c | 52 +++++++++------------------------------------------- + lib/strdup.c | 32 +++++++++++++++++++++++++++----- + lib/strdup.h | 3 ++- + lib/url.c | 22 +++++++++++++++++----- + lib/urldata.h | 11 +++++++++-- + src/Makefile.inc | 4 ++-- + src/tool_setup.h | 5 ++--- + src/tool_strdup.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + src/tool_strdup.h | 30 ++++++++++++++++++++++++++++++ + 9 files changed, 145 insertions(+), 61 deletions(-) + create mode 100644 src/tool_strdup.c + create mode 100644 src/tool_strdup.h + +Index: curl-7.37.1/lib/formdata.c +=================================================================== +--- curl-7.37.1.orig/lib/formdata.c ++++ curl-7.37.1/lib/formdata.c +@@ -36,6 +36,7 @@ + #include "strequal.h" + #include "curl_memory.h" + #include "sendf.h" ++#include "strdup.h" + + #define _MPRINTF_REPLACE /* use our functions only */ + #include +@@ -214,46 +215,6 @@ static const char *ContentTypeForFilenam + + /*************************************************************************** + * +- * memdup() +- * +- * Copies the 'source' data to a newly allocated buffer buffer (that is +- * returned). Uses buffer_length if not null, else uses strlen to determine +- * the length of the buffer to be copied +- * +- * Returns the new pointer or NULL on failure. +- * +- ***************************************************************************/ +-static char *memdup(const char *src, size_t buffer_length) +-{ +- size_t length; +- bool add = FALSE; +- char *buffer; +- +- if(buffer_length) +- length = buffer_length; +- else if(src) { +- length = strlen(src); +- add = TRUE; +- } +- else +- /* no length and a NULL src pointer! */ +- return strdup(""); +- +- buffer = malloc(length+add); +- if(!buffer) +- return NULL; /* fail */ +- +- memcpy(buffer, src, length); +- +- /* if length unknown do null termination */ +- if(add) +- buffer[length] = '\0'; +- +- return buffer; +-} +- +-/*************************************************************************** +- * + * FormAdd() + * + * Stores a formpost parameter and builds the appropriate linked list. +@@ -682,9 +643,12 @@ CURLFORMcode FormAdd(struct curl_httppos + (form == first_form) ) { + /* Note that there's small risk that form->name is NULL here if the + app passed in a bad combo, so we better check for that first. */ +- if(form->name) ++ if(form->name) { + /* copy name (without strdup; possibly contains null characters) */ +- form->name = memdup(form->name, form->namelength); ++ form->name = Curl_memdup(form->name, form->namelength? ++ form->namelength: ++ strlen(form->name)+1); ++ } + if(!form->name) { + return_value = CURL_FORMADD_MEMORY; + break; +@@ -695,7 +659,7 @@ CURLFORMcode FormAdd(struct curl_httppos + HTTPPOST_PTRCONTENTS | HTTPPOST_PTRBUFFER | + HTTPPOST_CALLBACK)) ) { + /* copy value (without strdup; possibly contains null characters) */ +- form->value = memdup(form->value, form->contentslength); ++ form->value = Curl_memdup(form->value, form->contentslength); + if(!form->value) { + return_value = CURL_FORMADD_MEMORY; + break; +Index: curl-7.37.1/lib/strdup.c +=================================================================== +--- curl-7.37.1.orig/lib/strdup.c ++++ curl-7.37.1/lib/strdup.c +@@ -5,7 +5,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -19,12 +19,12 @@ + * KIND, either express or implied. + * + ***************************************************************************/ +-/* +- * This file is 'mem-include-scan' clean. See test 1132. +- */ + #include "curl_setup.h" +- + #include "strdup.h" ++#include "curl_memory.h" ++ ++/* The last #include file should be: */ ++#include "memdebug.h" + + #ifndef HAVE_STRDUP + char *curlx_strdup(const char *str) +@@ -50,3 +50,25 @@ char *curlx_strdup(const char *str) + + } + #endif ++ ++/*************************************************************************** ++ * ++ * Curl_memdup(source, length) ++ * ++ * Copies the 'source' data to a newly allocated buffer (that is ++ * returned). Copies 'length' bytes. ++ * ++ * Returns the new pointer or NULL on failure. ++ * ++ ***************************************************************************/ ++char *Curl_memdup(const char *src, size_t length) ++{ ++ char *buffer = malloc(length); ++ if(!buffer) ++ return NULL; /* fail */ ++ ++ memcpy(buffer, src, length); ++ ++ /* if length unknown do null termination */ ++ return buffer; ++} +Index: curl-7.37.1/lib/strdup.h +=================================================================== +--- curl-7.37.1.orig/lib/strdup.h ++++ curl-7.37.1/lib/strdup.h +@@ -7,7 +7,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2010, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -26,5 +26,6 @@ + #ifndef HAVE_STRDUP + extern char *curlx_strdup(const char *str); + #endif ++char *Curl_memdup(const char *src, size_t buffer_length); + + #endif /* HEADER_CURL_STRDUP_H */ +Index: curl-7.37.1/lib/url.c +=================================================================== +--- curl-7.37.1.orig/lib/url.c ++++ curl-7.37.1/lib/url.c +@@ -125,6 +125,7 @@ int curl_win32_idn_to_ascii(const char * + #include "multihandle.h" + #include "pipeline.h" + #include "dotdot.h" ++#include "strdup.h" + + #define _MPRINTF_REPLACE /* use our functions only */ + #include +@@ -270,8 +271,9 @@ void Curl_freeset(struct SessionHandle * + { + /* Free all dynamic strings stored in the data->set substructure. */ + enum dupstring i; +- for(i=(enum dupstring)0; i < STRING_LAST; i++) ++ for(i=(enum dupstring)0; i < STRING_LAST; i++) { + Curl_safefree(data->set.str[i]); ++ } + + if(data->change.referer_alloc) { + Curl_safefree(data->change.referer); +@@ -356,14 +358,24 @@ CURLcode Curl_dupset(struct SessionHandl + memset(dst->set.str, 0, STRING_LAST * sizeof(char *)); + + /* duplicate all strings */ +- for(i=(enum dupstring)0; i< STRING_LAST; i++) { ++ for(i=(enum dupstring)0; i< STRING_LASTZEROTERMINATED; i++) { + r = setstropt(&dst->set.str[i], src->set.str[i]); + if(r != CURLE_OK) +- break; ++ return r; + } + +- /* If a failure occurred, freeing has to be performed externally. */ +- return r; ++ /* duplicate memory areas pointed to */ ++ i = STRING_COPYPOSTFIELDS; ++ if(src->set.postfieldsize && src->set.str[i]) { ++ /* postfieldsize is curl_off_t, Curl_memdup() takes a size_t ... */ ++ dst->set.str[i] = Curl_memdup(src->set.str[i], src->set.postfieldsize); ++ if(!dst->set.str[i]) ++ return CURLE_OUT_OF_MEMORY; ++ /* point to the new copy */ ++ dst->set.postfields = dst->set.str[i]; ++ } ++ ++ return CURLE_OK; + } + + /* +Index: curl-7.37.1/lib/urldata.h +=================================================================== +--- curl-7.37.1.orig/lib/urldata.h ++++ curl-7.37.1/lib/urldata.h +@@ -1359,7 +1359,6 @@ enum dupstring { + STRING_KRB_LEVEL, /* krb security level */ + STRING_NETRC_FILE, /* if not NULL, use this instead of trying to find + $HOME/.netrc */ +- STRING_COPYPOSTFIELDS, /* if POST, set the fields' values here */ + STRING_PROXY, /* proxy to use */ + STRING_SET_RANGE, /* range, if used */ + STRING_SET_REFERER, /* custom string for the HTTP referer field */ +@@ -1401,7 +1400,15 @@ enum dupstring { + + STRING_BEARER, /* , if used */ + +- /* -- end of strings -- */ ++ /* -- end of zero-terminated strings -- */ ++ ++ STRING_LASTZEROTERMINATED, ++ ++ /* -- below this are pointers to binary data that cannot be strdup'ed. ++ Each such pointer must be added manually to Curl_dupset() --- */ ++ ++ STRING_COPYPOSTFIELDS, /* if POST, set the fields' values here */ ++ + STRING_LAST /* not used, just an end-of-list marker */ + }; + +Index: curl-7.37.1/src/Makefile.inc +=================================================================== +--- curl-7.37.1.orig/src/Makefile.inc ++++ curl-7.37.1/src/Makefile.inc +@@ -11,7 +11,6 @@ + # the official API, but we re-use the code here to avoid duplication. + CURLX_CFILES = \ + ../lib/strtoofft.c \ +- ../lib/strdup.c \ + ../lib/rawstr.c \ + ../lib/nonblock.c \ + ../lib/warnless.c +@@ -19,7 +18,6 @@ CURLX_CFILES = \ + CURLX_HFILES = \ + ../lib/curl_setup.h \ + ../lib/strtoofft.h \ +- ../lib/strdup.h \ + ../lib/rawstr.h \ + ../lib/nonblock.h \ + ../lib/warnless.h +@@ -55,6 +53,7 @@ CURL_CFILES = \ + tool_panykey.c \ + tool_paramhlp.c \ + tool_parsecfg.c \ ++ tool_strdup.c \ + tool_setopt.c \ + tool_sleep.c \ + tool_urlglob.c \ +@@ -99,6 +98,7 @@ CURL_HFILES = \ + tool_setopt.h \ + tool_setup.h \ + tool_sleep.h \ ++ tool_strdup.h \ + tool_urlglob.h \ + tool_util.h \ + tool_version.h \ +Index: curl-7.37.1/src/tool_setup.h +=================================================================== +--- curl-7.37.1.orig/src/tool_setup.h ++++ curl-7.37.1/src/tool_setup.h +@@ -7,7 +7,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -67,8 +67,7 @@ + #endif + + #ifndef HAVE_STRDUP +-# include "strdup.h" +-# define strdup(ptr) curlx_strdup(ptr) ++# include "tool_strdup.h" + #endif + + #endif /* HEADER_CURL_TOOL_SETUP_H */ +Index: curl-7.37.1/src/tool_strdup.c +=================================================================== +--- /dev/null ++++ curl-7.37.1/src/tool_strdup.c +@@ -0,0 +1,47 @@ ++/*************************************************************************** ++ * _ _ ____ _ ++ * Project ___| | | | _ \| | ++ * / __| | | | |_) | | ++ * | (__| |_| | _ <| |___ ++ * \___|\___/|_| \_\_____| ++ * ++ * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. ++ * ++ * This software is licensed as described in the file COPYING, which ++ * you should have received as part of this distribution. The terms ++ * are also available at http://curl.haxx.se/docs/copyright.html. ++ * ++ * You may opt to use, copy, modify, merge, publish, distribute and/or sell ++ * copies of the Software, and permit persons to whom the Software is ++ * furnished to do so, under the terms of the COPYING file. ++ * ++ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY ++ * KIND, either express or implied. ++ * ++ ***************************************************************************/ ++#include "strdup.h" ++ ++#ifndef HAVE_STRDUP ++char *strdup(const char *str) ++{ ++ size_t len; ++ char *newstr; ++ ++ if(!str) ++ return (char *)NULL; ++ ++ len = strlen(str); ++ ++ if(len >= ((size_t)-1) / sizeof(char)) ++ return (char *)NULL; ++ ++ newstr = malloc((len+1)*sizeof(char)); ++ if(!newstr) ++ return (char *)NULL; ++ ++ memcpy(newstr,str,(len+1)*sizeof(char)); ++ ++ return newstr; ++ ++} ++#endif +Index: curl-7.37.1/src/tool_strdup.h +=================================================================== +--- /dev/null ++++ curl-7.37.1/src/tool_strdup.h +@@ -0,0 +1,30 @@ ++#ifndef HEADER_TOOL_STRDUP_H ++#define HEADER_TOOL_STRDUP_H ++/*************************************************************************** ++ * _ _ ____ _ ++ * Project ___| | | | _ \| | ++ * / __| | | | |_) | | ++ * | (__| |_| | _ <| |___ ++ * \___|\___/|_| \_\_____| ++ * ++ * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. ++ * ++ * This software is licensed as described in the file COPYING, which ++ * you should have received as part of this distribution. The terms ++ * are also available at http://curl.haxx.se/docs/copyright.html. ++ * ++ * You may opt to use, copy, modify, merge, publish, distribute and/or sell ++ * copies of the Software, and permit persons to whom the Software is ++ * furnished to do so, under the terms of the COPYING file. ++ * ++ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY ++ * KIND, either express or implied. ++ * ++ ***************************************************************************/ ++#include "tool_setup.h" ++ ++#ifndef HAVE_STRDUP ++extern char *strdup(const char *str); ++#endif ++ ++#endif /* HEADER_TOOL_STRDUP_H */ diff --git a/meta/recipes-support/curl/curl/CVE-2014-8150.patch b/meta/recipes-support/curl/curl/CVE-2014-8150.patch new file mode 100644 index 0000000000..9a0828076c --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2014-8150.patch @@ -0,0 +1,29 @@ +From 4e2ac2afa94f014a2a015c48c678e2367a63ae82 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Thu, 25 Dec 2014 23:55:03 +0100 +Subject: [PATCH] url-parsing: reject CRLFs within URLs + +Bug: http://curl.haxx.se/docs/adv_20150108B.html +Reported-by: Andrey Labunets +--- + lib/url.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +Index: curl-7.37.1/lib/url.c +=================================================================== +--- curl-7.37.1.orig/lib/url.c ++++ curl-7.37.1/lib/url.c +@@ -3756,6 +3756,13 @@ static CURLcode parseurlandfillconn(stru + + *prot_missing = FALSE; + ++ /* We might pass the entire URL into the request so we need to make sure ++ * there are no bad characters in there.*/ ++ if(strpbrk(data->change.url, "\r\n")) { ++ failf(data, "Illegal characters found in URL"); ++ return CURLE_URL_MALFORMAT; ++ } ++ + /************************************************************* + * Parse the URL. + * diff --git a/meta/recipes-support/curl/curl/CVE-2015-3143.patch b/meta/recipes-support/curl/curl/CVE-2015-3143.patch new file mode 100644 index 0000000000..745e9456f3 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2015-3143.patch @@ -0,0 +1,38 @@ +From d7d1bc8f08eea1a85ab0d794bc1561659462d937 Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Thu, 16 Apr 2015 13:26:46 +0200 +Subject: [PATCH] ConnectionExists: for NTLM re-use, require credentials to + match + +Upstream-Status: Backport + +CVE-2015-3143 + +Bug: http://curl.haxx.se/docs/adv_20150422A.html +Reported-by: Paras Sethia +Signed-off-by: Daniel Stenberg +Signed-off-by: Maxin B. John +--- + lib/url.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/url.c b/lib/url.c +index 018bb88..ee3d176 100644 +--- a/lib/url.c ++++ b/lib/url.c +@@ -3207,11 +3207,11 @@ ConnectionExists(struct SessionHandle *data, + strcmp(check->localdev, needle->localdev)) + continue; + } + + if((!(needle->handler->flags & PROTOPT_CREDSPERREQUEST)) || +- wantNTLMhttp) { ++ (wantNTLMhttp || check->ntlm.state != NTLMSTATE_NONE)) { + /* This protocol requires credentials per connection or is HTTP+NTLM, + so verify that we're using the same name and password as well */ + if(!strequal(needle->user, check->user) || + !strequal(needle->passwd, check->passwd)) { + /* one of them was different */ +-- +2.1.4 + diff --git a/meta/recipes-support/curl/curl/CVE-2015-3144.patch b/meta/recipes-support/curl/curl/CVE-2015-3144.patch new file mode 100644 index 0000000000..ca6d7448a1 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2015-3144.patch @@ -0,0 +1,45 @@ +From 6218ded6001ea330e589f92b6b2fa12777752b5d Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Thu, 16 Apr 2015 23:52:04 +0200 +Subject: [PATCH] fix_hostname: zero length host name caused -1 index offset +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Backport + +If a URL is given with a zero-length host name, like in "http://:80" or +just ":80", `fix_hostname()` will index the host name pointer with a -1 +offset (as it blindly assumes a non-zero length) and both read and +assign that address. + +CVE-2015-3144 + +Bug: http://curl.haxx.se/docs/adv_20150422D.html +Reported-by: Hanno Böck +Signed-off-by: Daniel Stenberg +Signed-off-by: Maxin B. John +--- + lib/url.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lib/url.c b/lib/url.c +index ee3d176..f033dbc 100644 +--- a/lib/url.c ++++ b/lib/url.c +@@ -3625,11 +3625,11 @@ static void fix_hostname(struct SessionHandle *data, + + /* set the name we use to display the host name */ + host->dispname = host->name; + + len = strlen(host->name); +- if(host->name[len-1] == '.') ++ if(len && (host->name[len-1] == '.')) + /* strip off a single trailing dot if present, primarily for SNI but + there's no use for it */ + host->name[len-1]=0; + + if(!is_ASCII_name(host->name)) { +-- +2.1.4 + diff --git a/meta/recipes-support/curl/curl/CVE-2015-3145.patch b/meta/recipes-support/curl/curl/CVE-2015-3145.patch new file mode 100644 index 0000000000..15a998289e --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2015-3145.patch @@ -0,0 +1,70 @@ +From ea595c516bc936a514753597aa6c59fd6eb0765e Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Thu, 16 Apr 2015 16:37:40 +0200 +Subject: [PATCH] cookie: cookie parser out of boundary memory access +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream-Status: Backport + +The internal libcurl function called sanitize_cookie_path() that cleans +up the path element as given to it from a remote site or when read from +a file, did not properly validate the input. If given a path that +consisted of a single double-quote, libcurl would index a newly +allocated memory area with index -1 and assign a zero to it, thus +destroying heap memory it wasn't supposed to. + +CVE-2015-3145 + +Bug: http://curl.haxx.se/docs/adv_20150422C.html +Reported-by: Hanno Böck +Signed-off-by: Daniel Stenberg +Signed-off-by: Maxin B. John +--- + lib/cookie.c | 12 +++++++----- + 1 file changed, 7 insertions(+), 5 deletions(-) + +diff --git a/lib/cookie.c b/lib/cookie.c +index 0864f6b..0127926 100644 +--- a/lib/cookie.c ++++ b/lib/cookie.c +@@ -223,15 +223,18 @@ static char *sanitize_cookie_path(const char *cookie_path) + char *new_path = strdup(cookie_path); + if(!new_path) + return NULL; + + /* some stupid site sends path attribute with '"'. */ ++ len = strlen(new_path); + if(new_path[0] == '\"') { +- memmove((void *)new_path, (const void *)(new_path + 1), strlen(new_path)); ++ memmove((void *)new_path, (const void *)(new_path + 1), len); ++ len--; + } +- if(new_path[strlen(new_path) - 1] == '\"') { +- new_path[strlen(new_path) - 1] = 0x0; ++ if(len && (new_path[len - 1] == '\"')) { ++ new_path[len - 1] = 0x0; ++ len--; + } + + /* RFC6265 5.2.4 The Path Attribute */ + if(new_path[0] != '/') { + /* Let cookie-path be the default-path. */ +@@ -239,12 +242,11 @@ static char *sanitize_cookie_path(const char *cookie_path) + new_path = strdup("/"); + return new_path; + } + + /* convert /hoge/ to /hoge */ +- len = strlen(new_path); +- if(1 < len && new_path[len - 1] == '/') { ++ if(len && new_path[len - 1] == '/') { + new_path[len - 1] = 0x0; + } + + return new_path; + } +-- +2.1.4 + diff --git a/meta/recipes-support/curl/curl/CVE-2015-3153.patch b/meta/recipes-support/curl/curl/CVE-2015-3153.patch new file mode 100644 index 0000000000..089020a842 --- /dev/null +++ b/meta/recipes-support/curl/curl/CVE-2015-3153.patch @@ -0,0 +1,90 @@ +From 69a2e8d7ec581695a62527cb2252e7350f314ffa Mon Sep 17 00:00:00 2001 +From: Daniel Stenberg +Date: Thu, 23 Apr 2015 15:58:21 +0200 +Subject: [PATCH] CURLOPT_HEADEROPT: default to separate + +Make the HTTP headers separated by default for improved security and +reduced risk for information leakage. + +Bug: http://curl.haxx.se/docs/adv_20150429.html +Reported-by: Yehezkel Horowitz, Oren Souroujon +--- + docs/libcurl/opts/CURLOPT_HEADEROPT.3 | 12 ++++++------ + lib/url.c | 1 + + tests/data/test1527 | 2 +- + tests/data/test287 | 2 +- + tests/libtest/lib1527.c | 1 + + 5 files changed, 10 insertions(+), 8 deletions(-) + +Index: curl-7.37.1/docs/libcurl/opts/CURLOPT_HEADEROPT.3 +=================================================================== +--- curl-7.37.1.orig/docs/libcurl/opts/CURLOPT_HEADEROPT.3 ++++ curl-7.37.1/docs/libcurl/opts/CURLOPT_HEADEROPT.3 +@@ -5,7 +5,7 @@ + .\" * | (__| |_| | _ <| |___ + .\" * \___|\___/|_| \_\_____| + .\" * +-.\" * Copyright (C) 1998 - 2014, Daniel Stenberg, , et al. ++.\" * Copyright (C) 1998 - 2015, Daniel Stenberg, , et al. + .\" * + .\" * This software is licensed as described in the file COPYING, which + .\" * you should have received as part of this distribution. The terms +@@ -44,7 +44,7 @@ headers. When doing CONNECT, libcurl wil + headers only do the proxy and then \fICURLOPT_HTTPHEADER(3)\fP headers only to + the server. + .SH DEFAULT +-CURLHEADER_UNIFIED ++CURLHEADER_SEPARATE (changed in 7.42.1, ased CURLHEADER_UNIFIED before then) + .SH PROTOCOLS + HTTP + .SH EXAMPLE +Index: curl-7.37.1/tests/data/test1527 +=================================================================== +--- curl-7.37.1.orig/tests/data/test1527 ++++ curl-7.37.1/tests/data/test1527 +@@ -45,7 +45,7 @@ http-proxy + lib1527 + + +-Check same headers are generated without CURLOPT_PROXYHEADER ++Check same headers are generated with CURLOPT_HEADEROPT == CURLHEADER_UNIFIED + + + http://the.old.moo.1527:%HTTPPORT/1527 %HOSTIP:%PROXYPORT +Index: curl-7.37.1/tests/data/test287 +=================================================================== +--- curl-7.37.1.orig/tests/data/test287 ++++ curl-7.37.1/tests/data/test287 +@@ -28,7 +28,7 @@ http + HTTP proxy CONNECT with custom User-Agent header + + +-http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2007" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel ++http://test.remote.example.com.287:%HTTPPORT/path/287 -H "User-Agent: looser/2015" --proxy http://%HOSTIP:%HTTPPORT --proxytunnel --proxy-header "User-Agent: looser/2007" + + + +Index: curl-7.37.1/tests/libtest/lib1527.c +=================================================================== +--- curl-7.37.1.orig/tests/libtest/lib1527.c ++++ curl-7.37.1/tests/libtest/lib1527.c +@@ -83,6 +83,7 @@ int test(char *URL) + test_setopt(curl, CURLOPT_READFUNCTION, read_callback); + test_setopt(curl, CURLOPT_HTTPPROXYTUNNEL, 1L); + test_setopt(curl, CURLOPT_INFILESIZE, strlen(data)); ++ test_setopt(curl, CURLOPT_HEADEROPT, CURLHEADER_UNIFIED); + + res = curl_easy_perform(curl); + +Index: curl-7.37.1/lib/url.c +=================================================================== +--- curl-7.37.1.orig/lib/url.c ++++ curl-7.37.1/lib/url.c +@@ -584,6 +584,7 @@ CURLcode Curl_init_userdefined(struct Us + set->ssl_enable_alpn = TRUE; + + set->expect_100_timeout = 1000L; /* Wait for a second by default. */ ++ set->sep_headers = TRUE; /* separated header lists by default */ + return res; + } + diff --git a/meta/recipes-support/curl/curl/configure_ac.patch b/meta/recipes-support/curl/curl/configure_ac.patch new file mode 100644 index 0000000000..b8bd304d71 --- /dev/null +++ b/meta/recipes-support/curl/curl/configure_ac.patch @@ -0,0 +1,13 @@ +Upstream-Status: Pending + +--- a/configure.ac ++++ b/configure.ac +@@ -281,7 +281,7 @@ dnl ************************************ + + CURL_CHECK_COMPILER + CURL_SET_COMPILER_BASIC_OPTS +-CURL_SET_COMPILER_DEBUG_OPTS ++dnl CURL_SET_COMPILER_DEBUG_OPTS + CURL_SET_COMPILER_OPTIMIZE_OPTS + CURL_SET_COMPILER_WARNING_OPTS + diff --git a/meta/recipes-support/curl/curl/pkgconfig_fix.patch b/meta/recipes-support/curl/curl/pkgconfig_fix.patch new file mode 100644 index 0000000000..5d8769d522 --- /dev/null +++ b/meta/recipes-support/curl/curl/pkgconfig_fix.patch @@ -0,0 +1,32 @@ +Upstream-Status: Inappropriate [packaging] + +diff -Nurd curl-7.29.0/configure.ac curl-7.29.0/configure.ac +--- curl-7.29.0/configure.ac 2013-02-06 11:47:19.000000000 +0200 ++++ curl-7.29.0/configure.ac 2013-02-16 12:32:22.132327764 +0200 +@@ -1883,6 +1883,7 @@ + AC_SUBST(USE_GNUTLS, [1]) + GNUTLS_ENABLED=1 + USE_GNUTLS="yes" ++ GNUTLS_REQUIRED="gnutls" + curl_ssl_msg="enabled (GnuTLS)" + ], + [ +@@ -1953,6 +1954,8 @@ + ]) + fi + ++AC_SUBST(GNUTLS_REQUIRED) ++ + dnl ---------------------------------------------------- + dnl check for PolarSSL + dnl ---------------------------------------------------- +diff -Nurd curl-7.29.0/libcurl.pc.in curl-7.29.0/libcurl.pc.in +--- curl-7.29.0/libcurl.pc.in 2012-12-12 00:32:22.000000000 +0200 ++++ curl-7.29.0/libcurl.pc.in 2013-02-16 12:33:27.063844337 +0200 +@@ -35,5 +35,5 @@ + Description: Library to transfer files with ftp, http, etc. + Version: @CURLVERSION@ + Libs: -L${libdir} -lcurl +-Libs.private: @LIBCURL_LIBS@ ++Libs.private: -ldl -lz + Cflags: -I${includedir} @CPPFLAG_CURL_STATICLIB@ diff --git a/meta/recipes-support/curl/curl_7.37.1.bb b/meta/recipes-support/curl/curl_7.37.1.bb new file mode 100644 index 0000000000..2f4da9706c --- /dev/null +++ b/meta/recipes-support/curl/curl_7.37.1.bb @@ -0,0 +1,66 @@ +SUMMARY = "Command line tool and library for client-side URL transfers" +HOMEPAGE = "http://curl.haxx.se/" +BUGTRACKER = "http://curl.haxx.se/mail/list.cgi?list=curl-tracker" +SECTION = "console/network" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://COPYING;beginline=7;md5=3a34942f4ae3fbf1a303160714e664ac" + +SRC_URI = "http://curl.haxx.se/download/curl-${PV}.tar.bz2 \ + file://pkgconfig_fix.patch \ + file://CVE-2014-3613.patch \ + file://CVE-2014-3620.patch \ + file://CVE-2015-3143.patch \ + file://CVE-2015-3144.patch \ + file://CVE-2015-3145.patch \ + file://CVE-2014-3707.patch \ + file://CVE-2014-8150.patch \ + file://CVE-2015-3153.patch \ +" + +# curl likes to set -g0 in CFLAGS, so we stop it +# from mucking around with debug options +# +SRC_URI += " file://configure_ac.patch" + +SRC_URI[md5sum] = "95c627abcf6494f5abe55effe7cd6a57" +SRC_URI[sha256sum] = "c3ef3cd148f3778ddbefb344117d7829db60656efe1031f9e3065fc0faa25136" + +inherit autotools pkgconfig binconfig multilib_header + +PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "ipv6", "ipv6", "", d)} gnutls zlib" +PACKAGECONFIG_class-native = "ipv6 ssl zlib" +PACKAGECONFIG_class-nativesdk = "ipv6 ssl zlib" + +PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," +PACKAGECONFIG[ssl] = "--with-ssl --with-random=/dev/urandom,--without-ssl,openssl" +PACKAGECONFIG[gnutls] = "--with-gnutls,--without-gnutls,gnutls" +PACKAGECONFIG[zlib] = "--with-zlib=${STAGING_LIBDIR}/../,--without-zlib,zlib" +PACKAGECONFIG[rtmpdump] = "--with-librtmp,--without-librtmp,rtmpdump" +PACKAGECONFIG[libssh2] = "--with-libssh2,--without-libssh2,libssh2" + +EXTRA_OECONF = "--without-libidn \ + --enable-crypto-auth \ + --disable-ldap \ + --disable-ldaps \ + --with-ca-bundle=${sysconfdir}/ssl/certs/ca-certificates.crt \ +" + +do_install_append() { + oe_multilib_header curl/curlbuild.h +} + +PACKAGES =+ "lib${BPN} lib${BPN}-dev lib${BPN}-staticdev lib${BPN}-doc" + +FILES_lib${BPN} = "${libdir}/lib*.so.*" +RRECOMMENDS_lib${BPN} += "ca-certificates" +FILES_lib${BPN}-dev = "${includedir} \ + ${libdir}/lib*.so \ + ${libdir}/lib*.la \ + ${libdir}/pkgconfig \ + ${datadir}/aclocal \ + ${bindir}/*-config" +FILES_lib${BPN}-staticdev = "${libdir}/lib*.a" +FILES_lib${BPN}-doc = "${mandir}/man3 \ + ${mandir}/man1/curl-config.1" + +BBCLASSEXTEND = "native nativesdk" -- cgit v1.2.3-54-g00ecf