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

sftp connection with default rsa-keygen generated privatekey #186

Closed
bpstrngr opened this issue Mar 25, 2023 · 8 comments
Closed

sftp connection with default rsa-keygen generated privatekey #186

bpstrngr opened this issue Mar 25, 2023 · 8 comments
Assignees
Labels
bug Something that needs to be fixed

Comments

@bpstrngr
Copy link

bpstrngr commented Mar 25, 2023

could be that i'm just missing something, but it is a valid private key file actually.

App Version:
latest

Affected Device(s):
Samsung note 10 lite with Android 13.0

Describe the bug
invalid privatekey after passphrase input

To Reproduce
Steps to reproduce the behavior:

  1. add a new sftp server and provide private key path (termux home directory wasn't accessible so i copied it to storage/emulated/0/Download/id_rsa and chmod 700-ed it)
  2. select the server in the fike explorer sidebar and privide passphrase on prompt
  3. see error message "invalid privatekey: [B@dd2exxd"

Expected behavior
successful authentication

@bpstrngr bpstrngr added the bug Something that needs to be fixed label Mar 25, 2023
@massivemadness
Copy link
Owner

I guess I'm just using outdated library that can't handle your key.
If you know how the algorithm works you can help me figure it out 😄 (1, 2, 3, 4, 5)
I can make an experimental build for you if you have time to test it

@bpstrngr
Copy link
Author

ugh, i'm not much of a cryptographer but i might try to look into it. the file was last updated in 2019 and i do see "RSA" mentioned so seems more like a bug than a missing feature due to outdatedness. thanks for the hint though, i suppose i'd need to figure out how to build it myself if i am to begin. did you think of patching/forking jsch, or intercepting it with some error handling?

@massivemadness
Copy link
Owner

There's a fork that is being updated, but I could try to fully switch to sshj 🤔
Anyway I'll text you here when the build will be ready

@massivemadness
Copy link
Owner

Hi @bpstrngr, try this build - 4588280564

@bpstrngr
Copy link
Author

bpstrngr commented Apr 3, 2023

i checked out the build, issue persists. :/

massivemadness added a commit that referenced this issue Apr 5, 2023
@massivemadness
Copy link
Owner

I just checked it, should be fixed now (4620884875)

@segln
Copy link

segln commented Apr 6, 2023

Maybe you should generate PEM format key, executing ssh-keygen with -m pem option.
But you have to remove .pem extension. See #180 (comment) .

@massivemadness
Copy link
Owner

Fixed in v2023.1.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that needs to be fixed
Projects
None yet
Development

No branches or pull requests

3 participants