aboutsummaryrefslogtreecommitdiffstats
path: root/src/keylist.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2017-03-28 09:40:44 +0000
committerWerner Koch <[email protected]>2017-03-28 09:41:30 +0000
commit813ae5fa2d712aa9679b791c67c9c1c43d36ffe4 (patch)
tree21356c212fafd181ec0a270dc012100e80a07541 /src/keylist.c
parentqt: Disable testEncryptDecryptNowrap (diff)
downloadgpgme-813ae5fa2d712aa9679b791c67c9c1c43d36ffe4.tar.gz
gpgme-813ae5fa2d712aa9679b791c67c9c1c43d36ffe4.zip
core: Prepare for new key listing data send by gpg.
* src/gpgme.h.in (gpgme_user_id_t): New fields 'origin' and 'last_update'. (gpgme_key_t): New fields 'origin' and 'last_update'. * src/conversion.c (_gpgme_parse_timestamp_ul): New. * src/keylist.c (keylist_colon_handler): Parse fields 19 and 20. * tests/run-keylist.c (main): Print new fields. Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'src/keylist.c')
-rw-r--r--src/keylist.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/keylist.c b/src/keylist.c
index c88a7ca5..e16ba4d1 100644
--- a/src/keylist.c
+++ b/src/keylist.c
@@ -552,7 +552,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 18
+#define NR_FIELDS 20
char *field[NR_FIELDS];
int fields = 0;
void *hook;
@@ -733,6 +733,12 @@ keylist_colon_handler (void *priv, char *line)
if (fields >= 17 && *field[17])
parse_pub_field18 (subkey, field[17]);
+ if (fields >= 20)
+ {
+ key->last_update = _gpgme_parse_timestamp_ul (field[18]);
+ key->origin = 0; /* Fixme: Not yet defined in gpg. */
+ }
+
break;
case RT_SUB:
@@ -818,12 +824,15 @@ keylist_colon_handler (void *priv, char *line)
{
if (_gpgme_key_append_name (key, field[9], 1))
return gpg_error (GPG_ERR_ENOMEM); /* FIXME */
- else
- {
- if (field[1])
- set_userid_flags (key, field[1]);
- opd->tmp_uid = key->_last_uid;
- }
+
+ if (field[1])
+ set_userid_flags (key, field[1]);
+ opd->tmp_uid = key->_last_uid;
+ if (fields >= 20)
+ {
+ opd->tmp_uid->last_update = _gpgme_parse_timestamp_ul (field[18]);
+ opd->tmp_uid->origin = 0; /* Fixme: Not yet defined in gpg. */
+ }
}
break;