open-remote-ssh icon indicating copy to clipboard operation
open-remote-ssh copied to clipboard

Other .pub files effect ability to ssh using pubkey

Open guysoft opened this issue 3 years ago • 4 comments

If you have a .pub file that is in an unsupported format of ssh keys. you get the following error:

[Error  - 11:03:50.451] Error while parsing SSH public key /home/guy/.ssh/id_rsa.pub:
Error: Unsupported key format
	at Object.ee [as parseKey] (/home/guy/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.17-universal/out/extension.js:1:338800)
	at /home/guy/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.17-universal/out/extension.js:1:405943
	at Array.map (<anonymous>)
	at t.gatherIdentityFiles (/home/guy/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.17-universal/out/extension.js:1:405882)
	at async /home/guy/.vscode-oss/extensions/jeanp413.open-remote-ssh-0.0.17-universal/out/extension.js:1:374464
[Trace  - 11:03:50.455] Identity keys:
None
[Info  - 11:03:50.544] Trying no-auth authentication
[Info  - 11:03:50.552] Trying password authentication

The file is a PGP public key that starts with: -----BEGIN PGP PUBLIC KEY BLOCK-----

Using latest Open SSH.

The MS proprietary ssh extension did seem to handle this.

guysoft avatar Oct 18 '22 11:10 guysoft

Sadly the upstream library I use doesn't support this key type.

To support the not common cases like PGP keys and kerberos auth I'll need to do the same as the official extension, use the native ssh binary and parse its output, I chose to use the ssh node library as it was just easier

jeanp413 avatar Oct 21 '22 03:10 jeanp413

The issue is not adding support to the format. Its that a .pub file of an unsupported format breaks the plugin pubkey functionality to use other keys in the same folder.

Current workaround was to rename the file with something that does not end in .pub.

guysoft avatar Oct 22 '22 21:10 guysoft

:thinking: strange, if there was there was an error parsing any of the keys it should just log the error and will continue parsing the other keys

jeanp413 avatar Oct 23 '22 02:10 jeanp413

I can try and create a reproduction, but likely not today

guysoft avatar Oct 23 '22 08:10 guysoft