diff options
| author | Steven Fackler <[email protected]> | 2017-03-25 15:45:40 +0000 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2017-03-25 19:30:01 -0700 |
| commit | c8d1698f275d2901a7fd65f318155acbd2dd02d3 (patch) | |
| tree | b0366bd4db7059a7066cef2014152d1eb54b3666 /openssl-sys/src/ossl10x.rs | |
| parent | Merge pull request #601 from pgerber/double_unlock (diff) | |
| download | rust-openssl-c8d1698f275d2901a7fd65f318155acbd2dd02d3.tar.xz rust-openssl-c8d1698f275d2901a7fd65f318155acbd2dd02d3.zip | |
Logic to support client-side session reuse
Diffstat (limited to 'openssl-sys/src/ossl10x.rs')
| -rw-r--r-- | openssl-sys/src/ossl10x.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/openssl-sys/src/ossl10x.rs b/openssl-sys/src/ossl10x.rs index fade0f99..23c0ee72 100644 --- a/openssl-sys/src/ossl10x.rs +++ b/openssl-sys/src/ossl10x.rs @@ -1,6 +1,7 @@ use std::sync::{Mutex, MutexGuard}; use std::sync::{Once, ONCE_INIT}; use std::mem; +use std::ptr; use libc::{c_int, c_char, c_void, c_long, c_uchar, size_t, c_uint, c_ulong}; #[cfg(not(ossl101))] @@ -610,7 +611,7 @@ pub struct SSL_SESSION { sess_cert: *mut c_void, peer: *mut X509, verify_result: c_long, - references: c_int, + pub references: c_int, timeout: c_long, time: c_long, compress_meth: c_uint, @@ -678,6 +679,7 @@ pub struct X509_VERIFY_PARAM { pub enum X509_VERIFY_PARAM_ID {} pub enum PKCS12 {} +pub const SSL_CTRL_GET_SESSION_REUSED: c_int = 8; pub const SSL_CTRL_OPTIONS: c_int = 32; pub const SSL_CTRL_CLEAR_OPTIONS: c_int = 77; #[cfg(ossl102)] @@ -708,6 +710,7 @@ pub const SSLEAY_DIR : c_int = 5; pub const CRYPTO_LOCK_X509: c_int = 3; pub const CRYPTO_LOCK_SSL_CTX: c_int = 12; +pub const CRYPTO_LOCK_SSL_SESSION: c_int = 14; static mut MUTEXES: *mut Vec<Mutex<()>> = 0 as *mut Vec<Mutex<()>>; static mut GUARDS: *mut Vec<Option<MutexGuard<'static, ()>>> = 0 as *mut Vec<Option<MutexGuard<'static, ()>>>; @@ -766,12 +769,16 @@ fn set_id_callback() {} #[cfg(ossl102)] pub unsafe fn SSL_CTX_set_ecdh_auto(ctx: *mut SSL_CTX, onoff: c_int) -> c_int { - ::SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff as c_long, ::std::ptr::null_mut()) as c_int + ::SSL_CTX_ctrl(ctx, SSL_CTRL_SET_ECDH_AUTO, onoff as c_long, ptr::null_mut()) as c_int } #[cfg(ossl102)] pub unsafe fn SSL_set_ecdh_auto(ssl: *mut ::SSL, onoff: c_int) -> c_int { - ::SSL_ctrl(ssl, SSL_CTRL_SET_ECDH_AUTO, onoff as c_long, ::std::ptr::null_mut()) as c_int + ::SSL_ctrl(ssl, SSL_CTRL_SET_ECDH_AUTO, onoff as c_long, ptr::null_mut()) as c_int +} + +pub unsafe fn SSL_session_reused(ssl: *mut ::SSL) -> c_int { + ::SSL_ctrl(ssl, SSL_CTRL_GET_SESSION_REUSED, 0, ptr::null_mut()) as c_int } extern { |