aboutsummaryrefslogtreecommitdiffstats
path: root/tools/gpg-wks-client.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2016-09-02 14:54:42 +0000
committerWerner Koch <[email protected]>2016-09-02 14:56:04 +0000
commit46362cbc0e2260e989820795a6e4245c72335172 (patch)
tree9e21a8b9bd0e2e2bdebcd388f702d4c20b6c3c47 /tools/gpg-wks-client.c
parentdirmngr: Add --policy-flags option to WKD_GET. (diff)
downloadgnupg-46362cbc0e2260e989820795a6e4245c72335172.tar.gz
gnupg-46362cbc0e2260e989820795a6e4245c72335172.zip
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 <[email protected]>
Diffstat (limited to '')
-rw-r--r--tools/gpg-wks-client.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index 34b26ea8e..c0e34c499 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -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)