aboutsummaryrefslogtreecommitdiffstats
path: root/g10/call-agent.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2015-12-24 05:15:58 +0000
committerNIIBE Yutaka <[email protected]>2015-12-24 05:15:58 +0000
commit5ca57f1a697e875bae5a5c73f1a580c42ca75343 (patch)
tree2640f8cfb96b8f500d0eae7438c03ffcb0f05178 /g10/call-agent.c
parentg10: Remove subcommand checkbkupkey for --key-edit. (diff)
downloadgnupg-5ca57f1a697e875bae5a5c73f1a580c42ca75343.tar.gz
gnupg-5ca57f1a697e875bae5a5c73f1a580c42ca75343.zip
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.
Diffstat (limited to '')
-rw-r--r--g10/call-agent.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/g10/call-agent.c b/g10/call-agent.c
index 8eb16e411..26de72e31 100644
--- a/g10/call-agent.c
+++ b/g10/call-agent.c
@@ -2216,7 +2216,7 @@ inq_import_key_parms (void *opaque, const char *line)
/* Call the agent to import a key into the agent. */
gpg_error_t
agent_import_key (ctrl_t ctrl, const char *desc, char **cache_nonce_addr,
- const void *key, size_t keylen, int unattended)
+ const void *key, size_t keylen, int unattended, int force)
{
gpg_error_t err;
struct import_key_parm_s parm;
@@ -2246,8 +2246,9 @@ agent_import_key (ctrl_t ctrl, const char *desc, char **cache_nonce_addr,
parm.key = key;
parm.keylen = keylen;
- snprintf (line, sizeof line, "IMPORT_KEY%s%s%s",
+ snprintf (line, sizeof line, "IMPORT_KEY%s%s%s%s",
unattended? " --unattended":"",
+ force? " --force":"",
cache_nonce_addr && *cache_nonce_addr? " ":"",
cache_nonce_addr && *cache_nonce_addr? *cache_nonce_addr:"");
cn_parm.cache_nonce_addr = cache_nonce_addr;