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

Missing add_crl on X509StoreBuilderRef #2354

Open
mmastrac opened this issue Jan 30, 2025 · 1 comment
Open

Missing add_crl on X509StoreBuilderRef #2354

mmastrac opened this issue Jan 30, 2025 · 1 comment

Comments

@mmastrac
Copy link

Example of what I'd like to do:

let crl = openssl::x509::X509Crl::from_der(crl.as_ref())?;
ssl.cert_store_mut()::add_crl(crl)?;

This is the workaround for now:

            extern "C" {
                pub fn X509_STORE_add_crl(
                    store: *mut openssl_sys::X509_STORE,
                    x: *mut openssl_sys::X509_CRL,
                ) -> openssl_sys::c_int;
            }

                let crl = openssl::x509::X509Crl::from_der(crl.as_ref())?;
                let crl_ptr = crl.as_ptr();
                let res = unsafe { X509_STORE_add_crl(ptr, crl_ptr) };
                if res != 1 {
                    return Err(std::io::Error::new(
                        std::io::ErrorKind::Other,
                        "Failed to add CRL to store",
                    )
                    .into());
                }
@mmastrac
Copy link
Author

Looks like #1927 actually contains this fix.

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

1 participant