aboutsummaryrefslogtreecommitdiff
path: root/openssl/src
diff options
context:
space:
mode:
authorBenjamin Fry <[email protected]>2017-03-19 00:55:42 -0700
committerBastian Köcher <[email protected]>2018-03-07 13:48:09 +0100
commit847fac25f8c85a6cb0327f361cb310a93e2bada7 (patch)
tree1affd6ee70e1e51c5edfd2aec1881a9e21c6c088 /openssl/src
parentFix memory mgmt (diff)
downloadrust-openssl-847fac25f8c85a6cb0327f361cb310a93e2bada7.tar.xz
rust-openssl-847fac25f8c85a6cb0327f361cb310a93e2bada7.zip
properly version library functions
Diffstat (limited to 'openssl/src')
-rw-r--r--openssl/src/x509/mod.rs7
-rw-r--r--openssl/src/x509/tests.rs1
2 files changed, 8 insertions, 0 deletions
diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs
index 9638e6a3..1e7c4448 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<Option<X509VerifyError>, 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 a94c40bd..2b9d5dd3 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");