diff options
| author | Steven Fackler <[email protected]> | 2016-08-02 22:14:44 -0700 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2016-08-02 22:14:44 -0700 |
| commit | abacc8bb18c73ef6fbec5dabe8398ca9735d86e0 (patch) | |
| tree | e75768a313ff7ca0703e841f062ea7c852a62568 | |
| parent | Merge remote-tracking branch 'origin/breaks' (diff) | |
| download | rust-openssl-abacc8bb18c73ef6fbec5dabe8398ca9735d86e0.tar.xz rust-openssl-abacc8bb18c73ef6fbec5dabe8398ca9735d86e0.zip | |
Define SSL_CTX_set_mode in openssl-sys
| -rw-r--r-- | openssl-sys/src/lib.rs | 7 | ||||
| -rw-r--r-- | openssl/src/ssl/mod.rs | 2 |
2 files changed, 8 insertions, 1 deletions
diff --git a/openssl-sys/src/lib.rs b/openssl-sys/src/lib.rs index 2deef976..ba51b597 100644 --- a/openssl-sys/src/lib.rs +++ b/openssl-sys/src/lib.rs @@ -9,6 +9,7 @@ extern crate libressl_pnacl_sys; use libc::{c_void, c_int, c_char, c_ulong, c_long, c_uint, c_uchar, size_t}; use std::mem; +use std::ptr; use std::sync::{Mutex, MutexGuard}; use std::sync::{Once, ONCE_INIT}; @@ -287,6 +288,7 @@ pub const NID_key_usage: c_int = 83; pub const PKCS5_SALT_LEN: c_int = 8; pub const SSL_CTRL_OPTIONS: c_int = 32; +pub const SSL_CTRL_MODE: c_int = 33; pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77; pub const SSL_CTRL_SET_TLSEXT_SERVERNAME_CB: c_int = 53; @@ -459,6 +461,10 @@ pub unsafe fn BIO_get_mem_data(b: *mut BIO, pp: *mut *mut c_char) -> c_long { BIO_ctrl(b, BIO_CTRL_INFO, 0, pp as *mut c_void) } +pub unsafe fn SSL_CTX_set_mode(ctx: *mut SSL_CTX, op: c_long) -> c_long { + SSL_CTX_ctrl(ctx, SSL_CTRL_MODE, op, ptr::null_mut()) +} + // True functions extern "C" { pub fn ASN1_INTEGER_set(dest: *mut ASN1_INTEGER, value: c_long) -> c_int; @@ -787,6 +793,7 @@ extern "C" { pub fn SSL_CTX_new(method: *const SSL_METHOD) -> *mut SSL_CTX; pub fn SSL_CTX_free(ctx: *mut SSL_CTX); + pub fn SSL_CTX_ctrl(ctx: *mut SSL_CTX, cmd: c_int, larg: c_long, parg: *mut c_void) -> c_long; pub fn SSL_CTX_set_verify(ctx: *mut SSL_CTX, mode: c_int, verify_callback: Option<extern fn(c_int, *mut X509_STORE_CTX) -> c_int>); pub fn SSL_CTX_set_verify_depth(ctx: *mut SSL_CTX, depth: c_int); diff --git a/openssl/src/ssl/mod.rs b/openssl/src/ssl/mod.rs index 3d1ec6e5..2db2f0f9 100644 --- a/openssl/src/ssl/mod.rs +++ b/openssl/src/ssl/mod.rs @@ -531,7 +531,7 @@ impl SslContext { } fn set_mode(&mut self, mode: c_long) -> Result<(), ErrorStack> { - wrap_ssl_result(unsafe { ffi_extras::SSL_CTX_set_mode(self.ctx, mode) as c_int }) + wrap_ssl_result(unsafe { ffi::SSL_CTX_set_mode(self.ctx, mode) as c_int }) } pub fn set_tmp_dh(&mut self, dh: DH) -> Result<(), ErrorStack> { |