diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index 9638e6a36d2a989f1d10c4ff2f3e1978513e25e0..1e7c4448c6f00180cc6f9722978dfa49c09fed96 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -86,6 +86,13 @@ impl X509StoreContextRef { } } + #[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] + pub fn verify_cert(self) -> Result, ErrorStack> { + unsafe { + cvt(ffi::X509_verify_cert(self.as_ptr())).map(|_| ()) + } + } + /// Returns the error code of the context. /// /// This corresponds to [`X509_STORE_CTX_get_error`]. diff --git a/openssl/src/x509/tests.rs b/openssl/src/x509/tests.rs index a94c40bdc09d9cfff127415bab558ed78e0ed7b1..2b9d5dd363d8594b5145001c1e5deda3d2f30f93 100644 --- a/openssl/src/x509/tests.rs +++ b/openssl/src/x509/tests.rs @@ -285,6 +285,7 @@ fn signature() { assert_eq!(algorithm.object().to_string(), "sha256WithRSAEncryption"); } +#[cfg(any(all(feature = "v102", ossl102), all(feature = "v110", ossl110)))] #[test] fn clone_x509() { let cert = include_bytes!("../../test/cert.pem");