]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
arc.lua: fix signature of ARC-Seal header
authorJan Smutny <js@excello.cz>
Thu, 30 Mar 2023 09:16:53 +0000 (11:16 +0200)
committerJan Smutny <js@excello.cz>
Thu, 30 Mar 2023 09:29:05 +0000 (11:29 +0200)
The ARC Set header field values must be supplied to the hash function in increasing
instance order, starting at 1.
Defined in https://www.rfc-editor.org/rfc/rfc8617.html#section-5.1.1.

src/plugins/lua/arc.lua

index 33ae3dba2066eb1fe3dfd99c19bf09f51f63d6a8..4fdd4fe9fa6504b020203b3a32dfa03801e4b2b5 100644 (file)
@@ -530,7 +530,7 @@ local function arc_sign_seal(task, params, header)
   local cur_idx = 1
   if arc_seals then
     cur_idx = #arc_seals + 1
-    for i = (cur_idx - 1), 1, (-1) do
+    for i = 1, #arc_seals, 1 do
       if arc_auth_results[i] then
         local s = dkim_canonicalize('ARC-Authentication-Results',
           arc_auth_results[i].raw_header)