libopendkim: fix sig_signalg left as rsa-sha1 when unsupported algorithm skipped - #334
Merged
thegushi merged 3 commits intoMay 25, 2026
Conversation
…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.
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When opendkim is compiled without Ed25519 support and receives a message signed with
ed25519-sha256,sig_signalgwas left at itsmemsetdefault of 0 (DKIM_SIGN_RSASHA1). Thecontinuein theDKIM_FEATURE_ED25519check jumped past thesig_signalg = signalgassignment, so the Authentication-Results header would incorrectly reportheader.a=rsa-sha1instead ofheader.a=ed25519-sha256.Fix: assign
sig_signalgimmediately whensignalgis decoded from thea=tag, before anycontinuethat might skip the signature.Closes #27