From 2adf2cf12bf1afb806ec8bfb222d32831137d749 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Mon, 25 Dec 2017 22:02:41 -0700 Subject: Remove deprecated APIs --- openssl/src/util.rs | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'openssl/src/util.rs') diff --git a/openssl/src/util.rs b/openssl/src/util.rs index e4010587..8c8d41a9 100644 --- a/openssl/src/util.rs +++ b/openssl/src/util.rs @@ -1,4 +1,4 @@ -use libc::{c_int, c_char, c_void}; +use libc::{c_char, c_int, c_void}; use std::any::Any; use std::panic::{self, AssertUnwindSafe}; use std::slice; @@ -34,31 +34,6 @@ impl Drop for CallbackState { } } -pub unsafe extern "C" fn invoke_passwd_cb_old( - buf: *mut c_char, - size: c_int, - _rwflag: c_int, - cb_state: *mut c_void, -) -> c_int -where - F: FnOnce(&mut [c_char]) -> usize, -{ - let callback = &mut *(cb_state as *mut CallbackState); - - let result = panic::catch_unwind(AssertUnwindSafe(|| { - let pass_slice = slice::from_raw_parts_mut(buf, size as usize); - callback.cb.take().unwrap()(pass_slice) - })); - - match result { - Ok(len) => len as c_int, - Err(err) => { - callback.panic = Some(err); - 0 - } - } -} - /// Password callback function, passed to private key loading functions. /// /// `cb_state` is expected to be a pointer to a `CallbackState`. -- cgit v1.2.3