diff options
author | Werner Koch <wk@gnupg.org> | 2010-10-13 17:57:08 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2010-10-13 17:57:08 +0200 |
commit | 54591341a417ca769b2219a9b2f7683f11a74718 (patch) | |
tree | d4cd49932dec93aa9e20e1933ad16ba897965c46 /g10/import.c | |
parent | Describe %v and %V. (diff) | |
download | gnupg2-54591341a417ca769b2219a9b2f7683f11a74718.tar.xz gnupg2-54591341a417ca769b2219a9b2f7683f11a74718.zip |
More agent support for gpg.
Diffstat (limited to 'g10/import.c')
-rw-r--r-- | g10/import.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/g10/import.c b/g10/import.c index b3969770f..31160c33e 100644 --- a/g10/import.c +++ b/g10/import.c @@ -362,7 +362,7 @@ import_print_stats (void *hd) * Read the next keyblock from stream A. * PENDING_PKT should be initialzed to NULL * and not chnaged form the caller. - * Retunr: 0 = okay, -1 no more blocks or another errorcode. + * Return: 0 = okay, -1 no more blocks or another errorcode. */ static int read_block( IOBUF a, PACKET **pending_pkt, KBNODE *ret_root ) @@ -1142,8 +1142,15 @@ transfer_secret_keys (ctrl_t ctrl, struct stats_s *stats, kbnode_t sec_keyblock) stats->count++; stats->secret_read++; - /* For now we ignore the stub keys becuase we don't have real - support for them in gpg-agent. */ + /* We ignore stub keys. The way we handle them in other parts + of the code is by asking the agent whether any secret key is + available for a given keyblock and then concluding that we + have a secret key; all secret (sub)keys of the keyblock the + agent does not know of are then stub keys. This works also + for card stub keys. The learn command or the card-status + command may be used to check with the agent whether a card + has been inserted and a stub key is in turn generated by the + agent. */ if (ski->s2k.mode == 1001 || ski->s2k.mode == 1002) continue; @@ -1288,7 +1295,8 @@ transfer_secret_keys (ctrl_t ctrl, struct stats_s *stats, kbnode_t sec_keyblock) write_status (STATUS_RSA_OR_IDEA); idea_cipher_warn (0); } - if (gpg_err_code (err) == GPG_ERR_CANCELED) + if (gpg_err_code (err) == GPG_ERR_CANCELED + || gpg_err_code (err) == GPG_ERR_FULLY_CANCELED) break; /* Don't try the other subkeys. */ } } |