return res;
}
+static const char *
+rspamd_dkim_type_to_string (enum rspamd_dkim_type t)
+{
+ switch (t) {
+ case RSPAMD_DKIM_NORMAL:
+ return "dkim";
+ case RSPAMD_DKIM_ARC_SIG:
+ return "arc_sig";
+ case RSPAMD_DKIM_ARC_SEAL:
+ default:
+ return "arc_seal";
+
+ }
+}
+
/**
* Check task for dkim context using dkim key
* @param ctx dkim verify context
/* Check bh field */
if (memcmp (ctx->bh, cached_bh->digest_normal, ctx->bhlen) != 0) {
msg_info_dkim (
- "dkim: bh value mismatch: got %*Bs, expected %*Bs; "
+ "%s: bh value mismatch: got %*Bs, expected %*Bs; "
"body length %d->%d; d=%s; s=%s",
+ rspamd_dkim_type_to_string (ctx->common.type),
(gint)dlen, cached_bh->digest_normal,
(gint)dlen, ctx->bh,
(gint)(body_end - body_start), ctx->common.body_canonicalised,
res->fail_reason = "rsa verify failed";
msg_info_dkim (
- "dkim: RSA verification failure: got %*Bs, expected %*Bs; "
+ "%s: RSA verification failure: got %*Bs, expected %*Bs; "
"body length %d->%d; headers length %d; d=%s; s=%s",
+ rspamd_dkim_type_to_string (ctx->common.type),
(gint)dlen, raw_digest,
(gint)dlen, ctx->b,
(gint)(body_end - body_start), ctx->common.body_canonicalised,
if (ECDSA_verify (nid, raw_digest, dlen, ctx->b, ctx->blen,
key->key.key_ecdsa) != 1) {
msg_info_dkim (
- "dkim: ECDSA verification failure: got %*Bs, expected %*Bs; "
+ "%s: ECDSA verification failure: got %*Bs, expected %*Bs; "
"body length %d->%d; headers length %d; d=%s; s=%s",
+ rspamd_dkim_type_to_string (ctx->common.type),
(gint)dlen, raw_digest,
(gint)dlen, ctx->b,
(gint)(body_end - body_start), ctx->common.body_canonicalised,
if (!rspamd_cryptobox_verify (ctx->b, ctx->blen, raw_digest, dlen,
key->key.key_eddsa, RSPAMD_CRYPTOBOX_MODE_25519)) {
msg_info_dkim (
- "dkim: EDDSA verification failure: got %*Bs, expected %*Bs; "
+ "%s: EDDSA verification failure: got %*Bs, expected %*Bs; "
"body length %d->%d; headers length %d; d=%s; s=%s",
+ rspamd_dkim_type_to_string (ctx->common.type),
(gint)dlen, raw_digest,
(gint)dlen, ctx->b,
(gint)(body_end - body_start), ctx->common.body_canonicalised,