1
0
mirror of git://git.gnupg.org/gnupg.git synced 2025-01-25 15:27:03 +01:00

ecc-sos: gpg-agent access ECC public key as opaque string.

* agent/cvt-openpgp.c (extract_private_key): Use "/q" for public key.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
This commit is contained in:
NIIBE Yutaka 2020-05-14 16:45:15 +09:00
parent 8513ab8bf3
commit 1e079f4601

View File

@ -1199,7 +1199,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
gpg_error_t err; gpg_error_t err;
gcry_sexp_t list, l2; gcry_sexp_t list, l2;
char *name; char *name;
const char *algoname, *format; const char *algoname, *format, *elems;
int npkey, nskey; int npkey, nskey;
gcry_sexp_t curve = NULL; gcry_sexp_t curve = NULL;
gcry_sexp_t flags = NULL; gcry_sexp_t flags = NULL;
@ -1244,7 +1244,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
if (!strcmp (name, "rsa")) if (!strcmp (name, "rsa"))
{ {
algoname = "rsa"; algoname = "rsa";
format = "ned?p?q?u?"; format = elems = "ned?p?q?u?";
npkey = 2; npkey = 2;
nskey = 6; nskey = 6;
err = gcry_sexp_extract_param (list, NULL, format, err = gcry_sexp_extract_param (list, NULL, format,
@ -1254,7 +1254,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
else if (!strcmp (name, "elg")) else if (!strcmp (name, "elg"))
{ {
algoname = "elg"; algoname = "elg";
format = "pgyx?"; format = elems = "pgyx?";
npkey = 3; npkey = 3;
nskey = 4; nskey = 4;
err = gcry_sexp_extract_param (list, NULL, format, err = gcry_sexp_extract_param (list, NULL, format,
@ -1264,7 +1264,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
else if (!strcmp (name, "dsa")) else if (!strcmp (name, "dsa"))
{ {
algoname = "dsa"; algoname = "dsa";
format = "pqgyx?"; format = elems = "pqgyx?";
npkey = 4; npkey = 4;
nskey = 5; nskey = 5;
err = gcry_sexp_extract_param (list, NULL, format, err = gcry_sexp_extract_param (list, NULL, format,
@ -1274,7 +1274,8 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
else if (!strcmp (name, "ecc") || !strcmp (name, "ecdsa")) else if (!strcmp (name, "ecc") || !strcmp (name, "ecdsa"))
{ {
algoname = "ecc"; algoname = "ecc";
format = "q/d?"; format = "/qd?";
elems = "qd?";
npkey = 1; npkey = 1;
nskey = 2; nskey = 2;
curve = gcry_sexp_find_token (list, "curve", 0); curve = gcry_sexp_find_token (list, "curve", 0);
@ -1298,7 +1299,7 @@ extract_private_key (gcry_sexp_t s_key, int req_private_key_data,
{ {
*r_algoname = algoname; *r_algoname = algoname;
if (r_elems) if (r_elems)
*r_elems = format; *r_elems = elems;
*r_npkey = npkey; *r_npkey = npkey;
if (r_nskey) if (r_nskey)
*r_nskey = nskey; *r_nskey = nskey;