From 1b460f049e5c1c102d8b55ad28781688252c5a6b Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 2 Jun 2016 21:21:08 +0200 Subject: gpg: Try to use the passphrase from the primary for --quick-addkey. * agent/command.c (cmd_genkey): Add option --passwd-nonce. (cmd_passwd): Return a PASSWD_NONCE in verify mode. * g10/call-agent.c (agent_genkey): Add arg 'passwd_nonce_addr' and do not send a RESET if given. (agent_passwd): Add arg 'verify'. * g10/keygen.c (common_gen): Add optional arg 'passwd_nonce_addr'. (gen_elg, gen_dsa, gen_ecc, gen_rsa, do_create): Ditto. (generate_subkeypair): Use sepeare hexgrip var for the to be created for hexgrip feature. Verify primary key first. Make use of the passwd nonce. Allow for a static passphrase. Signed-off-by: Werner Koch --- g10/keyedit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'g10/keyedit.c') diff --git a/g10/keyedit.c b/g10/keyedit.c index 16dbf6280..a38c90a8f 100644 --- a/g10/keyedit.c +++ b/g10/keyedit.c @@ -1728,7 +1728,8 @@ change_passphrase (ctrl_t ctrl, kbnode_t keyblock) goto leave; desc = gpg_format_keydesc (pk, FORMAT_KEYDESC_NORMAL, 1); - err = agent_passwd (ctrl, hexgrip, desc, &cache_nonce, &passwd_nonce); + err = agent_passwd (ctrl, hexgrip, desc, 0, + &cache_nonce, &passwd_nonce); xfree (desc); if (err) -- cgit v1.2.3