summaryrefslogtreecommitdiffstats
path: root/g10/pubkey-enc.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2018-06-11 04:48:14 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2018-08-27 09:24:00 +0200
commit30153c65f0875f9a62838f6347bcdcedd6114d35 (patch)
tree758b2db8a7643a93a151ff8c84588af3c919399a /g10/pubkey-enc.c
parentg10: Change decryption key selection for public key encryption. (diff)
downloadgnupg2-30153c65f0875f9a62838f6347bcdcedd6114d35.tar.xz
gnupg2-30153c65f0875f9a62838f6347bcdcedd6114d35.zip
g10: Enumerated keys for decryption should be unique.
* g10/getkey.c (enum_secret_keys): Collecting keys in the context, check duplicate to make sure returning only unique keys. * g10/pubkey-enc.c (get_session_key): Now, it's the responsibility of enum_secret_keys to free keys. -- Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/pubkey-enc.c')
-rw-r--r--g10/pubkey-enc.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/g10/pubkey-enc.c b/g10/pubkey-enc.c
index 8540e03c9..32b1ed08b 100644
--- a/g10/pubkey-enc.c
+++ b/g10/pubkey-enc.c
@@ -87,7 +87,6 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
{
struct pubkey_enc_list *k;
- free_public_key (sk);
sk = xmalloc_clear (sizeof *sk);
rc = enum_secret_keys (ctrl, &enum_context, sk);
if (rc)
@@ -156,7 +155,6 @@ get_session_key (ctrl_t ctrl, struct pubkey_enc_list *list, DEK *dek)
}
}
enum_secret_keys (ctrl, &enum_context, NULL); /* free context */
- free_public_key (sk);
if (DBG_CLOCK)
log_clock ("get_session_key leave");