diff options
author | Werner Koch <[email protected]> | 2014-05-08 18:39:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-05-08 18:39:15 +0000 |
commit | 88f15336ec0eadde68ff2618349efb9006b8e801 (patch) | |
tree | b6d0f52df5a39ca6b974dcaba06e29e4f4ed4e21 /src/keylist.c | |
parent | Fix a memory access and a double slash bug. (diff) | |
download | gpgme-88f15336ec0eadde68ff2618349efb9006b8e801.tar.gz gpgme-88f15336ec0eadde68ff2618349efb9006b8e801.zip |
Add field CURVE to the key info.
* src/gpgme.h.in (struct _gpgme_subkey): Add field CURVE.
* src/key.c (gpgme_key_unref): Free CURVE.
* src/keylist.c (keylist_colon_handler): Set CURVE.
* src/gpgme.c (gpgme_release): For failsafe reasons reset engine and
engine info after freeing.
--
The engine hack is useful in case the other release functions
accidently call engine release.
Diffstat (limited to 'src/keylist.c')
-rw-r--r-- | src/keylist.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/keylist.c b/src/keylist.c index a3613339..582b241b 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; @@ -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: @@ -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: |