Load crypto error strings

This commit is contained in:
Jared Roesch 2014-10-05 02:50:33 -07:00
parent 5713c42df7
commit a8cadc46ac
2 changed files with 4 additions and 2 deletions

View File

@ -276,6 +276,8 @@ extern "C" {
pub fn ERR_func_error_string(err: c_ulong) -> *const c_char; pub fn ERR_func_error_string(err: c_ulong) -> *const c_char;
pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char; pub fn ERR_reason_error_string(err: c_ulong) -> *const c_char;
pub fn ERR_load_crypto_strings();
pub fn EVP_md5() -> *const EVP_MD; pub fn EVP_md5() -> *const EVP_MD;
pub fn EVP_ripemd160() -> *const EVP_MD; pub fn EVP_ripemd160() -> *const EVP_MD;
pub fn EVP_sha1() -> *const EVP_MD; pub fn EVP_sha1() -> *const EVP_MD;
@ -427,4 +429,3 @@ extern "C" {
pub fn i2d_RSAPrivateKey(k: *mut RSA, buf: *const *mut u8) -> c_int; pub fn i2d_RSAPrivateKey(k: *mut RSA, buf: *const *mut u8) -> c_int;
pub fn d2i_RSAPrivateKey(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA; pub fn d2i_RSAPrivateKey(k: *const *mut RSA, buf: *const *const u8, len: c_uint) -> *mut RSA;
} }

View File

@ -24,7 +24,8 @@ fn init() {
unsafe { unsafe {
INIT.doit(|| { INIT.doit(|| {
ffi::SSL_library_init(); ffi::SSL_library_init();
ffi::SSL_load_error_strings(); // maybe add err_load_crypto_strings? ffi::SSL_load_error_strings();
ffi::ERR_load_crypto_strings();
let verify_idx = ffi::SSL_CTX_get_ex_new_index(0, ptr::null(), None, let verify_idx = ffi::SSL_CTX_get_ex_new_index(0, ptr::null(), None,
None, None); None, None);
assert!(verify_idx >= 0); assert!(verify_idx >= 0);