mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
* getkey.c (get_pubkey_byname), import.c (import_one): Fix key selection
problem when auto-key-locate returns a list of keys, not all of which are usable (revoked, expired, etc). Noted by Simon Josefsson.
This commit is contained in:
parent
6089d7f5d8
commit
7596ae1f6a
3 changed files with 19 additions and 4 deletions
14
g10/import.c
14
g10/import.c
|
@ -696,9 +696,6 @@ import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
|||
|
||||
pk = node->pkt->pkt.public_key;
|
||||
|
||||
if(fpr)
|
||||
*fpr=fingerprint_from_pk(pk,NULL,fpr_len);
|
||||
|
||||
keyid_from_pk( pk, keyid );
|
||||
uidnode = find_next_kbnode( keyblock, PKT_USER_ID );
|
||||
|
||||
|
@ -981,6 +978,17 @@ import_one( const char *fname, KBNODE keyblock, struct stats_s *stats,
|
|||
}
|
||||
else if(new_key)
|
||||
{
|
||||
if(fpr && stats->imported==1)
|
||||
{
|
||||
xfree(*fpr);
|
||||
*fpr=fingerprint_from_pk(pk,NULL,fpr_len);
|
||||
}
|
||||
else
|
||||
{
|
||||
xfree(*fpr);
|
||||
*fpr=NULL;
|
||||
}
|
||||
|
||||
revocation_present(keyblock);
|
||||
if(seckey_available(keyid)==0)
|
||||
check_prefs(keyblock);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue