summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Fiskerstrand <k_f@gentoo.org>2015-04-13 17:45:00 +0000
committerKristian Fiskerstrand <k_f@gentoo.org>2015-04-13 17:45:00 +0000
commit154a42d8b9cb0d5666bd97e3c48a38a12eaa6fec (patch)
tree42c2daf52e0af468ef5a8aa4e57e1737f7380b5c /app-crypt
parentFix USE=exif to depend on gexiv2 by default and add USE=libexif to built agai... (diff)
downloadgentoo-2-154a42d8b9cb0d5666bd97e3c48a38a12eaa6fec.tar.gz
gentoo-2-154a42d8b9cb0d5666bd97e3c48a38a12eaa6fec.tar.bz2
gentoo-2-154a42d8b9cb0d5666bd97e3c48a38a12eaa6fec.zip
Add fix for NULL-segv due to invalid imported data, reported by Hanno Böck.
(Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0xFED5002857C1ABFA!)
Diffstat (limited to 'app-crypt')
-rw-r--r--app-crypt/gnupg/ChangeLog9
-rw-r--r--app-crypt/gnupg/files/gnupg-2.1.3-gpg-fix-null-segv.patch73
-rw-r--r--app-crypt/gnupg/gnupg-2.1.3-r1.ebuild (renamed from app-crypt/gnupg/gnupg-2.1.3.ebuild)3
3 files changed, 83 insertions, 2 deletions
diff --git a/app-crypt/gnupg/ChangeLog b/app-crypt/gnupg/ChangeLog
index da5d8ad7d092..ea099ca2cf78 100644
--- a/app-crypt/gnupg/ChangeLog
+++ b/app-crypt/gnupg/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for app-crypt/gnupg
# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/ChangeLog,v 1.592 2015/04/13 16:53:46 k_f Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/ChangeLog,v 1.593 2015/04/13 17:45:00 k_f Exp $
+
+*gnupg-2.1.3-r1 (13 Apr 2015)
+
+ 13 Apr 2015; Kristian Fiskerstrand <k_f@gentoo.org>
+ +files/gnupg-2.1.3-gpg-fix-null-segv.patch, +gnupg-2.1.3-r1.ebuild,
+ -gnupg-2.1.3.ebuild:
+ Add fix for NULL-segv due to invalid imported data, reported by Hanno Böck.
13 Apr 2015; Kristian Fiskerstrand <k_f@gentoo.org>
+files/gnupg-2.1.3-dirmngr-no-ldap.patch, gnupg-2.1.3.ebuild:
diff --git a/app-crypt/gnupg/files/gnupg-2.1.3-gpg-fix-null-segv.patch b/app-crypt/gnupg/files/gnupg-2.1.3-gpg-fix-null-segv.patch
new file mode 100644
index 000000000000..395cbebb797b
--- /dev/null
+++ b/app-crypt/gnupg/files/gnupg-2.1.3-gpg-fix-null-segv.patch
@@ -0,0 +1,73 @@
+From 25fce93ba19d997e234a674d5cc98df82c5b5496 Mon Sep 17 00:00:00 2001
+From: Werner Koch <wk@gnupg.org>
+Date: Mon, 13 Apr 2015 11:44:10 +0200
+Subject: [PATCH] gpg: Fix NULL-segv due to invalid imported data.
+MIME-Version: 1.0
+Content-Type: text/plain; charset=utf8
+Content-Transfer-Encoding: 8bit
+
+* g10/free-packet.c (my_mpi_copy): New.
+(copy_public_key, copy_signature): Use instead of mpi_copy.
+--
+
+Reported-by: Hanno Böck
+Signed-off-by: Werner Koch <wk@gnupg.org>
+---
+ g10/free-packet.c | 22 ++++++++++++++++++----
+ 1 file changed, 18 insertions(+), 4 deletions(-)
+
+diff --git a/g10/free-packet.c b/g10/free-packet.c
+index 99e7404..49d54f4 100644
+--- a/g10/free-packet.c
++++ b/g10/free-packet.c
+@@ -31,6 +31,20 @@
+ #include "options.h"
+
+
++/* This is mpi_copy with a fix for opaque MPIs which store a NULL
++ pointer. This will also be fixed in Libggcrypt 1.7.0. */
++static gcry_mpi_t
++my_mpi_copy (gcry_mpi_t a)
++{
++ if (a
++ && gcry_mpi_get_flag (a, GCRYMPI_FLAG_OPAQUE)
++ && !gcry_mpi_get_opaque (a, NULL))
++ return NULL;
++
++ return gcry_mpi_copy (a);
++}
++
++
+ void
+ free_symkey_enc( PKT_symkey_enc *enc )
+ {
+@@ -190,11 +204,11 @@ copy_public_key (PKT_public_key *d, PKT_public_key *s)
+ n = pubkey_get_npkey (s->pubkey_algo);
+ i = 0;
+ if (!n)
+- d->pkey[i++] = mpi_copy (s->pkey[0]);
++ d->pkey[i++] = my_mpi_copy (s->pkey[0]);
+ else
+ {
+ for (; i < n; i++ )
+- d->pkey[i] = mpi_copy( s->pkey[i] );
++ d->pkey[i] = my_mpi_copy (s->pkey[i]);
+ }
+ for (; i < PUBKEY_MAX_NSKEY; i++)
+ d->pkey[i] = NULL;
+@@ -237,10 +251,10 @@ copy_signature( PKT_signature *d, PKT_signature *s )
+ memcpy( d, s, sizeof *d );
+ n = pubkey_get_nsig( s->pubkey_algo );
+ if( !n )
+- d->data[0] = mpi_copy(s->data[0]);
++ d->data[0] = my_mpi_copy(s->data[0]);
+ else {
+ for(i=0; i < n; i++ )
+- d->data[i] = mpi_copy( s->data[i] );
++ d->data[i] = my_mpi_copy( s->data[i] );
+ }
+ d->pka_info = s->pka_info? cp_pka_info (s->pka_info) : NULL;
+ d->hashed = cp_subpktarea (s->hashed);
+--
+2.1.4
+
diff --git a/app-crypt/gnupg/gnupg-2.1.3.ebuild b/app-crypt/gnupg/gnupg-2.1.3-r1.ebuild
index 2bae71611814..bd8a7de1b6d5 100644
--- a/app-crypt/gnupg/gnupg-2.1.3.ebuild
+++ b/app-crypt/gnupg/gnupg-2.1.3-r1.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/gnupg-2.1.3.ebuild,v 1.3 2015/04/13 16:53:46 k_f Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/gnupg/gnupg-2.1.3-r1.ebuild,v 1.1 2015/04/13 17:45:00 k_f Exp $
EAPI="5"
@@ -62,6 +62,7 @@ src_prepare() {
epatch "${FILESDIR}/${PN}-2.0.17-gpgsm-gencert.patch"
epatch "${FILESDIR}/${P}-dirmngr-Fix-segfault-in-ldap-engine.patch"
epatch "${FILESDIR}/${P}-dirmngr-no-ldap.patch"
+ epatch "${FILESDIR}/${P}-gpg-fix-null-segv.patch"
epatch_user
eautoreconf
}