mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
g10: Use --force when importing key for bkuptocard.
* g10/call-agent.c (agent_import_key): Add an argument FORCE. * g10/import.c (transfer_secret_keys): Likewise. (import_secret_one): Call transfer_secret_keys with FORCE=0. * g10/keyedit.c (keyedit_menu): Call with FORCE=1.
This commit is contained in:
parent
44aee35e69
commit
5ca57f1a69
5 changed files with 11 additions and 10 deletions
|
@ -1319,8 +1319,8 @@ import_one (ctrl_t ctrl,
|
|||
true the secret keys are stored by gpg-agent in the transfer format
|
||||
(i.e. no re-protection and aksing for passphrases). */
|
||||
gpg_error_t
|
||||
transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats, kbnode_t sec_keyblock,
|
||||
int batch)
|
||||
transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats,
|
||||
kbnode_t sec_keyblock, int batch, int force)
|
||||
{
|
||||
gpg_error_t err = 0;
|
||||
void *kek = NULL;
|
||||
|
@ -1556,7 +1556,7 @@ transfer_secret_keys (ctrl_t ctrl, struct import_stats_s *stats, kbnode_t sec_ke
|
|||
{
|
||||
char *desc = gpg_format_keydesc (pk, FORMAT_KEYDESC_IMPORT, 1);
|
||||
err = agent_import_key (ctrl, desc, &cache_nonce,
|
||||
wrappedkey, wrappedkeylen, batch);
|
||||
wrappedkey, wrappedkeylen, batch, force);
|
||||
xfree (desc);
|
||||
}
|
||||
if (!err)
|
||||
|
@ -1783,7 +1783,7 @@ import_secret_one (ctrl_t ctrl, const char *fname, kbnode_t keyblock,
|
|||
gpg_error_t err;
|
||||
|
||||
nr_prev = stats->secret_imported;
|
||||
err = transfer_secret_keys (ctrl, stats, keyblock, batch);
|
||||
err = transfer_secret_keys (ctrl, stats, keyblock, batch, 0);
|
||||
if (gpg_err_code (err) == GPG_ERR_NOT_PROCESSED)
|
||||
{
|
||||
/* TRANSLATORS: For smartcard, each private key on
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue