summaryrefslogtreecommitdiff
path: root/meta/recipes-support/gnupg/gnupg-1.4.7/CVE-2013-4351.patch
blob: b50a32f40c38367b84816f18ac6df77844d68944 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
Upstream-Status: Backport
CVE: CVE-2013-4351

Index: gnupg-1.4.7/g10/getkey.c
===================================================================
--- gnupg-1.4.7.orig/g10/getkey.c	2007-03-05 16:54:41.000000000 +0800
+++ gnupg-1.4.7/g10/getkey.c	2013-11-28 14:41:59.640212240 +0800
@@ -1454,7 +1454,11 @@
 
       if(flags)
 	key_usage |= PUBKEY_USAGE_UNKNOWN;
+      if (!key_usage)
+	key_usage |= PUBKEY_USAGE_NONE;
     }
+  else if (p)
+    key_usage |= PUBKEY_USAGE_NONE;
 
   /* We set PUBKEY_USAGE_UNKNOWN to indicate that this key has a
      capability that we do not handle.  This serves to distinguish
Index: gnupg-1.4.7/g10/keygen.c
===================================================================
--- gnupg-1.4.7.orig/g10/keygen.c	2007-02-05 00:27:40.000000000 +0800
+++ gnupg-1.4.7/g10/keygen.c	2013-11-28 14:43:05.016670092 +0800
@@ -209,9 +209,6 @@
     if (use & PUBKEY_USAGE_AUTH)
         buf[0] |= 0x20;
 
-    if (!buf[0]) 
-        return;
-
     build_sig_subpkt (sig, SIGSUBPKT_KEY_FLAGS, buf, 1);
 }
 
Index: gnupg-1.4.7/include/cipher.h
===================================================================
--- gnupg-1.4.7.orig/include/cipher.h	2006-04-21 20:39:49.000000000 +0800
+++ gnupg-1.4.7/include/cipher.h	2013-11-28 14:49:24.159322744 +0800
@@ -52,6 +52,7 @@
 #define PUBKEY_USAGE_CERT    4      /* key is also good to certify other keys*/
 #define PUBKEY_USAGE_AUTH    8      /* key is good for authentication */
 #define PUBKEY_USAGE_UNKNOWN 128    /* key has an unknown usage bit */
+#define PUBKEY_USAGE_NONE    256    /* No usage given. */
 
 #define DIGEST_ALGO_MD5       1
 #define DIGEST_ALGO_SHA1      2