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

feat(s2n-quic-rustls): parse multiple der certs #2177

Merged
merged 7 commits into from
Apr 8, 2024

Conversation

WesleyRosenblum
Copy link
Contributor

@WesleyRosenblum WesleyRosenblum commented Apr 6, 2024

Description of changes:

This adds support in rustls for parsing multiple der formatted certificates

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@@ -1,6 +1,6 @@
[package]
name = "s2n-codec"
version = "0.35.1"
version = "0.36.0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to have a specific commit to bump, just so we can point the tag at that commit

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines 86 to 92
let certs = self
.iter()
.map(|cert| der::into_certificate(cert.to_vec()))
.collect::<Result<Vec<_>, _>>()?
.into_iter()
.flatten()
.collect();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if this code would be clearer with a more imperative approach?

Suggested change
let certs = self
.iter()
.map(|cert| der::into_certificate(cert.to_vec()))
.collect::<Result<Vec<_>, _>>()?
.into_iter()
.flatten()
.collect();
let mut certs = vec![];
for der in self {
let der = der.into_certificate()?;
certs.extend(der.0);
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, much clearer!

@WesleyRosenblum WesleyRosenblum enabled auto-merge (squash) April 8, 2024 17:21
@WesleyRosenblum WesleyRosenblum merged commit 1c0bfa5 into main Apr 8, 2024
126 checks passed
@WesleyRosenblum WesleyRosenblum deleted the WesleyRosenblum/intocert branch April 8, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants