From 73f99d117f06ef3c5d8833d221adc16025fbd620 Mon Sep 17 00:00:00 2001 From: FUTATSUKI Yasuhito Date: Tue, 10 Sep 2024 04:10:40 +0900 Subject: [PATCH] Accept no-result Authentication-Results: header * opendmarc/opendmarc-ar.c (ares_parse): As above. --- opendmarc/opendmarc-ar.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/opendmarc/opendmarc-ar.c b/opendmarc/opendmarc-ar.c index c76a0ff7..7e947594 100644 --- a/opendmarc/opendmarc-ar.c +++ b/opendmarc/opendmarc-ar.c @@ -422,7 +422,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])) @@ -447,10 +447,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 */ n++; r = 0; @@ -619,6 +629,10 @@ ares_parse(u_char *hdr, struct authres *ar) } break; + + case 15: /* terminal state after no-result */ + /* any token should not appear */ + return -1; } }