-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ssh2 library not supporting Kex ecdh-sha2-nistp384 #332
Comments
This may have been fixed with #334. Please let me know if you need anything else beyond that. |
Thanks for the reply @yodaldevoid . Ok(["diffie-hellman-group-exchange-sha256", "diffie-hellman-group16-sha512", "diffie-hellman-group18-sha512", "diffie-hellman-group14-sha256", "diffie-hellman-group14-sha1", "diffie-hellman-group1-sha1", "diffie-hellman-group-exchange-sha1", "ext-info-c", "[email protected]"]) Also any reason why this is not released as a proper version upgrade for ssh2?. If you can mainline changes as a version release , in runtime changes will take care |
@yodaldevoid Note that the issue is specific to Windows. It appears to work without problems on Linux with version 0.9.4. Perhaps, this has something to do with the build options used on Windows for the libssh2-sys crate? |
@yodaldevoid , on Windows libssh2-sys crate is using wincng instead of openssl.
we tried downloading openssl and setting env variable but we are facing build compilation issues. I tried manually to run and install make file using nmake but still unable to build with openssl. Do we have any specific requirements and procedure to build with openssl on windows?. Any fix on either building with openssl or wincng will unblock the issue. |
Building with |
https://github.com/libssh2/libssh2/blob/a312b43325e3383c865a87bb1d26cb52e3292641/src/wincng.h /*
* Conditionally enable ECDSA support.
*
* ECDSA support requires the use of
*
* BCryptDeriveKey(..., BCRYPT_KDF_RAW_SECRET, ... )
*
* This functionality is only available as of Windows 10. To maintain
* backward compatibility, ECDSA support is therefore disabled
* by default and needs to be explicitly enabled using a build
* flag.
*/
#ifdef LIBSSH2_ECDSA_WINCNG
#define LIBSSH2_ECDSA 1
#else
#define LIBSSH2_ECDSA 0
#endif static const LIBSSH2_KEX_METHOD *libssh2_kex_methods[] = {
#if LIBSSH2_ED25519
&kex_method_ssh_curve25519_sha256,
&kex_method_ssh_curve25519_sha256_libssh,
#endif
#if LIBSSH2_ECDSA
&kex_method_ecdh_sha2_nistp256,
&kex_method_ecdh_sha2_nistp384,
&kex_method_ecdh_sha2_nistp521,
#endif
&kex_method_diffie_helman_group_exchange_sha256,
&kex_method_diffie_helman_group16_sha512,
&kex_method_diffie_helman_group18_sha512,
&kex_method_diffie_helman_group14_sha256,
&kex_method_diffie_helman_group14_sha1,
&kex_method_diffie_helman_group1_sha1,
&kex_method_diffie_helman_group_exchange_sha1,
&kex_method_extension_negotiation,
&kex_method_strict_client_extension,
NULL
}; I guess that the macro LIBSSH2_ECDSA_WINCNG was not defined when ssh2 rs was built, which resulted in kex not having a corresponding encryption method. |
With SSH2, Kex ecdh-sha2-nistp384 is not being supported.
SSH handshake failed: Error { code: Session(-5), msg: "Unable to exchange encryption keys" }
sess.method_pref(ssh2::MethodType::Kex, "ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521") -> Error: Error { code: Session(-33), msg: "The requested
method(s) are not currently supported" }
We tried enabling this key algorithm using macro to enable libssh2_ecdsa. Still its not working.
This Kex support is highly needed from SSH2 crate. If this is a bug, please provide and update with fix.
If its intentionally not supported, it would be great if you can provide the support.
The text was updated successfully, but these errors were encountered: