From: Vsevolod Stakhov Date: Tue, 2 Aug 2016 16:06:29 +0000 (+0100) Subject: [Fix] Add spaces to dkim signature to allow folding X-Git-Tag: 1.3.2~71 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=bad6305f6f173ec9a12d0992ca1956b51e650e27;p=rspamd.git [Fix] Add spaces to dkim signature to allow folding --- diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c index 16cb7f371..057d7b33b 100644 --- a/src/libserver/dkim.c +++ b/src/libserver/dkim.c @@ -2066,19 +2066,19 @@ rspamd_dkim_sign (struct rspamd_task *task, } hdr = g_string_sized_new (255); - rspamd_printf_gstring (hdr, "v=1;a=rsa-sha256;c=%s/%s;d=%s;s=%s;", + rspamd_printf_gstring (hdr, "v=1; a=rsa-sha256; c=%s/%s; d=%s; s=%s; ", ctx->common.header_canon_type == DKIM_CANON_RELAXED ? "relaxed" : "simple", ctx->common.body_canon_type == DKIM_CANON_RELAXED ? "relaxed" : "simple", domain, selector); if (expire > 0) { - rspamd_printf_gstring (hdr, "x=%t;", expire); + rspamd_printf_gstring (hdr, "x=%t; ", expire); } if (len > 0) { - rspamd_printf_gstring (hdr, "l=%z;", len); + rspamd_printf_gstring (hdr, "l=%z; ", len); } - rspamd_printf_gstring (hdr, "t=%t;h=", time (NULL)); + rspamd_printf_gstring (hdr, "t=%t; h=", time (NULL)); /* Now canonize headers */ for (i = 0; i < ctx->common.hlist->len; i++) { @@ -2101,7 +2101,7 @@ rspamd_dkim_sign (struct rspamd_task *task, EVP_DigestFinal_ex (ctx->common.body_hash, raw_digest, NULL); b64_data = rspamd_encode_base64 (raw_digest, dlen, 0, NULL); - rspamd_printf_gstring (hdr, "bh=%s;b=", b64_data); + rspamd_printf_gstring (hdr, " bh=%s; b=", b64_data); g_free (b64_data); if (ctx->common.header_canon_type == DKIM_CANON_RELAXED) {