aboutsummaryrefslogtreecommitdiffstats
path: root/src/libserver
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-06 21:19:53 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2020-02-06 21:19:53 +0000
commitbf64e86c02545a9fec0659620d1de244042a4a29 (patch)
treecef902e989de902f1e9b85aba520b14a7ecdc732 /src/libserver
parentfae8655e4084e8f4df4b32b7e7ead5f5656e4f60 (diff)
downloadrspamd-bf64e86c02545a9fec0659620d1de244042a4a29.tar.gz
rspamd-bf64e86c02545a9fec0659620d1de244042a4a29.zip
[Minor] Some more logging improvements
Diffstat (limited to 'src/libserver')
-rw-r--r--src/libserver/dkim.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/libserver/dkim.c b/src/libserver/dkim.c
index 503347544..fb98c3d63 100644
--- a/src/libserver/dkim.c
+++ b/src/libserver/dkim.c
@@ -2347,6 +2347,21 @@ rspamd_dkim_check_bh_cached (struct rspamd_dkim_common_ctx *ctx,
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
@@ -2445,8 +2460,9 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
/* 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,
@@ -2581,8 +2597,9 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
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,
@@ -2594,8 +2611,9 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
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,
@@ -2610,8 +2628,9 @@ rspamd_dkim_check (rspamd_dkim_context_t *ctx,
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,