gnutls: Update to 3.2.12, 3.1.22

CVE-2014-0092

Unfortunately, 3.2.12 doesn't pass the tests with Guile bindings
enabled, so I've turned them off in the default build.
This commit is contained in:
Eelco Dolstra 2014-03-04 22:31:02 +01:00
parent 15d6da8740
commit 738a5321bc
4 changed files with 38 additions and 53 deletions

View file

@ -59,5 +59,6 @@ stdenv.mkDerivation rec {
license = "LGPLv2.1+"; license = "LGPLv2.1+";
maintainers = [ ]; maintainers = [ ];
broken = true; # CVE-2014-0092
}; };
} }

View file

@ -3,15 +3,22 @@
assert guileBindings -> guile != null; assert guileBindings -> guile != null;
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
name = "gnutls-3.2.12";
name = "gnutls-3.2.10";
src = fetchurl { src = fetchurl {
url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/${name}.tar.lz"; url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.2/${name}.tar.lz";
sha256 = "1g1w93d66sz51977zbqd56641r501a1djcwhykbjm8alhyz1564h"; sha256 = "1zwk9qkxn3190nssyamd7jsb3ag6mnnln3jwbgmjs1w306dzwafi";
}; };
patches =
# FreeBSD doesn't have <alloca.h>, and Gnulib's `alloca' module isn't used.
stdenv.lib.optional stdenv.isFreeBSD ./guile-gnulib-includes.patch
# multiple definitions of '_gnutls_x86_cpuid_s' cause linker to fail.
# the patch is: https://www.gitorious.org/gnutls/gnutls/commit/54768ca1cd9049bbd1c695696ef3c8595c6052db
# discussion: http://osdir.com/ml/gnutls-devel-gnu/2014-02/msg00012.html
++ stdenv.lib.optional stdenv.isDarwin ./fix_gnutls_x86_cpuid_s_multi_definitions.patch;
# Note: GMP is a dependency of Nettle, whose public headers include # Note: GMP is a dependency of Nettle, whose public headers include
# GMP headers, hence the hack. # GMP headers, hence the hack.
configurePhase = '' configurePhase = ''
@ -21,15 +28,14 @@ stdenv.mkDerivation (rec {
--with-lzo --with-libtasn1-prefix="${libtasn1}" \ --with-lzo --with-libtasn1-prefix="${libtasn1}" \
--with-libnettle-prefix="${nettle}" \ --with-libnettle-prefix="${nettle}" \
CPPFLAGS="-I${gmp}/include" \ CPPFLAGS="-I${gmp}/include" \
${if guileBindings ${stdenv.lib.optionalString guileBindings
then "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\"" "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\""}
else ""}
''; '';
# Build of the Guile bindings is not parallel-safe. See # Build of the Guile bindings is not parallel-safe. See
# <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad> # <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad>
# for the actual fix. # for the actual fix.
enableParallelBuilding = false; enableParallelBuilding = !guileBindings;
buildInputs = [ zlib lzo lzip ] buildInputs = [ zlib lzo lzip ]
++ stdenv.lib.optional guileBindings guile; ++ stdenv.lib.optional guileBindings guile;
@ -42,7 +48,7 @@ stdenv.mkDerivation (rec {
# http://hydra.nixos.org/build/2962084/nixlog/1/raw . # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin); doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
meta = with stdenv.lib; { meta = {
description = "The GNU Transport Layer Security Library"; description = "The GNU Transport Layer Security Library";
longDescription = '' longDescription = ''
@ -61,25 +67,8 @@ stdenv.mkDerivation (rec {
homepage = http://www.gnu.org/software/gnutls/; homepage = http://www.gnu.org/software/gnutls/;
license = "LGPLv2.1+"; license = "LGPLv2.1+";
maintainers = [ ]; maintainers = [ stdenv.lib.maintainers.eelco ];
platforms = platforms.all; platforms = stdenv.lib.platforms.all;
}; };
} }
//
(stdenv.lib.optionalAttrs stdenv.isFreeBSD {
# FreeBSD doesn't have <alloca.h>, and Gnulib's `alloca' module isn't used.
patches = [ ./guile-gnulib-includes.patch ];
})
//
(stdenv.lib.optionalAttrs stdenv.isDarwin {
# multiple definitions of '_gnutls_x86_cpuid_s' cause linker to fail.
# the patch is: https://www.gitorious.org/gnutls/gnutls/commit/54768ca1cd9049bbd1c695696ef3c8595c6052db
# discussion: http://osdir.com/ml/gnutls-devel-gnu/2014-02/msg00012.html
patches = [ ./fix_gnutls_x86_cpuid_s_multi_definitions.patch ];
})
)

View file

@ -3,15 +3,17 @@
assert guileBindings -> guile != null; assert guileBindings -> guile != null;
stdenv.mkDerivation (rec { stdenv.mkDerivation rec {
name = "gnutls-3.1.22";
name = "gnutls-3.1.20";
src = fetchurl { src = fetchurl {
url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/${name}.tar.lz"; url = "ftp://ftp.gnutls.org/gcrypt/gnutls/v3.1/${name}.tar.lz";
sha256 = "1a8pzc29sn1kmbqvldljf4kmbz60pdk931dirk5jdd0qpf8fzd5x"; sha256 = "177kmq4jn67s7mmb249722nwxmbjwjpphmib7bhzfk43z02j3pvh";
}; };
# FreeBSD doesn't have <alloca.h>, and Gnulib's `alloca' module isn't used.
patches = stdenv.lib.optional stdenv.isFreeBSD ./guile-gnulib-includes.patch;
# Note: GMP is a dependency of Nettle, whose public headers include # Note: GMP is a dependency of Nettle, whose public headers include
# GMP headers, hence the hack. # GMP headers, hence the hack.
configurePhase = '' configurePhase = ''
@ -21,15 +23,14 @@ stdenv.mkDerivation (rec {
--with-lzo --with-libtasn1-prefix="${libtasn1}" \ --with-lzo --with-libtasn1-prefix="${libtasn1}" \
--with-libnettle-prefix="${nettle}" \ --with-libnettle-prefix="${nettle}" \
CPPFLAGS="-I${gmp}/include" \ CPPFLAGS="-I${gmp}/include" \
${if guileBindings ${stdenv.lib.optionalString guileBindings
then "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\"" "--enable-guile --with-guile-site-dir=\"$out/share/guile/site\""}
else ""}
''; '';
# Build of the Guile bindings is not parallel-safe. See # Build of the Guile bindings is not parallel-safe. See
# <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad> # <http://git.savannah.gnu.org/cgit/gnutls.git/commit/?id=330995a920037b6030ec0282b51dde3f8b493cad>
# for the actual fix. # for the actual fix.
enableParallelBuilding = false; enableParallelBuilding = !guileBindings;
buildInputs = [ zlib lzo lzip ] buildInputs = [ zlib lzo lzip ]
++ stdenv.lib.optional guileBindings guile; ++ stdenv.lib.optional guileBindings guile;
@ -42,7 +43,7 @@ stdenv.mkDerivation (rec {
# http://hydra.nixos.org/build/2962084/nixlog/1/raw . # http://hydra.nixos.org/build/2962084/nixlog/1/raw .
doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin); doCheck = (!stdenv.isFreeBSD && !stdenv.isDarwin);
meta = with stdenv.lib; { meta = {
description = "The GNU Transport Layer Security Library"; description = "The GNU Transport Layer Security Library";
longDescription = '' longDescription = ''
@ -61,13 +62,6 @@ stdenv.mkDerivation (rec {
homepage = http://www.gnu.org/software/gnutls/; homepage = http://www.gnu.org/software/gnutls/;
license = "LGPLv2.1+"; license = "LGPLv2.1+";
maintainers = [ ]; maintainers = [ stdenv.lib.maintainers.eelco ];
}; };
} }
//
(stdenv.lib.optionalAttrs stdenv.isFreeBSD {
# FreeBSD doesn't have <alloca.h>, and Gnulib's `alloca' module isn't used.
patches = [ ./guile-gnulib-includes.patch ];
}))

View file

@ -4361,20 +4361,21 @@ let
gnu-efi = callPackage ../development/libraries/gnu-efi { }; gnu-efi = callPackage ../development/libraries/gnu-efi { };
gnutls = gnutls32; gnutls = gnutls32;
gnutls31 = callPackage ../development/libraries/gnutls {
guileBindings = config.gnutls.guile or true;
};
gnutls2 = callPackage ../development/libraries/gnutls/2.12.nix { gnutls2 = callPackage ../development/libraries/gnutls/2.12.nix {
guileBindings = config.gnutls.guile or true; guileBindings = config.gnutls.guile or false;
};
gnutls31 = callPackage ../development/libraries/gnutls {
guileBindings = config.gnutls.guile or false;
}; };
gnutls32 = callPackage ../development/libraries/gnutls/3.2.nix { gnutls32 = callPackage ../development/libraries/gnutls/3.2.nix {
guileBindings = config.gnutls.guile or true; guileBindings = config.gnutls.guile or false;
}; };
gnutls_without_guile = lowPrio (gnutls.override { guileBindings = false; }); gnutls_with_guile = lowPrio (gnutls.override { guileBindings = true; });
gnutls2_without_guile = lowPrio (gnutls2.override { guileBindings = false; }); gnutls2_with_guile = lowPrio (gnutls2.override { guileBindings = true; });
gpac = callPackage ../applications/video/gpac { }; gpac = callPackage ../applications/video/gpac { };