aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Smutny <js@excello.cz>2023-03-20 09:48:26 +0100
committerJan Smutny <js@excello.cz>2023-03-30 11:29:05 +0200
commit7a71edd3f5c6b270c900b102bfc54085d443316a (patch)
tree620b7e9d479da4b0435cabece1ae04ac4cbef6fe
parent415d7637aa80efa6f89bb148eabe1d79ea3c6391 (diff)
downloadrspamd-7a71edd3f5c6b270c900b102bfc54085d443316a.tar.gz
rspamd-7a71edd3f5c6b270c900b102bfc54085d443316a.zip
arc.lua: fix usage of ARC-Authentication-Results in arc_sign_seal func
The ARC-Authentication-Results header field was gathered in function arc_sign_seal directly from headers. This commit adds the sorted ARC-Authentication-Results header to cache which is then reused in arc_sign_seal function.
-rw-r--r--src/plugins/lua/arc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lua/arc.lua b/src/plugins/lua/arc.lua
index 95f2c28b5..33ae3dba2 100644
--- a/src/plugins/lua/arc.lua
+++ b/src/plugins/lua/arc.lua
@@ -253,6 +253,7 @@ local function arc_callback(task)
task:cache_set('arc-sigs', cbdata.sigs)
task:cache_set('arc-seals', cbdata.seals)
+ task:cache_set('arc-authres', cbdata.ars)
if validation_error then
-- ARC rejection but no strong failure for signing
@@ -489,7 +490,7 @@ rspamd_config:register_dependency('ARC_CHECK', 'DKIM_CHECK')
local function arc_sign_seal(task, params, header)
local arc_sigs = task:cache_get('arc-sigs')
local arc_seals = task:cache_get('arc-seals')
- local arc_auth_results = task:get_header_full('ARC-Authentication-Results') or {}
+ local arc_auth_results = task:cache_get('arc-authres')
local cur_auth_results
local privkey
@@ -532,7 +533,7 @@ local function arc_sign_seal(task, params, header)
for i = (cur_idx - 1), 1, (-1) do
if arc_auth_results[i] then
local s = dkim_canonicalize('ARC-Authentication-Results',
- arc_auth_results[i].value)
+ arc_auth_results[i].raw_header)
sha_ctx:update(s)
lua_util.debugm(N, task, 'update signature with header: %s', s)
end