Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cms: Don't insert signing time attribute by default. #1148

Merged
merged 1 commit into from
Jul 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions cms/src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,23 +204,9 @@ where
},
};

// We set the signing time attribute. In this case, signed attributes are used and
// will be signed instead of the eContent itself.
if let Some(signed_attributes) = &mut self.signed_attributes {
if !signed_attributes.iter().any(|attr| {
attr.oid.cmp(&const_oid::db::rfc5911::ID_SIGNING_TIME) == Ordering::Equal
}) {
// Add current time as signing time
signed_attributes.push(
create_signing_time_attribute()
.map_err(|_| der::Error::from(ErrorKind::Failed))?,
);
}
} else {
// Add signed attributes with signing time attribute and content type attribute
self.signed_attributes =
Some(vec![create_signing_time_attribute()
.map_err(|_| der::Error::from(ErrorKind::Failed))?]);
// This implementation uses signed attributes.
if self.signed_attributes.is_none() {
self.signed_attributes = Some(vec![]);
}

// Add digest attribute to (to be) signed attributes
Expand Down