Skip to content

libopendkim: fix sig_signalg left as rsa-sha1 when unsupported algorithm skipped - #334

Merged
thegushi merged 3 commits into
trusteddomainproject:developfrom
thegushi:issue-27-sig-signalg-early-assign
May 25, 2026
Merged

libopendkim: fix sig_signalg left as rsa-sha1 when unsupported algorithm skipped#334
thegushi merged 3 commits into
trusteddomainproject:developfrom
thegushi:issue-27-sig-signalg-early-assign

Conversation

@thegushi

Copy link
Copy Markdown
Collaborator

When opendkim is compiled without Ed25519 support and receives a message signed with ed25519-sha256, sig_signalg was left at its memset default of 0 (DKIM_SIGN_RSASHA1). The continue in the DKIM_FEATURE_ED25519 check jumped past the sig_signalg = signalg assignment, so the Authentication-Results header would incorrectly report header.a=rsa-sha1 instead of header.a=ed25519-sha256.

Fix: assign sig_signalg immediately when signalg is decoded from the a= tag, before any continue that might skip the signature.

Closes #27

thegushi added 3 commits May 24, 2026 19:49
…tup()

When opendkim is compiled without Ed25519 support and receives a message
signed with ed25519-sha256, sig_signalg was left at its memset default
(0 = DKIM_SIGN_RSASHA1) because the continue statement in the feature
check jumped past the assignment.  The AR header would then incorrectly
report header.a=rsa-sha1 instead of header.a=ed25519-sha256.

Assign sig_signalg immediately when signalg is decoded from the a= tag,
before any continue that might skip the signature.

Fixes trusteddomainproject#27
…kipping unsupported algorithm

Distinguish between a genuinely invalid a= tag value (DKIM_SIGERROR_INVALID_A)
and a valid algorithm that was not compiled into this build
(DKIM_SIGERROR_UNSUPPORTED_A, e.g. ed25519-sha256 without Ed25519 support).

Ed25519 is in wide deployment now; silently skipping these signatures without
any log output makes it hard to diagnose why valid signatures are being ignored.

opendkim now logs LOG_WARNING when a signature is skipped for this reason,
naming the algorithm so operators know exactly what support to add.
@thegushi

Copy link
Copy Markdown
Collaborator Author

Note: Ed25519 is now in wide deployment (many major senders use it as their primary or secondary signing algorithm). This means the 'compiled without Ed25519 support' code path is no longer a rare edge case - operators running older builds or non-OpenSSL crypto are silently ignoring a meaningful portion of legitimate signatures. The warning added here makes that visible in syslog rather than leaving it as a mystery.

@thegushi
thegushi merged commit 0de811f into trusteddomainproject:develop May 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant