if (rr->type == T_TXT)
{
int rr_offset = 0;
- int answer_offset = 0;
/* Copy record content to the answer buffer */
}
/* check if this looks like a DKIM record */
- if (strncmp(g->s, "v=", 2) != 0 || strncasecmp(g->s, "v=dkim", 6) == 0)
+ if (Ustrncmp(g->s, "v=", 2) != 0 || strncasecmp(CS g->s, "v=dkim", 6) == 0)
{
store_reset(g->s + g->ptr + 1);
return string_from_gstring(g);
pdkim_signature * sig;
int rc;
gstring * g = NULL;
-const uschar * errstr;
+const uschar * errstr = NULL;
store_pool = POOL_PERM;
/* Finish DKIM operation and fetch link to signatures chain */
rc = pdkim_feed_finish(dkim_verify_ctx, &dkim_signatures, &errstr);
-if (rc != PDKIM_OK)
- {
- log_write(0, LOG_MAIN, "DKIM: validation error: %.100s%s%s", pdkim_errstr(rc),
- errstr ? ": " : "", errstr ? errstr : US"");
- goto out;
- }
+if (rc != PDKIM_OK && errstr)
+ log_write(0, LOG_MAIN, "DKIM: validation error: %s", errstr);
/* Build a colon-separated list of signing domains (and identities, if present) in dkim_signers */
pdkim_canon,
pdkim_canon, -1, 0, 0);
+ if (!pdkim_set_bodyhash(&ctx, sig))
+ goto bad;
+
if (!ctx.sig) /* link sig to context chain */
ctx.sig = sig;
else
goto CLEANUP;
}
-if (prefix && (pdkim_feed(&ctx, prefix, Ustrlen(prefix))) != PDKIM_OK)
+if (prefix && (pdkim_rc = pdkim_feed(&ctx, prefix, Ustrlen(prefix))) != PDKIM_OK)
goto pk_bad;
if (lseek(fd, off, SEEK_SET) < 0)