summaryrefslogtreecommitdiffstats
path: root/meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch')
-rw-r--r--meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch b/meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch
new file mode 100644
index 0000000000..2b98a3c4f2
--- /dev/null
+++ b/meta/recipes-support/gnupg/gnupg/cve-2012-6085.patch
@@ -0,0 +1,70 @@
1Fix CVE-2012-6085 by backporting a patch from upstream's git repository.
2
3Upstream-Status: Backport
4Signed-off-by: Ross Burton <ross.burton@intel.com>
5
6
7From 498882296ffac7987c644aaf2a0aa108a2925471 Mon Sep 17 00:00:00 2001
8From: Werner Koch <wk@gnupg.org>
9Date: Thu, 20 Dec 2012 09:43:41 +0100
10Subject: [PATCH] gpg: Import only packets which are allowed in a keyblock.
11
12* g10/import.c (valid_keyblock_packet): New.
13(read_block): Store only valid packets.
14--
15
16A corrupted key, which for example included a mangled public key
17encrypted packet, used to corrupt the keyring. This change skips all
18packets which are not allowed in a keyblock.
19
20GnuPG-bug-id: 1455
21
22(cherry-picked from commit 3a4b96e665fa639772854058737ee3d54ba0694e)
23---
24 g10/import.c | 23 ++++++++++++++++++++++-
25 1 files changed, 22 insertions(+), 1 deletions(-)
26
27diff --git a/g10/import.c b/g10/import.c
28index ba2439d..ad112d6 100644
29--- a/g10/import.c
30+++ b/g10/import.c
31@@ -347,6 +347,27 @@ import_print_stats (void *hd)
32 }
33
34
35+/* Return true if PKTTYPE is valid in a keyblock. */
36+static int
37+valid_keyblock_packet (int pkttype)
38+{
39+ switch (pkttype)
40+ {
41+ case PKT_PUBLIC_KEY:
42+ case PKT_PUBLIC_SUBKEY:
43+ case PKT_SECRET_KEY:
44+ case PKT_SECRET_SUBKEY:
45+ case PKT_SIGNATURE:
46+ case PKT_USER_ID:
47+ case PKT_ATTRIBUTE:
48+ case PKT_RING_TRUST:
49+ return 1;
50+ default:
51+ return 0;
52+ }
53+}
54+
55+
56 /****************
57 * Read the next keyblock from stream A.
58 * PENDING_PKT should be initialzed to NULL
59@@ -424,7 +445,7 @@ read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root )
60 }
61 in_cert = 1;
62 default:
63- if( in_cert ) {
64+ if (in_cert && valid_keyblock_packet (pkt->pkttype)) {
65 if( !root )
66 root = new_kbnode( pkt );
67 else
68--
691.7.2.5
70