Skip to content

Commit

Permalink
Viewer: Treat ~/.ssh/id_ed25519 as a dflt priv key
Browse files Browse the repository at this point in the history
... if the file exists and the SSHKey and SSHKeyFile parameters are not
specified.

Also move ~/.ssh/id_dsa to the bottom of the priority list, since it
implements a deprecated algorithm.

This emulates the behavior of OpenSSH.
  • Loading branch information
dcommander committed Oct 11, 2024
1 parent 75eb1d3 commit 656596d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
7 changes: 4 additions & 3 deletions java/com/turbovnc/rfb/Params.java
Original file line number Diff line number Diff line change
Expand Up @@ -1128,9 +1128,10 @@ public void save(String node) {
"IdentityFile OpenSSH configuration keyword, if a valid passphrase is not " +
"supplied for the key\r " +
"5. " + Utils.getHomeDir() + ".ssh/id_rsa, " + Utils.getHomeDir() +
".ssh/id_dsa, and " + Utils.getHomeDir() + ".ssh/id_ecdsa (in that " +
"order), if this parameter, the SSHKey parameter, and the IdentityFile " +
"OpenSSH configuration keyword are not specified", null);
".ssh/id_ecdsa, " + Utils.getHomeDir() + ".ssh/id_ed25519, and " +
Utils.getHomeDir() + ".ssh/id_dsa (in that order), if this parameter, the " +
"SSHKey parameter, and the IdentityFile OpenSSH configuration keyword are " +
"not specified", null);

public StringParameter sshKeyPass =
new StringParameter("SSHKeyPass", this, false, false,
Expand Down
3 changes: 2 additions & 1 deletion java/com/turbovnc/vncviewer/Tunnel.java
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,9 @@ protected static void createTunnelJSch(String host, Params params)

if (useDefaultPrivateKeyFiles) {
privateKeys.add(new File(homeDir + "/.ssh/id_rsa"));
privateKeys.add(new File(homeDir + "/.ssh/id_dsa"));
privateKeys.add(new File(homeDir + "/.ssh/id_ecdsa"));
privateKeys.add(new File(homeDir + "/.ssh/id_ed25519"));
privateKeys.add(new File(homeDir + "/.ssh/id_dsa"));
}

for (Iterator<File> i = privateKeys.iterator(); i.hasNext();) {
Expand Down

0 comments on commit 656596d

Please sign in to comment.