-
-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add functions to use key from an engine
- Loading branch information
1 parent
7742686
commit 15ef5e0
Showing
4 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
use libc::*; | ||
use *; | ||
|
||
extern "C" { | ||
pub fn ENGINE_load_builtin_engines() -> (); | ||
pub fn ENGINE_by_id(id: *const c_char) -> *mut ENGINE; | ||
|
||
pub fn ENGINE_init(e: *mut ENGINE) -> c_int; | ||
pub fn ENGINE_finish(e: *mut ENGINE) -> c_int; | ||
pub fn ENGINE_free(e: *mut ENGINE) -> c_int; | ||
|
||
pub fn ENGINE_ctrl_cmd(e: *mut ENGINE, cmd_name: *const c_char, i: c_long, p: *mut c_void, f: extern fn() -> (), cmd_optional: c_int) -> c_int; | ||
pub fn ENGINE_ctrl_cmd_string(e: *mut ENGINE, cmd_name: *const c_char, arg: *const c_char, cmd_optional: c_int) -> c_int; | ||
|
||
pub fn ENGINE_load_private_key(e: *mut ENGINE, key_id: *const c_char, ui_method: *mut UI_METHOD, callback_data: *mut c_void) -> *mut EVP_PKEY; | ||
pub fn ENGINE_load_public_key(e: *mut ENGINE, key_id: *const c_char, ui_method: *mut UI_METHOD, callback_data: *mut c_void) -> *mut EVP_PKEY; | ||
pub fn ENGINE_load_ssl_client_cert( | ||
e: *mut ENGINE, ssl: *mut SSL, ca_dn: *mut stack_st_X509_NAME, pcert: *mut *mut X509, ppkey: *mut *mut EVP_PKEY, | ||
pother: *mut *mut c_void, ui_method: *mut UI_METHOD, callback_data: *mut c_void | ||
) -> c_int; | ||
} | ||
|
||
#[repr(C)] | ||
pub struct UI_METHOD { | ||
name: *const c_char, | ||
ui_open_session: extern fn(ui: *mut UI) -> c_int, | ||
ui_write_string: extern fn(ui: *mut UI, uis: *mut UI_STRING) -> c_int, | ||
ui_flush: extern fn(ui: *mut UI) -> c_int, | ||
ui_read_string: extern fn(ui: *mut UI, uis: *mut UI_STRING) -> c_int, | ||
ui_close_session: extern fn(ui: *mut UI) -> c_int, | ||
ui_construct_prompt: extern fn(ui: *mut UI, object_desc: *const c_char, object_name: *const c_char) -> *mut c_char, | ||
} | ||
|
||
const UI_FLAG_REDOABLE: c_int = 0x0001; | ||
const UI_FLAG_PRINT_ERRORS: c_int = 0x0100; | ||
|
||
#[repr(C)] | ||
pub struct UI { | ||
meth: *const UI_METHOD, | ||
strings: *mut c_void, | ||
user_data: *mut c_void, | ||
ex_data: CRYPTO_EX_DATA, | ||
flags: c_int, | ||
} | ||
|
||
#[repr(C)] | ||
pub struct UI_STRING { | ||
string_type: UI_string_types, | ||
out_string: *const c_char, | ||
input_flags: c_int, | ||
result_buf: *mut c_char, | ||
} | ||
|
||
#[repr(C)] | ||
pub enum UI_string_types { | ||
UIT_NONE=0, | ||
UIT_PROMPT, | ||
UIT_VERIFY, | ||
UIT_BOOLEAN, | ||
UIT_INFO, | ||
UIT_ERROR, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters