Linux maintainer tooling and workflows
 help / color / mirror / Atom feed
* b4: DKIM 'x' causes BADSIGs on otherwise valid emails
@ 2026-07-25 13:46 Arsen Arsenović
  2026-07-27  0:42 ` Konstantin Ryabitsev
  0 siblings, 1 reply; 2+ messages in thread
From: Arsen Arsenović @ 2026-07-25 13:46 UTC (permalink / raw)
  To: tools

[-- Attachment #1: Type: text/plain, Size: 1381 bytes --]

Hi all!

DKIM signatures expire, due to the 'x' key; see
https://datatracker.ietf.org/doc/html/rfc6376#page-24

dkimpy implements this check:

    if b'x' in sig:
        if re.match(br"\d+$", sig[b'x']) is None:
            raise ValidationError(
              "x= value is not a decimal integer (%s)" % sig[b'x'])
        x_sign = int(sig[b'x'])
        now = int(time.time())
        slop = 36000 # 10H leeway for mailers with inaccurate clocks
        if x_sign < now - slop:
            raise ValidationError(
                "x= value is past (%s)" % sig[b'x'])
        if t_sign and x_sign < t_sign:
            raise ValidationError(
                "x= value is less than t= value (x=%s t=%s)" %
                (sig[b'x'], sig[b't']))

... thus, it seems to be impossible for 'b4 am' to verify signatures of
patches sent more than ten hours ago.

Of course, this makes sense for a compliant DKIM implementation, but b4
frequently verifies emails long after their delivery, so it can cause
trouble there.

Hacking this check out of dkimpy works.

Reproducer:

  b4 am --allow-unicode-control-chars https://inbox.sourceware.org/gcc-patches/20260709164046.2207585-2-aarsenovic@baylibre.com/

b4 and dkimpy version:

  ~$ qlist -Iv b4 dkim
  dev-python/dkimpy-1.1.8
  net-mail/b4-0.15.2-r1

Have a lovely day!
-- 
Arsen Arsenović

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 300 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: b4: DKIM 'x' causes BADSIGs on otherwise valid emails
  2026-07-25 13:46 b4: DKIM 'x' causes BADSIGs on otherwise valid emails Arsen Arsenović
@ 2026-07-27  0:42 ` Konstantin Ryabitsev
  0 siblings, 0 replies; 2+ messages in thread
From: Konstantin Ryabitsev @ 2026-07-27  0:42 UTC (permalink / raw)
  To: Arsen Arsenović; +Cc: tools

On Sat, Jul 25, 2026 at 03:46:44PM +0200, Arsen Arsenović wrote:
> Hi all!
> 
> DKIM signatures expire, due to the 'x' key; see
> https://datatracker.ietf.org/doc/html/rfc6376#page-24
> 
> dkimpy implements this check:
> 
>     if b'x' in sig:
>         if re.match(br"\d+$", sig[b'x']) is None:
>             raise ValidationError(
>               "x= value is not a decimal integer (%s)" % sig[b'x'])
>         x_sign = int(sig[b'x'])
>         now = int(time.time())
>         slop = 36000 # 10H leeway for mailers with inaccurate clocks
>         if x_sign < now - slop:
>             raise ValidationError(
>                 "x= value is past (%s)" % sig[b'x'])
>         if t_sign and x_sign < t_sign:
>             raise ValidationError(
>                 "x= value is less than t= value (x=%s t=%s)" %
>                 (sig[b'x'], sig[b't']))
> 
> ... thus, it seems to be impossible for 'b4 am' to verify signatures of
> patches sent more than ten hours ago.

Correct, hence my 3-year-old bug:
https://bugs.launchpad.net/dkimpy/+bug/2047054

I even suggest the simplest way to fix it, but dkimpy appears to be abandoned.
I've not yet decided what would be a better course of action here.

-K

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-07-27  0:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-25 13:46 b4: DKIM 'x' causes BADSIGs on otherwise valid emails Arsen Arsenović
2026-07-27  0:42 ` Konstantin Ryabitsev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox