aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2006-05-22 16:53:09 +0000
committerDavid Shaw <[email protected]>2006-05-22 16:53:09 +0000
commit7596ae1f6ae6d60b696da7297047b59bdb99186e (patch)
tree216eb38fe762e6f14e73d457f7962a67a6977ae4
parentUpdated keys (diff)
downloadgnupg-7596ae1f6ae6d60b696da7297047b59bdb99186e.tar.gz
gnupg-7596ae1f6ae6d60b696da7297047b59bdb99186e.zip
* 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.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog7
-rw-r--r--g10/getkey.c2
-rw-r--r--g10/import.c14
3 files changed, 19 insertions, 4 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 192b4687b..79eed36b5 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,10 @@
+2006-05-22 David Shaw <[email protected]>
+
+ * 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.
+
2006-04-26 David Shaw <[email protected]>
* keyserver.c (direct_uri_map): New.
diff --git a/g10/getkey.c b/g10/getkey.c
index c9ae58c88..f7c988a33 100644
--- a/g10/getkey.c
+++ b/g10/getkey.c
@@ -934,7 +934,7 @@ get_pubkey_byname (PKT_public_key *pk,
for(akl=opt.auto_key_locate;akl;akl=akl->next)
{
- unsigned char *fpr;
+ unsigned char *fpr=NULL;
size_t fpr_len;
switch(akl->type)
diff --git a/g10/import.c b/g10/import.c
index 3b7fa5e72..81aa506a4 100644
--- a/g10/import.c
+++ b/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);