Skip to content

Commit 5b477c3

Browse files
authored
cms: don't insert signing time attribute by default (#1148)
The previous implementation of `SignedDataBuilder` inserted a signing time attribute by default. This was removed, as it is not required and might even be unwanted.
1 parent ad84120 commit 5b477c3

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

cms/src/builder.rs

+3-17
Original file line numberDiff line numberDiff line change
@@ -204,23 +204,9 @@ where
204204
},
205205
};
206206

207-
// We set the signing time attribute. In this case, signed attributes are used and
208-
// will be signed instead of the eContent itself.
209-
if let Some(signed_attributes) = &mut self.signed_attributes {
210-
if !signed_attributes.iter().any(|attr| {
211-
attr.oid.cmp(&const_oid::db::rfc5911::ID_SIGNING_TIME) == Ordering::Equal
212-
}) {
213-
// Add current time as signing time
214-
signed_attributes.push(
215-
create_signing_time_attribute()
216-
.map_err(|_| der::Error::from(ErrorKind::Failed))?,
217-
);
218-
}
219-
} else {
220-
// Add signed attributes with signing time attribute and content type attribute
221-
self.signed_attributes =
222-
Some(vec![create_signing_time_attribute()
223-
.map_err(|_| der::Error::from(ErrorKind::Failed))?]);
207+
// This implementation uses signed attributes.
208+
if self.signed_attributes.is_none() {
209+
self.signed_attributes = Some(vec![]);
224210
}
225211

226212
// Add digest attribute to (to be) signed attributes

0 commit comments

Comments
 (0)