Skip to content

Commit

Permalink
Merge pull request trusteddomainproject#205 from futatuki/parse-ar-no…
Browse files Browse the repository at this point in the history
…-result

opendkim-ar: Accept AR header with a no-result as a valid syntax.
  • Loading branch information
futatuki committed Apr 26, 2024
2 parents 152e233 + 48fda00 commit eed4edd
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions opendkim/opendkim-ar.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ ares_parse(u_char *hdr, struct authres *ar)
if (tokens[c][0] == ';')
{
prevstate = state;
state = 3;
state = 14;
}
else if (isascii(tokens[c][0]) &&
isdigit(tokens[c][0]))
Expand All @@ -479,10 +479,20 @@ ares_parse(u_char *hdr, struct authres *ar)
return -1;

prevstate = state;
state = 3;
state = 14;

break;

case 14: /* method or "none" */
if (strcasecmp((char *) tokens[c], "none") == 0)
{
prevstate = state;
state = 15;
continue;
}

/* FALLTHROUGH */

case 3: /* method */
if (n == 0 || !ares_dedup(ar, n))
n++;
Expand Down Expand Up @@ -651,6 +661,10 @@ ares_parse(u_char *hdr, struct authres *ar)
state = 9;

break;

case 15: /* terminal state after no-result */
/* no token should not appear */
return -1;
}
}

Expand Down

0 comments on commit eed4edd

Please sign in to comment.