massivemadness / Squircle-CE

👨‍💻 Squircle CE is a fast and free multi-language code editor for Android
https://play.google.com/store/apps/details?id=com.blacksquircle.ui
Apache License 2.0
1.38k stars 101 forks source link

sftp connection with default rsa-keygen generated privatekey #186

Closed bpstrngr closed 1 year ago

bpstrngr commented 1 year ago

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

massivemadness commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

Hi @bpstrngr, try this build - 4588280564

bpstrngr commented 1 year ago

i checked out the build, issue persists. :/

massivemadness commented 1 year ago

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

segln commented 1 year ago

Maybe you should generate PEM format key, executing ssh-keygen with -m pem option. But you have to remove .pem extension. See https://github.com/massivemadness/Squircle-CE/issues/180#issuecomment-1479268466 .

massivemadness commented 1 year ago

Fixed in v2023.1.4