diff options
| author | Steven Fackler <[email protected]> | 2016-04-30 09:27:50 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-04-30 09:27:50 -0700 |
| commit | 7b73003b6753020f9c5184145536f541c9d8d5ea (patch) | |
| tree | 4b36b0866384c2c49f0541fc3a0f3ce395a099f5 | |
| parent | Add Ssl::set_verify (diff) | |
| download | rust-openssl-7b73003b6753020f9c5184145536f541c9d8d5ea.tar.xz rust-openssl-7b73003b6753020f9c5184145536f541c9d8d5ea.zip | |
Add X509StoreContext::error_depth
| -rw-r--r-- | openssl-sys/src/lib.rs | 1 | ||||
| -rw-r--r-- | openssl/src/x509/mod.rs | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 070ed6c6..3d7c59c3 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -823,6 +823,7 @@ extern "C" { pub fn X509_STORE_CTX_get_current_cert(ct: *mut X509_STORE_CTX) -> *mut X509; pub fn X509_STORE_CTX_get_error(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509_STORE_CTX_get_ex_data(ctx: *mut X509_STORE_CTX, idx: c_int) -> *mut c_void; + pub fn X509_STORE_CTX_get_error_depth(ctx: *mut X509_STORE_CTX) -> c_int; pub fn X509V3_EXT_conf_nid(conf: *mut c_void, ctx: *mut X509V3_CTX, ext_nid: c_int, value: *mut c_char) -> *mut X509_EXTENSION; pub fn X509V3_EXT_conf(conf: *mut c_void, ctx: *mut X509V3_CTX, name: *mut c_char, value: *mut c_char) -> *mut X509_EXTENSION; diff --git a/openssl/src/x509/mod.rs b/openssl/src/x509/mod.rs index cdd729aa..af1e6ed1 100644 --- a/openssl/src/x509/mod.rs +++ b/openssl/src/x509/mod.rs @@ -104,6 +104,10 @@ impl X509StoreContext { }) } } + + pub fn error_depth(&self) -> u32 { + unsafe { ffi::X509_STORE_CTX_get_error_depth(self.ctx) as u32 } + } } #[allow(non_snake_case)] |