Skip to content

Commit bb2dc58

Browse files
committed
libopenarc: remove "c" from the list of required tags
c= Message canonicalization (plain-text; OPTIONAL, default is "simple/simple").
1 parent b4189e6 commit bb2dc58

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ All notable changes to this project will be documented in this file.
1212

1313
### Fixed
1414
- libopenarc - `arc_free()` accepts NULL.
15+
- libopenarc - `c` is not a required tag in `ARC-Message-Signature`.
1516

1617
## [1.1.0](https://github.com/flowerysong/OpenARC/releases/tag/v1.1.0) - 2024-11-05
1718

libopenarc/arc.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -404,9 +404,10 @@ arc_genamshdr(ARC_MESSAGE *msg,
404404
arc_dstring_printf(dstr, ";%scv=%s", delim,
405405
arc_code_to_name(chainstatus, msg->arc_cstate));
406406
}
407-
else
407+
else if (msg->arc_canonhdr != ARC_CANON_SIMPLE ||
408+
msg->arc_canonbody != ARC_CANON_SIMPLE)
408409
{
409-
/* c= */
410+
/* Add c= for the AMS if it's not the RFC default simple/simple */
410411
arc_dstring_printf(
411412
dstr, ";%sc=%s/%s", delim,
412413
arc_code_to_name(canonicalizations, msg->arc_canonhdr),
@@ -1686,8 +1687,7 @@ arc_process_set(ARC_MESSAGE *msg,
16861687
arc_param_get(set, "d") == NULL ||
16871688
arc_param_get(set, "b") == NULL ||
16881689
arc_param_get(set, "bh") == NULL ||
1689-
arc_param_get(set, "i") == NULL ||
1690-
arc_param_get(set, "c") == NULL || arc_param_get(set, "a") == NULL)
1690+
arc_param_get(set, "i") == NULL || arc_param_get(set, "a") == NULL)
16911691
{
16921692
arc_error(msg, "missing parameter(s) in %s data", settype);
16931693
set->set_bad = true;

test/test_milter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_milter_staticmsg(run_miltertest):
135135
def test_milter_canon_simple(run_miltertest):
136136
"""Sign a message with simple canonicalization and then verify it"""
137137
res = run_miltertest()
138-
assert 'c=simple/simple' in res['headers'][1][1]
138+
assert 'c=relaxed' not in res['headers'][1][1]
139139

140140
res = run_miltertest(res['headers'])
141141
assert 'cv=pass' in res['headers'][0][1]

0 commit comments

Comments
 (0)