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

Certificate::generate_self_signed has incorrect error value for extensions closure #580

Open
str4d opened this issue Sep 1, 2024 · 2 comments

Comments

@str4d
Copy link
Contributor

str4d commented Sep 1, 2024

extensions: F,
) -> Result<Self>
where
F: FnOnce(&mut CertificateBuilder<'_, yubikey_signer::Signer<'_, KT>>) -> der::Result<()>,

This closure only allows returning errors of type der::Error. However, the closure's sole argument is an x509_cert::builder::CertificateBuilder, the methods for which (in particular CertificateBuilder::add_extension) all return x509_cert::builder::Error. The latter contains der::Error as a sub-error, but we can't represent all of the builder's errors in that.

The extensions closure in Certificate::generate_self_signed should be changed to return Result<_, x509_cert::builder::Error> instead of der::Result.

@tony-iqlusion
Copy link
Member

cc @baloo

@baloo
Copy link
Contributor

baloo commented Sep 6, 2024

yeah, the cert builder needs an overhaul.

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

No branches or pull requests

3 participants