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

ssh connect will fail with exception if user has ed25519 identities in ssh_config #4006

Open
mcr-ksh opened this issue Feb 17, 2022 · 3 comments
Assignees
Labels
Feature: Debugger Status: Internal This is being tracked internally by the Ghidra team

Comments

@mcr-ksh
Copy link

mcr-ksh commented Feb 17, 2022

Describe the bug
cant connect to remote host when having ed25519 keys due to bug in jsch.

To Reproduce

  1. add a ssh ed25519 key and "IdentityFile ~/.ssh/id_ed25519" to your ssh config.
  2. open debugger and "GNU gdb via ssh"
  3. ssh connection will fail will the following exception:

Caused by: com.jcraft.jsch.JSchException: invalid privatekey: [B@e4487af
at com.jcraft.jsch.KeyPair.load(KeyPair.java:664)
at com.jcraft.jsch.KeyPair.load(KeyPair.java:561)
at com.jcraft.jsch.IdentityFile.newInstance(IdentityFile.java:40)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:407)
at com.jcraft.jsch.JSch.addIdentity(JSch.java:367)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getJSch(JschConfigSessionFactory.java:276)
at org.eclipse.jgit.transport.JschConfigSessionFactory.createSession(JschConfigSessionFactory.java:220)
at org.eclipse.jgit.transport.JschConfigSessionFactory.createSession(JschConfigSessionFactory.java:176)
at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:110)

Expected behavior
can connect to remote host.

Workaround
use /etc/ssh/ssh_config and/or remove ed25519 keys.

Screenshots
see attachment.
Screenshot 2022-02-17 at 10 40 03

Attachments
https://stackoverflow.com/questions/53134212/invalid-privatekey-when-using-jsch

Environment (please complete the following information):

  • OS: macOS 12.2.1
    Build Date: 2022-Jan-25 1526 EST
    Ghidra Version: 10.1.2
    Java Home: /Library/Java/JavaVirtualMachines/openjdk17-temurin/Contents/Home
    JVM Version: Eclipse Adoptium 17.0.1
    OS: Mac OS X 11.2 x86_64
@d-millar
Copy link
Collaborator

Apologies for the slow response - is there a version of JSch that supports ed25519? I was under the impression that wasn't supported yet.

@5c4lar
Copy link

5c4lar commented Jun 9, 2022

Apologies for the slow response - is there a version of JSch that supports ed25519? I was under the impression that wasn't supported yet.

One is mentioned here gradle/gradle#19028

@d-millar
Copy link
Collaborator

This looks promising - we’re considering it.

@ryanmkurtz ryanmkurtz added the Status: Triage Information is being gathered label Jun 16, 2022
@nsadeveloper789 nsadeveloper789 added Status: Internal This is being tracked internally by the Ghidra team and removed Status: Triage Information is being gathered labels Jul 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature: Debugger Status: Internal This is being tracked internally by the Ghidra team
Projects
None yet
Development

No branches or pull requests

5 participants