[Pkg-gnupg-commit] [gnupg2] 12/21: wks: Print the UID creation time with gpg-wks-client --check.
Daniel Kahn Gillmor
dkg at fifthhorseman.net
Tue Sep 19 15:33:58 UTC 2017
This is an automated email from the git hooks/post-receive script.
dkg pushed a commit to branch master
in repository gnupg2.
commit a0035986a8615df056182bb9af775b8b7b22003d
Author: Werner Koch <wk at gnupg.org>
Date: Mon Sep 18 11:31:36 2017 +0200
wks: Print the UID creation time with gpg-wks-client --check.
* tools/gpg-wks.h (uidinfo_list_s): Add field 'created'.
* tools/wks-util.c (append_to_uidinfo_list): Add arf 'created'.
(wks_list_key): Pass timestamp to append_to_uidinfo_list.
* tools/gpg-wks-client.c (command_check): Print UID creation time.
Signed-off-by: Werner Koch <wk at gnupg.org>
---
tools/gpg-wks-client.c | 1 +
tools/gpg-wks.h | 1 +
tools/wks-util.c | 6 ++++--
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index 6b83de8..18a0edd 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -662,6 +662,7 @@ command_check (char *userid)
if (opt.verbose)
{
log_info (" user-id: %s\n", sl->uid);
+ log_info (" created: %s\n", asctimestamp (sl->created));
if (sl->mbox)
log_info (" addr-spec: %s\n", sl->mbox);
}
diff --git a/tools/gpg-wks.h b/tools/gpg-wks.h
index 7fc8d9a..cb89fd5 100644
--- a/tools/gpg-wks.h
+++ b/tools/gpg-wks.h
@@ -73,6 +73,7 @@ typedef struct policy_flags_s *policy_flags_t;
struct uidinfo_list_s
{
struct uidinfo_list_s *next;
+ time_t created; /* Time the userid was created. */
char *mbox; /* NULL or the malloced mailbox from UID. */
char uid[1];
};
diff --git a/tools/wks-util.c b/tools/wks-util.c
index bc076a7..8fc0a2e 100644
--- a/tools/wks-util.c
+++ b/tools/wks-util.c
@@ -94,7 +94,7 @@ wks_write_status (int no, const char *format, ...)
/* Append UID to LIST and return the new item. On success LIST is
* updated. On error ERRNO is set and NULL returned. */
static uidinfo_list_t
-append_to_uidinfo_list (uidinfo_list_t *list, const char *uid)
+append_to_uidinfo_list (uidinfo_list_t *list, const char *uid, time_t created)
{
uidinfo_list_t r, sl;
@@ -103,6 +103,7 @@ append_to_uidinfo_list (uidinfo_list_t *list, const char *uid)
return NULL;
strcpy (sl->uid, uid);
+ sl->created = created;
sl->mbox = mailbox_from_userid (uid);
sl->next = NULL;
if (!*list)
@@ -273,7 +274,8 @@ wks_list_key (estream_t key, char **r_fpr, uidinfo_list_t *r_mboxes)
else if (!strcmp (fields[0], "uid") && nfields > 9)
{
/* Fixme: Unescape fields[9] */
- if (!append_to_uidinfo_list (&mboxes, fields[9]))
+ if (!append_to_uidinfo_list (&mboxes, fields[9],
+ parse_timestamp (fields[5], NULL)))
{
err = gpg_error_from_syserror ();
goto leave;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gnupg2.git
More information about the Pkg-gnupg-commit
mailing list