Package: gnupg / 1.4.18-7+deb8u5

0019-gpg-release-DEK-soon-after-its-use.patch Patch series | download
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
From da66ad5bba4215b9ddd0cb927a89aa75355632aa Mon Sep 17 00:00:00 2001
From: NIIBE Yutaka <gniibe@fsij.org>
Date: Fri, 12 Dec 2014 17:41:56 +0900
Subject: [PATCH 19/45] gpg: release DEK soon after its use.

* g10/keygen.c (generate_subkeypair): Release DEK soon.

--

This fixes the out_of_core error in the test case of adding
RSA-4096 subkey to RSA-4096 primary key with configuration:

    s2k-cipher-algo S10

Debian-bug-id: 772780
---
 g10/keygen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/g10/keygen.c b/g10/keygen.c
index 9020908..5af0043 100644
--- a/g10/keygen.c
+++ b/g10/keygen.c
@@ -3447,6 +3447,7 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
 
     rc = do_create (algo, nbits, pub_keyblock, sec_keyblock,
 		    dek, s2k, &sub_sk, timestamp, expire, 1 );
+    xfree( dek );
     if (!rc)
 	rc = write_keybinding (pub_keyblock, pub_keyblock, pri_sk, sub_sk,
                                use, timestamp);
@@ -3463,7 +3464,6 @@ generate_subkeypair( KBNODE pub_keyblock, KBNODE sec_keyblock )
     if( rc )
 	log_error(_("Key generation failed: %s\n"), g10_errstr(rc) );
     xfree( passphrase );
-    xfree( dek );
     xfree( s2k );
     /* release the copy of the (now unprotected) secret keys */
     if( pri_sk )
-- 
2.1.4