mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
gpg: Fix regression in secret key export.
* agent/cvt-openpgp.c (convert_to_openpgp): Fix use gcry_sexp_extract_param. * g10/export.c (do_export_stream): Provide a proper prompt to the agent. -- NB: The export needs more work, in particular the ECC algorithms.
This commit is contained in:
parent
e549799db6
commit
c4d983239a
3 changed files with 36 additions and 24 deletions
10
g10/export.c
10
g10/export.c
|
@ -830,6 +830,7 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
|
|||
log_error ("public key packet not found in keyblock - skipped\n");
|
||||
continue;
|
||||
}
|
||||
setup_main_keyids (keyblock); /* gpg_format_keydesc needs it. */
|
||||
pk = node->pkt->pkt.public_key;
|
||||
keyid_from_pk (pk, keyid);
|
||||
|
||||
|
@ -1077,8 +1078,13 @@ do_export_stream (ctrl_t ctrl, iobuf_t out, strlist_t users, int secret,
|
|||
log_info ("key %s: asking agent for the secret parts\n",
|
||||
keystr_with_sub (keyid, subkid));
|
||||
|
||||
err = agent_export_key (ctrl, hexgrip, "Key foo", NULL,
|
||||
&wrappedkey, &wrappedkeylen);
|
||||
{
|
||||
char *prompt = gpg_format_keydesc (pk,
|
||||
FORMAT_KEYDESC_EXPORT,1);
|
||||
err = agent_export_key (ctrl, hexgrip, prompt, NULL,
|
||||
&wrappedkey, &wrappedkeylen);
|
||||
xfree (prompt);
|
||||
}
|
||||
if (err)
|
||||
goto unwraperror;
|
||||
if (wrappedkeylen < 24)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue