Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DKIM: if one of signatures are correct for dkim domain, then use it. #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions src/src/dkim.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ void
dkim_exim_acl_setup(uschar * id)
{
pdkim_signature * sig;
pdkim_signature *candidate_sig = NULL;
uschar * cmp_val;

dkim_cur_sig = NULL;
Expand All @@ -295,20 +296,28 @@ for (sig = dkim_signatures; sig; sig = sig->next)
)
{
dkim_cur_sig = sig;

/* The "dkim_domain" and "dkim_selector" expansion variables have
related globals, since they are used in the signing code too.
Instead of inventing separate names for verification, we set
them here. This is easy since a domain and selector is guaranteed
to be in a signature. The other dkim_* expansion items are
dynamically fetched from dkim_cur_sig at expansion time (see
function below). */

dkim_signing_domain = US sig->domain;
dkim_signing_selector = US sig->selector;
dkim_key_length = sig->sigdata.len * 8;
return;
if (!candidate_sig) candidate_sig = sig;
if (sig->verify_status == PDKIM_VERIFY_PASS)
{
candidate_sig = sig;
break;
}
}

if (candidate_sig)
{
/* The "dkim_domain" and "dkim_selector" expansion variables have
related globals, since they are used in the signing code too.
Instead of inventing separate names for verification, we set
them here. This is easy since a domain and selector is guaranteed
to be in a signature. The other dkim_* expansion items are
dynamically fetched from dkim_cur_sig at expansion time (see
function below). */

dkim_signing_domain = US candidate_sig->domain;
dkim_signing_selector = US candidate_sig->selector;
dkim_key_length = candidate_sig->sigdata.len * 8;
}
}


Expand Down