diff options
-rw-r--r-- | Cargo.toml | 8 | ||||
-rw-r--r-- | src/lib.rs | 12 |
2 files changed, 15 insertions, 5 deletions
@@ -1,6 +1,6 @@ [package] name = "ssh2" -version = "0.2.12" +version = "0.2.13" authors = ["Alex Crichton <alex@alexcrichton.com>"] license = "MIT/Apache-2.0" keywords = ["ssh"] @@ -19,10 +19,10 @@ name = "all" [dependencies] bitflags = "0.1" libc = "0.2" +libssh2-sys = { path = "libssh2-sys", version = "0.1.38" } -[dependencies.libssh2-sys] -path = "libssh2-sys" -version = "0.1.0" +[target."cfg(unix)".dependencies] +openssl-sys = "0.7" [dev-dependencies] tempdir = "0.3" @@ -166,10 +166,20 @@ mod util; pub fn init() { static INIT: Once = ONCE_INIT; INIT.call_once(|| unsafe { - assert_eq!(raw::libssh2_init(0), 0); + platform_init(); + assert_eq!(raw::libssh2_init(raw::LIBSSH2_INIT_NO_CRYPTO), 0); assert_eq!(libc::atexit(shutdown), 0); }); extern fn shutdown() { unsafe { raw::libssh2_exit(); } } + + #[cfg(unix)] + fn platform_init() { + extern crate openssl_sys; + openssl_sys::init(); + } + + #[cfg(windows)] + fn platform_init() {} } unsafe fn opt_bytes<'a, T>(_: &'a T, |