continue;
}
else {
+ *t++ = ' ';
+ h ++;
+ inlen --;
+ len --;
got_sp = TRUE;
+ continue;
}
}
else {
*start = h;
+ /* Maybe extremely slow
+ * msg_debug ("update signature with buffer: %*s", t - buf, buf);
+ */
g_checksum_update (ck, buf, t - buf);
return !finished;
while ((*p == '\r' || *p == '\n') && p >= c) {
p --;
}
- if (p - c > 0) {
+
+ if (p - c + 1 > 0) {
msg_debug ("final update hash with signature part: %*s", p - c + 1, c);
g_checksum_update (ctx->headers_hash, c, p - c + 1);
}
rspamd_dkim_canonize_header_relaxed (rspamd_dkim_context_t *ctx, const gchar *header, const gchar *header_name, gboolean is_sign)
{
const gchar *h;
- gchar *t, *buf, *v;
+ gchar *t, *buf;
guint inlen;
gboolean got_sp, allocated = FALSE;
*t++ = ':';
/* Value part */
- v = t;
h = header;
got_sp = FALSE;
}
else {
got_sp = TRUE;
+ *t ++ = ' ';
+ h ++;
+ continue;
}
}
else {
if (! rspamd_dkim_canonize_header_relaxed (ctx, rh->value, header_name, is_sig)) {
return FALSE;
}
- rh = rh->next;
+ if (!is_sig) {
+ rh = rh->next;
+ }
+ else {
+ rh = NULL;
+ }
}
return TRUE;
}