Subject: [PATCH] git-gui: search for all current SSH key types

From: Beat Bolli <[email-masked]>
Date: Sat, 24 Feb 2018 19:39:13 +0100

OpenSSH has supported Ed25519 keys since version 6.4 (2014-01-30), and
ECDSA keys since version 5.7 (2011-01-24). git-gui fails to find these
key types in its Help/Show SSH Key dialog.

Teach git-gui to show Ed25519 and ECDSA keys as well.

This was originally reported in
https://github.com/git-for-windows/git/issues/1487 and subseqently in
https://public-inbox.org/git/[email-masked]/

Signed-off-by: Beat Bolli <[email-masked]>
---
Cc: Alexander Gavrilov <[email-masked]>
Cc: Pat Thoyts <[email-masked]>

 git-gui/lib/sshkey.tcl | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/git-gui/lib/sshkey.tcl b/git-gui/lib/sshkey.tcl
index aa6457bbb..589ff8f78 100644
--- a/git-gui/lib/sshkey.tcl
+++ b/git-gui/lib/sshkey.tcl
@@ -2,7 +2,10 @@
 # Copyright (C) 2006, 2007 Shawn Pearce
 
 proc find_ssh_key {} {
-	foreach name {~/.ssh/id_dsa.pub ~/.ssh/id_rsa.pub ~/.ssh/identity.pub} {
+	foreach name {
+		~/.ssh/id_dsa.pub ~/.ssh/id_ecdsa.pub ~/.ssh/id_ed25519.pub
+		~/.ssh/id_rsa.pub ~/.ssh/identity.pub
+	} {
 		if {[file exists $name]} {
 			set fh    [open $name r]
 			set cont  [read $fh]
-- 
2.15.0.rc1.299.gda03b47c3