mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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>
This commit is contained in:
parent
ce2f717601
commit
30153c65f0
2 changed files with 25 additions and 2 deletions
|
@ -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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue