1
0
Fork 0
mirror of git://git.gnupg.org/gnupg.git synced 2025-07-03 22:56:33 +02:00

wks: Add framework for policy flags.

* tools/call-dirmngr.c (wkd_get_policy_flags): New.
* tools/gpg-wks.h (struct policy_flags_s, policy_flags_t): New.
* tools/wks-util.c (wks_parse_policy): New.
* tools/gpg-wks-client.c (command_send): Get the policy flags to show
a new info line.
* tools/gpg-wks-server.c (get_policy_flags): New.
(process_new_key): get policy flag and add a stub for "auth-submit".
(command_list_domains): Check policy flags.

Signed-off-by: Werner Koch <wk@gnupg.org>
This commit is contained in:
Werner Koch 2016-09-02 16:54:42 +02:00
parent 505ee45106
commit 46362cbc0e
No known key found for this signature in database
GPG key ID: E3FDFF218E45B72B
6 changed files with 310 additions and 11 deletions

View file

@ -447,6 +447,9 @@ command_send (const char *fingerprint, char *userid)
estream_t key = NULL;
char *submission_to = NULL;
mime_maker_t mime = NULL;
struct policy_flags_s policy;
memset (&policy, 0, sizeof policy);
if (classify_user_id (fingerprint, &desc, 1)
|| !(desc.mode == KEYDB_SEARCH_MODE_FPR
@ -473,6 +476,29 @@ command_send (const char *fingerprint, char *userid)
goto leave;
log_info ("submitting request to '%s'\n", submission_to);
/* Get the policy flags. */
{
estream_t mbuf;
err = wkd_get_policy_flags (addrspec, &mbuf);
if (err)
{
log_error ("error reading policy flags for '%s': %s\n",
submission_to, gpg_strerror (err));
goto leave;
}
if (mbuf)
{
err = wks_parse_policy (&policy, mbuf, 1);
es_fclose (mbuf);
if (err)
goto leave;
}
}
if (policy.auth_submit)
log_info ("no confirmation required for '%s'\n", addrspec);
/* Send the key. */
err = mime_maker_new (&mime, NULL);
if (err)