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

refactor: Generalize csr/crl signed_by to take &impl AsRef issuer #312

Merged
merged 1 commit into from
Jan 19, 2025

Conversation

audunhalland
Copy link
Contributor

@audunhalland audunhalland commented Jan 19, 2025

Completes #307 by applying the same treatment to csr and crl.

Also improves CertificateParams::signed_by issuer from AsRef<Self> to AsRef<CertificateParams>, because I think it's irrelevant that the issuer is the same type as the CertificateParams being signed, thus Self should not be used.

This makes these consistent with Certificate::signed_by.
Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

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

Makes sense, thanks!

@@ -157,7 +157,7 @@ impl CertificateParams {
pub fn signed_by(
self,
public_key: &impl PublicKeyData,
issuer: &impl AsRef<Self>,
issuer: &impl AsRef<CertificateParams>,
Copy link
Member

Choose a reason for hiding this comment

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

Nit: let's stick to Self here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I tried to make an explanation of this change in the PR summary.

Copy link
Member

Choose a reason for hiding this comment

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

The argument you made seems reasonable to me in absence of a reason to prefer keeping it as-is.

Copy link
Member

@cpu cpu left a comment

Choose a reason for hiding this comment

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

Looks good, thank you :-)

@djc djc added this pull request to the merge queue Jan 19, 2025
Merged via the queue into rustls:main with commit 5a0e2bf Jan 19, 2025
15 checks passed
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.

4 participants