summaryrefslogtreecommitdiff
path: root/src/keylist.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/keylist.c')
-rw-r--r--src/keylist.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/keylist.c b/src/keylist.c
index 465b472..582b241 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -422,7 +422,7 @@ keylist_colon_handler (void *priv, char *line)
RT_SSB, RT_SEC, RT_CRT, RT_CRS, RT_REV, RT_SPK
}
rectype = RT_NONE;
-#define NR_FIELDS 16
+#define NR_FIELDS 17
char *field[NR_FIELDS];
int fields = 0;
void *hook;
@@ -537,7 +537,7 @@ keylist_colon_handler (void *priv, char *line)
{
int i = atoi (field[3]);
if (i >= 1 && i < 128)
- subkey->pubkey_algo = i;
+ subkey->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol);
}
/* Field 5 has the long keyid. Allow short key IDs for the
@@ -584,6 +584,15 @@ keylist_colon_handler (void *priv, char *line)
if (err)
return err;
}
+
+ /* Field 17 has the curve name for ECC. */
+ if (fields >= 17 && *field[16])
+ {
+ subkey->curve = strdup (field[16]);
+ if (!subkey->curve)
+ return gpg_error_from_syserror ();
+ }
+
break;
case RT_SUB:
@@ -614,7 +623,7 @@ keylist_colon_handler (void *priv, char *line)
{
int i = atoi (field[3]);
if (i >= 1 && i < 128)
- subkey->pubkey_algo = i;
+ subkey->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol);
}
/* Field 5 has the long keyid. */
@@ -646,6 +655,15 @@ keylist_colon_handler (void *priv, char *line)
if (err)
return err;
}
+
+ /* Field 17 has the curve name for ECC. */
+ if (fields >= 17 && *field[16])
+ {
+ subkey->curve = strdup (field[16]);
+ if (!subkey->curve)
+ return gpg_error_from_syserror ();
+ }
+
break;
case RT_UID:
@@ -728,7 +746,7 @@ keylist_colon_handler (void *priv, char *line)
{
int i = atoi (field[3]);
if (i >= 1 && i < 128)
- keysig->pubkey_algo = i;
+ keysig->pubkey_algo = _gpgme_map_pk_algo (i, ctx->protocol);
}
/* Field 5 has the long keyid. */