From f031b0fb6c4a525a06577a72e595132e92557f20 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 28 Nov 2019 14:33:27 +0900 Subject: [PATCH] agent: Fix converting to OpenPGP. Signed-off-by: NIIBE Yutaka --- agent/cvt-openpgp.c | 7 +++++-- 1 file 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");