[Pkg-gnupg-commit] [gnupg2] 08/21: wks: Add new policy flag protocol-version

Daniel Kahn Gillmor dkg at fifthhorseman.net
Tue Sep 19 15:33:56 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 332c9eaa2a3c7cae90b389cdaa2c149c5595fb4d
Author: Werner Koch <wk at gnupg.org>
Date:   Tue Sep 12 18:05:00 2017 +0200

    wks: Add new policy flag protocol-version
    
    * tools/gpg-wks.h (policy_flags_s): Add field protocol_version.
    * tools/wks-util.c (wks_parse_policy): Add new policy flag.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>
---
 tools/gpg-wks.h  |  1 +
 tools/wks-util.c | 14 ++++++++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/tools/gpg-wks.h b/tools/gpg-wks.h
index f73c183..caea98e 100644
--- a/tools/gpg-wks.h
+++ b/tools/gpg-wks.h
@@ -63,6 +63,7 @@ struct policy_flags_s
   unsigned int mailbox_only : 1;
   unsigned int dane_only : 1;
   unsigned int auth_submit : 1;
+  unsigned int protocol_version; /* The supported WKS_DRAFT_VERION or 0  */
   unsigned int max_pending;      /* Seconds to wait for a confirmation.  */
 };
 typedef struct policy_flags_s *policy_flags_t;
diff --git a/tools/wks-util.c b/tools/wks-util.c
index 46ad5c2..45237b2 100644
--- a/tools/wks-util.c
+++ b/tools/wks-util.c
@@ -316,7 +316,8 @@ wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown)
     TOK_MAILBOX_ONLY,
     TOK_DANE_ONLY,
     TOK_AUTH_SUBMIT,
-    TOK_MAX_PENDING
+    TOK_MAX_PENDING,
+    TOK_PROTOCOL_VERSION
   };
   static struct {
     const char *name;
@@ -325,7 +326,8 @@ wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown)
     { "mailbox-only", TOK_MAILBOX_ONLY },
     { "dane-only",    TOK_DANE_ONLY    },
     { "auth-submit",  TOK_AUTH_SUBMIT  },
-    { "max-pending",  TOK_MAX_PENDING  }
+    { "max-pending",  TOK_MAX_PENDING  },
+    { "protocol-version", TOK_PROTOCOL_VERSION }
   };
   gpg_error_t err = 0;
   int lnr = 0;
@@ -400,6 +402,14 @@ wks_parse_policy (policy_flags_t flags, estream_t stream, int ignore_unknown)
            * and decide whether to allow other units.  */
           flags->max_pending = atoi (value);
           break;
+        case TOK_PROTOCOL_VERSION:
+          if (!value)
+            {
+              err = gpg_error (GPG_ERR_SYNTAX);
+              goto leave;
+            }
+          flags->protocol_version = atoi (value);
+          break;
         }
     }
 

-- 
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