Skip to content

Commit

Permalink
Correctly indicate no auth result in AAR
Browse files Browse the repository at this point in the history
It is not valid to have no authentication results; if no message
authentication was performed the special value no-result
(`[CFWS] ";" [CFWS] "none"`) should be used.

trusteddomainproject/OpenARC#174
  • Loading branch information
flowerysong committed Oct 2, 2024
1 parent 45cbb91 commit 9dc8658
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion libopenarc/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3276,8 +3276,12 @@ arc_getseal(ARC_MESSAGE *msg, ARC_HDRFIELD **seal, char *authservid,
arc_dstring_printf(dstr, "ARC-Authentication-Results:i=%u; %s",
msg->arc_nsets + 1,
msg->arc_authservid);
if (ar != NULL)
if (ar == NULL) {
/* no-result per RFC 8601 2.2 */
arc_dstring_printf(dstr, "; none");
} else {
arc_dstring_printf(dstr, "; %s", (char *) ar);
}

status = arc_parse_header_field(msg, arc_dstring_get(dstr),
arc_dstring_len(dstr), &h);
Expand Down

0 comments on commit 9dc8658

Please sign in to comment.