libreoffice: reinstante and use curl 7.48 before the removal of a required feature. CVE's not fixed because of that decision: a Windows-specific DLL substitution and a mbedSSL/PolarSSL specific insufficient certificate validation

This commit is contained in:
Michael Raskin 2016-08-01 17:22:28 +02:00
parent 909249dbe2
commit 8fd84fcb87
2 changed files with 99 additions and 0 deletions

View file

@ -0,0 +1,90 @@
{ stdenv, fetchurl, pkgconfig, perl
, http2Support ? true, nghttp2
, idnSupport ? false, libidn ? null
, ldapSupport ? false, openldap ? null
, zlibSupport ? false, zlib ? null
, sslSupport ? false, openssl ? null
, scpSupport ? false, libssh2 ? null
, gssSupport ? false, gss ? null
, c-aresSupport ? false, c-ares ? null
}:
assert http2Support -> nghttp2 != null;
assert idnSupport -> libidn != null;
assert ldapSupport -> openldap != null;
assert zlibSupport -> zlib != null;
assert sslSupport -> openssl != null;
assert scpSupport -> libssh2 != null;
assert c-aresSupport -> c-ares != null;
stdenv.mkDerivation rec {
name = "curl-7.48.0";
src = fetchurl {
url = "http://curl.haxx.se/download/${name}.tar.bz2";
sha256 = "0ly7fbysxrdbclswcr6s7n5sfxfffzazv8blqr16sn0b44cphkl6";
};
outputs = [ "dev" "out" "bin" "man" "docdev" ];
nativeBuildInputs = [ pkgconfig perl ];
# Zlib and OpenSSL must be propagated because `libcurl.la' contains
# "-lz -lssl", which aren't necessary direct build inputs of
# applications that use Curl.
propagatedBuildInputs = with stdenv.lib;
optional http2Support nghttp2 ++
optional idnSupport libidn ++
optional ldapSupport openldap ++
optional zlibSupport zlib ++
optional gssSupport gss ++
optional c-aresSupport c-ares ++
optional sslSupport openssl ++
optional scpSupport libssh2;
# for the second line see http://curl.haxx.se/mail/tracker-2014-03/0087.html
preConfigure = ''
sed -e 's|/usr/bin|/no-such-path|g' -i.bak configure
rm src/tool_hugehelp.c
'';
configureFlags = [
"--with-ca-bundle=/etc/ssl/certs/ca-certificates.crt"
"--disable-manual"
( if sslSupport then "--with-ssl=${openssl.dev}" else "--without-ssl" )
( if scpSupport then "--with-libssh2=${libssh2.dev}" else "--without-libssh2" )
( if ldapSupport then "--enable-ldap" else "--disable-ldap" )
( if ldapSupport then "--enable-ldaps" else "--disable-ldaps" )
( if idnSupport then "--with-libidn=${libidn.dev}" else "--without-libidn" )
]
++ stdenv.lib.optional c-aresSupport "--enable-ares=${c-ares}"
++ stdenv.lib.optional gssSupport "--with-gssapi=${gss}";
CXX = "g++";
CXXCPP = "g++ -E";
postInstall = ''
moveToOutput bin/curl-config "$dev"
sed '/^dependency_libs/s|${libssh2.dev}|${libssh2.out}|' -i "$out"/lib/*.la
'';
crossAttrs = {
# We should refer to the cross built openssl
# For the 'urandom', maybe it should be a cross-system option
configureFlags = [
( if sslSupport then "--with-ssl=${openssl.crossDrv}" else "--without-ssl" )
"--with-random /dev/urandom"
];
};
passthru = {
inherit sslSupport openssl;
};
meta = with stdenv.lib; {
description = "A command line tool for transferring files with URL syntax";
homepage = http://curl.haxx.se/;
maintainers = with maintainers; [ lovek323 ];
platforms = platforms.all;
};
}

View file

@ -1235,6 +1235,14 @@ in
scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
};
curl_7_48 = callPackage ../tools/networking/curl/7.48.nix rec {
fetchurl = fetchurlBoot;
http2Support = !stdenv.isDarwin;
zlibSupport = true;
sslSupport = zlibSupport;
scpSupport = zlibSupport && !stdenv.isSunOS && !stdenv.isCygwin;
};
curl3 = callPackage ../tools/networking/curl/7.15.nix rec {
zlibSupport = true;
sslSupport = zlibSupport;
@ -13720,6 +13728,7 @@ in
harfbuzz = harfbuzz.override {
withIcu = true; withGraphite2 = true;
};
curl = curl_7_48;
});