diff options
| author | Steven Fackler <[email protected]> | 2014-12-23 08:56:20 -0800 |
|---|---|---|
| committer | Steven Fackler <[email protected]> | 2014-12-23 08:56:20 -0800 |
| commit | b136cf6c9068ad2993b6a84f27396012a9c5405e (patch) | |
| tree | c7bf75b5287c6bcec27ab9caec3395f522e90f88 /src/ssl/mod.rs | |
| parent | Release v0.2.7 (diff) | |
| parent | Update to rust master (diff) | |
| download | rust-openssl-b136cf6c9068ad2993b6a84f27396012a9c5405e.tar.xz rust-openssl-b136cf6c9068ad2993b6a84f27396012a9c5405e.zip | |
Merge pull request #130 from alexcrichton/update
Update to rust master
Diffstat (limited to 'src/ssl/mod.rs')
| -rw-r--r-- | src/ssl/mod.rs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ssl/mod.rs b/src/ssl/mod.rs index b0db32ea..43673596 100644 --- a/src/ssl/mod.rs +++ b/src/ssl/mod.rs @@ -93,8 +93,9 @@ fn get_verify_data_idx<T>() -> c_int { unsafe { INIT.doit(|| { + let f: ffi::CRYPTO_EX_free = free_data_box::<T>; let idx = ffi::SSL_CTX_get_ex_new_index(0, ptr::null(), None, - None, Some(free_data_box::<T>)); + None, Some(f)); assert!(idx >= 0); VERIFY_DATA_IDX = idx; }); @@ -199,7 +200,9 @@ impl SslContext { unsafe { ffi::SSL_CTX_set_ex_data(self.ctx, VERIFY_IDX, mem::transmute(verify)); - ffi::SSL_CTX_set_verify(self.ctx, mode as c_int, Some(raw_verify)); + let f: extern fn(c_int, *mut ffi::X509_STORE_CTX) -> c_int = + raw_verify; + ffi::SSL_CTX_set_verify(self.ctx, mode as c_int, Some(f)); } } @@ -216,7 +219,9 @@ impl SslContext { mem::transmute(Some(verify))); ffi::SSL_CTX_set_ex_data(self.ctx, get_verify_data_idx::<T>(), mem::transmute(data)); - ffi::SSL_CTX_set_verify(self.ctx, mode as c_int, Some(raw_verify_with_data::<T>)); + let f: extern fn(c_int, *mut ffi::X509_STORE_CTX) -> c_int = + raw_verify_with_data::<T>; + ffi::SSL_CTX_set_verify(self.ctx, mode as c_int, Some(f)); } } |