Skip to content
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

How to use the features of the old version in the new version? #339

Open
yylime opened this issue Dec 14, 2024 · 1 comment
Open

How to use the features of the old version in the new version? #339

yylime opened this issue Dec 14, 2024 · 1 comment
Labels

Comments

@yylime
Copy link

yylime commented Dec 14, 2024

When I used ssh2 = "0.9.4" to connect to my switch, which only supports the diffie-hellman-group1-sha1 key exchange algorithm and ssh-rsa cipher, I encountered an error.

Finisheddevprofile [unoptimized + debuginfo] target(s) in 0.06s Runningtarget/debug/switch_sshthread 'main' panicked at src/main.rs:13:22: calledResult::unwrap()on anErrvalue: Error { code: Session(-41), msg: "out of bounds" } stack backtrace: 0: rust_begin_unwind at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/std/src/panicking.rs:665:5 1: core::panicking::panic_fmt at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/panicking.rs:74:14 2: core::result::unwrap_failed at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/result.rs:1700:5 3: core::result::Result<T,E>::unwrap at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/result.rs:1104:23 4: switch_ssh::main at ./src/main.rs:13:5 5: core::ops::function::FnOnce::call_once at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf/library/core/src/ops/function.rs:250:5 note: Some details are omitted, run withRUST_BACKTRACE=full for a verbose backtrace.

However, when I changed the ssh2 version to 0.8, it worked for this switch, but I then faced the following error when connecting to a newer switch:SSH handshake failed: Error { code: Session(-5), msg: "Unable to exchange encryption keys" }
What should I do to resolve this issue?

@yodaldevoid
Copy link
Collaborator

I believe your issue is with the underlying libssh2. You can choose to use a version of libssh2 that is not the vendored version, but we can't guarantee it will work. You may want to look into the (relatively) recent changes around ssh-rsa support in libssh2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants