diff --git a/.gitmodules b/.gitmodules index a6bfd121..76593a51 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "libssh2-sys/libssh2"] path = libssh2-sys/libssh2 - url = https://github.com/Manishearth/libssh2 + url = https://github.com/libssh2/libssh2 branch = master diff --git a/libssh2-sys/build.rs b/libssh2-sys/build.rs index 9ee862fe..a96f22ae 100644 --- a/libssh2-sys/build.rs +++ b/libssh2-sys/build.rs @@ -71,14 +71,17 @@ fn main() { .file("libssh2/src/cipher-chachapoly.c") .file("libssh2/src/comp.c") .file("libssh2/src/crypt.c") - .file("libssh2/src/crypto.c") .file("libssh2/src/global.c") .file("libssh2/src/hostkey.c") .file("libssh2/src/keepalive.c") .file("libssh2/src/kex.c") .file("libssh2/src/knownhost.c") + .file("libssh2/src/libgcrypt.c") .file("libssh2/src/mac.c") + .file("libssh2/src/mbedtls.c") .file("libssh2/src/misc.c") + .file("libssh2/src/openssl.c") + .file("libssh2/src/os400qc3.c") .file("libssh2/src/packet.c") .file("libssh2/src/pem.c") .file("libssh2/src/poly1305.c") @@ -89,15 +92,15 @@ fn main() { .file("libssh2/src/transport.c") .file("libssh2/src/userauth.c") .file("libssh2/src/userauth_kbd_packet.c") + .file("libssh2/src/version.c") + .file("libssh2/src/wincng.c") .include(&include) .include("libssh2/src"); cfg.define("HAVE_LONGLONG", None); if target.contains("windows") { - cfg.include("libssh2/win32"); cfg.define("LIBSSH2_WIN32", None); - cfg.file("libssh2/src/agent_win.c"); if env::var_os("CARGO_FEATURE_OPENSSL_ON_WIN32").is_some() { cfg.define("LIBSSH2_OPENSSL", None); diff --git a/libssh2-sys/libssh2 b/libssh2-sys/libssh2 index 090f23d1..4aded1bf 160000 --- a/libssh2-sys/libssh2 +++ b/libssh2-sys/libssh2 @@ -1 +1 @@ -Subproject commit 090f23d1852a0b62e081bd12c4d05adc1c4af47a +Subproject commit 4aded1bf2de0a7ceb02cd50b0b1f7a826984783a diff --git a/src/error.rs b/src/error.rs index 901add7f..26b7e238 100644 --- a/src/error.rs +++ b/src/error.rs @@ -113,7 +113,7 @@ impl Error { /// Generate an error for unknown failure pub fn unknown() -> Error { Error::new( - ErrorCode::Session(libc::c_int::min_value()), + ErrorCode::Session(libc::c_int::MIN), "no other error listed", ) } diff --git a/tests/all/session.rs b/tests/all/session.rs index 2e2d651b..e64c9d9c 100644 --- a/tests/all/session.rs +++ b/tests/all/session.rs @@ -25,8 +25,7 @@ fn smoke() { assert_eq!(sess.timeout(), 0); sess.set_compress(true); assert!(sess.host_key().is_none()); - sess.method_pref(MethodType::Kex, "diffie-hellman-group14-sha1") - .unwrap(); + sess.method_pref(MethodType::Kex, "curve25519-sha256").unwrap(); assert!(sess.methods(MethodType::Kex).is_none()); sess.set_blocking(true); sess.set_timeout(0); @@ -55,7 +54,7 @@ fn smoke_handshake() { agent.userauth(&user, &identity).unwrap(); } assert!(sess.authenticated()); - sess.host_key_hash(HashType::Md5).unwrap(); + sess.host_key_hash(HashType::Sha256).unwrap(); } #[test]