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

x509-ocsp/remove lifetimes and implement AsExtension #1241

Conversation

bhesh
Copy link
Contributor

@bhesh bhesh commented Oct 25, 2023

This version reorganizes x509-ocsp into separate files for readability and makes use of alloc to remove lifetimes. It also implements an OCSP version of AsExtension for all possible Extensions outlined in RFC-6960 (in a similar fashion to x509-cert) to be used in a future builder. Optional rand_core feature for generating nonces.

@tarcieri tarcieri requested a review from carl-wallace October 25, 2023 16:32
@tarcieri tarcieri requested review from baloo and tarcieri October 25, 2023 17:23
@tarcieri
Copy link
Member

This looks great at first glance! Can do a more in-depth review later

x509-ocsp/src/ext.rs Outdated Show resolved Hide resolved

/// Trait to be implemented by extensions to allow them to be formated for x509 OCSP
/// requests/responses.
pub trait AsExtension: AssociatedOid + der::Encode {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a reason we can't pull x509_cert::ext::AsExtension ?

Besides the const that looks very similar.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It can be used. The extra subject/extensions arguments for judging criticality didn't seem relevant at all to OCSP though.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, that doesn't creep in the signer itself and it stays in the builder. Not a big deal.

Up to you :)

Copy link
Contributor Author

@bhesh bhesh Oct 25, 2023

Choose a reason for hiding this comment

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

If we change x509_cert::ext::AsExtension to accept subject as Option<&Name>, it'd be easier. Otherwise, I think I'd have to build an empty Name just to ignore it later.

Copy link
Member

Choose a reason for hiding this comment

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

or a Name::default() :D

x509-ocsp/src/basic.rs Outdated Show resolved Hide resolved
x509-ocsp/src/ext.rs Outdated Show resolved Hide resolved
@tarcieri tarcieri merged commit 7543df3 into RustCrypto:master Oct 30, 2023
172 checks passed
@bhesh bhesh deleted the x509-ocsp/remove-lifetimes-and-implement-AsExtension branch November 13, 2023 21:37
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.

3 participants