mirror of
git://git.gnupg.org/gnupg.git
synced 2025-01-23 15:07:03 +01:00
g10: Make sure to emit NEED_PASSPHRASE on --export-secret-key.
* call-agent.h (agent_export_key): Add keyid parameters. * call-agent.c (agent_export_key): Set keyid parameters. * export.c (receive_seckey_from_agent): Pass keyid parameters. Signed-off-by: Marcus Brinkmann <mb@g10code.com> GnuPG-bug-id: 2667
This commit is contained in:
parent
5dac85fba7
commit
d8e46f1069
@ -2152,7 +2152,8 @@ agent_import_key (ctrl_t ctrl, const char *desc, char **cache_nonce_addr,
|
||||
gpg_error_t
|
||||
agent_export_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
|
||||
int openpgp_protected, char **cache_nonce_addr,
|
||||
unsigned char **r_result, size_t *r_resultlen)
|
||||
unsigned char **r_result, size_t *r_resultlen,
|
||||
u32 *keyid, u32 *mainkeyid, int pubkey_algo)
|
||||
{
|
||||
gpg_error_t err;
|
||||
struct cache_nonce_parm_s cn_parm;
|
||||
@ -2164,6 +2165,9 @@ agent_export_key (ctrl_t ctrl, const char *hexkeygrip, const char *desc,
|
||||
|
||||
memset (&dfltparm, 0, sizeof dfltparm);
|
||||
dfltparm.ctrl = ctrl;
|
||||
dfltparm.keyinfo.keyid = keyid;
|
||||
dfltparm.keyinfo.mainkeyid = mainkeyid;
|
||||
dfltparm.keyinfo.pubkey_algo = pubkey_algo;
|
||||
|
||||
*r_result = NULL;
|
||||
|
||||
|
@ -192,7 +192,8 @@ gpg_error_t agent_import_key (ctrl_t ctrl, const char *desc,
|
||||
gpg_error_t agent_export_key (ctrl_t ctrl, const char *keygrip,
|
||||
const char *desc, int openpgp_protected,
|
||||
char **cache_nonce_addr,
|
||||
unsigned char **r_result, size_t *r_resultlen);
|
||||
unsigned char **r_result, size_t *r_resultlen,
|
||||
u32 *keyid, u32 *mainkeyid, int pubkey_algo);
|
||||
|
||||
/* Delete a key from the agent. */
|
||||
gpg_error_t agent_delete_key (ctrl_t ctrl, const char *hexkeygrip,
|
||||
|
@ -1190,7 +1190,8 @@ receive_seckey_from_agent (ctrl_t ctrl, gcry_cipher_hd_t cipherhd,
|
||||
|
||||
prompt = gpg_format_keydesc (ctrl, pk, FORMAT_KEYDESC_EXPORT,1);
|
||||
err = agent_export_key (ctrl, hexgrip, prompt, !cleartext, cache_nonce_addr,
|
||||
&wrappedkey, &wrappedkeylen);
|
||||
&wrappedkey, &wrappedkeylen,
|
||||
pk->keyid, pk->main_keyid, pk->pubkey_algo);
|
||||
xfree (prompt);
|
||||
|
||||
if (err)
|
||||
|
Loading…
x
Reference in New Issue
Block a user