[git] GnuPG - branch, STABLE-BRANCH-2-2, updated. gnupg-2.2.0-9-ga821b4f
by Werner Koch
cvs at cvs.gnupg.org
Tue Sep 12 18:12:41 CEST 2017
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".
The branch, STABLE-BRANCH-2-2 has been updated
via a821b4f5567d02c3329c2b94a73dcbe12e6699a2 (commit)
via 332c9eaa2a3c7cae90b389cdaa2c149c5595fb4d (commit)
from 8b5a2474f21dd4f1aa2a283e2f57d75e42742af5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit a821b4f5567d02c3329c2b94a73dcbe12e6699a2
Author: Werner Koch <wk at gnupg.org>
Date: Tue Sep 12 18:08:09 2017 +0200
wks: Add hack for the broken posteo system
* tools/gpg-wks-client.c (command_send): Additional hack for posteo.
Check the protocol-version flag.
Signed-off-by: Werner Koch <wk at gnupg.org>
diff --git a/tools/gpg-wks-client.c b/tools/gpg-wks-client.c
index 5b98de4..e703640 100644
--- a/tools/gpg-wks-client.c
+++ b/tools/gpg-wks-client.c
@@ -693,6 +693,7 @@ command_send (const char *fingerprint, char *userid)
mime_maker_t mime = NULL;
struct policy_flags_s policy;
int no_encrypt = 0;
+ int posteo_hack = 0;
const char *domain;
memset (&policy, 0, sizeof policy);
@@ -762,11 +763,14 @@ command_send (const char *fingerprint, char *userid)
if (policy.auth_submit)
log_info ("no confirmation required for '%s'\n", addrspec);
- /* Hack to support old providers. */
- if (policy.auth_submit && !ascii_strcasecmp (domain, "posteo.de"))
+ /* Hack to support posteo but let them disable this by setting the
+ * new policy-version flag. */
+ if (policy.protocol_version < 3
+ && !ascii_strcasecmp (domain, "posteo.de"))
{
log_info ("Warning: Using draft-1 method for domain '%s'\n", domain);
no_encrypt = 1;
+ posteo_hack = 1;
}
/* Encrypt the key part. */
@@ -805,6 +809,18 @@ command_send (const char *fingerprint, char *userid)
void *data;
size_t datalen, n;
+ if (posteo_hack)
+ {
+ /* Needs a multipart/mixed with one(!) attachment. It does
+ * not grok a non-multipart mail. */
+ err = mime_maker_add_header (mime, "Content-Type", "multipart/mixed");
+ if (err)
+ goto leave;
+ err = mime_maker_add_container (mime);
+ if (err)
+ goto leave;
+ }
+
err = mime_maker_add_header (mime, "Content-type",
"application/pgp-keys");
if (err)
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>
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;
}
}
-----------------------------------------------------------------------
Summary of changes:
tools/gpg-wks-client.c | 20 ++++++++++++++++++--
tools/gpg-wks.h | 1 +
tools/wks-util.c | 14 ++++++++++++--
3 files changed, 31 insertions(+), 4 deletions(-)
hooks/post-receive
--
The GNU Privacy Guard
http://git.gnupg.org
More information about the Gnupg-commits
mailing list