aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2019-11-28 05:33:27 +0000
committerNIIBE Yutaka <[email protected]>2020-05-04 01:57:08 +0000
commitf031b0fb6c4a525a06577a72e595132e92557f20 (patch)
treed7a6ca9963fa31b01ba7fe34dc9e8b7242b5cf30
parentFix exporting key for ECC. (diff)
downloadgnupg-f031b0fb6c4a525a06577a72e595132e92557f20.tar.gz
gnupg-f031b0fb6c4a525a06577a72e595132e92557f20.zip
agent: Fix converting to OpenPGP.
Signed-off-by: NIIBE Yutaka <[email protected]>
-rw-r--r--agent/cvt-openpgp.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/agent/cvt-openpgp.c b/agent/cvt-openpgp.c
index 003402956..4f23153ff 100644
--- a/agent/cvt-openpgp.c
+++ b/agent/cvt-openpgp.c
@@ -1274,7 +1274,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
else if (!strcmp (name, "ecc") || !strcmp (name, "ecdsa"))
{
algoname = "ecc";
- format = "qd?";
+ format = "/qd?";
npkey = 1;
nskey = 2;
curve = gcry_sexp_find_token (list, "curve", 0);
@@ -1365,7 +1365,10 @@ convert_to_openpgp (ctrl_t ctrl, gcry_sexp_t s_key, const char *passphrase,
put_membuf_str (&mbuf, "(skey");
for (i=j=0; i < npkey; i++)
{
- put_membuf_str (&mbuf, " _ %m");
+ if (gcry_mpi_get_flag (array[i], GCRYMPI_FLAG_OPAQUE))
+ put_membuf_str (&mbuf, " e %m");
+ else
+ put_membuf_str (&mbuf, " _ %m");
format_args[j++] = array + i;
}
put_membuf_str (&mbuf, " e %m");