diff options
author | Werner Koch <wk@gnupg.org> | 2017-09-18 11:16:07 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2017-09-18 11:16:07 +0200 |
commit | 4e0696de897cac6a34d55a69d8889faf26f1a923 (patch) | |
tree | 9f3c6e2b4bf1a23b85000ded5380f0d8f52b631b /tools/gpg-wks.h | |
parent | gpgv: Initialize compliance checker. (diff) | |
download | gnupg2-4e0696de897cac6a34d55a69d8889faf26f1a923.tar.xz gnupg2-4e0696de897cac6a34d55a69d8889faf26f1a923.zip |
wks: Use dedicated type to convey user ids.
* tools/gpg-wks.h (uidinfo_list_s, uidinfo_list_t): New.
* tools/wks-util.c (append_to_uidinfo_list): New.
(free_uidinfo_list): New.
(wks_list_key): Change arg r_mboxes to uidinfo_list_t. Use
append_to_uidinfo_list.
* tools/gpg-wks-server.c (sserver_ctx_s): Replace strlist_t by
uidinfo_list_t.
(process_new_key): Ditto.
(check_and_publish): Ditto.
(command_receive_cb): Replace free_strlist by free_uidinfo_list.
* tools/gpg-wks-client.c (command_check): Replace strlist_t by
uidinfo_list_t. Also print user id in verbose mode.
Signed-off-by: Werner Koch <wk@gnupg.org>
Diffstat (limited to 'tools/gpg-wks.h')
-rw-r--r-- | tools/gpg-wks.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/gpg-wks.h b/tools/gpg-wks.h index caea98e2f..7fc8d9acd 100644 --- a/tools/gpg-wks.h +++ b/tools/gpg-wks.h @@ -69,11 +69,23 @@ struct policy_flags_s typedef struct policy_flags_s *policy_flags_t; +/* An object to convey user ids of a key. */ +struct uidinfo_list_s +{ + struct uidinfo_list_s *next; + char *mbox; /* NULL or the malloced mailbox from UID. */ + char uid[1]; +}; +typedef struct uidinfo_list_s *uidinfo_list_t; + + /*-- wks-util.c --*/ void wks_set_status_fd (int fd); void wks_write_status (int no, const char *format, ...) GPGRT_ATTR_PRINTF(2,3); -gpg_error_t wks_list_key (estream_t key, char **r_fpr, strlist_t *r_mboxes); +void free_uidinfo_list (uidinfo_list_t list); +gpg_error_t wks_list_key (estream_t key, char **r_fpr, + uidinfo_list_t *r_mboxes); gpg_error_t wks_send_mime (mime_maker_t mime); gpg_error_t wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown); |