changeset 299:4c3a4e88c027 ganymed

add ecdsa key support everywhere
author Carl Byington <carl@five-ten-sg.com>
date Tue, 29 Jul 2014 18:08:09 -0700
parents ab3a99f11a36
children 349847b2e318
files src/ch/ethz/ssh2/KnownHosts.java src/com/five_ten_sg/connectbot/transport/SSH.java
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/KnownHosts.java	Tue Jul 29 18:01:08 2014 -0700
+++ b/src/ch/ethz/ssh2/KnownHosts.java	Tue Jul 29 18:08:09 2014 -0700
@@ -114,7 +114,7 @@
                 publicKeys.add(new KnownHostsEntry(hostnames, dpk));
             }
         }
-        else if (serverHostKeyAlgorithm.startsWith("ecdsa-")) {
+        else if (serverHostKeyAlgorithm.startsWith("ecdsa-sha2-")) {
             ECPublicKey epk = ECDSASHA2Verify.decodeSSHECDSAPublicKey(serverHostKey);
 
             synchronized(publicKeys) {
@@ -404,9 +404,9 @@
             String[] arr = line.split(" ");
 
             if(arr.length >= 3) {
-                if((arr[1].compareTo("ssh-rsa") == 0) ||
-                   (arr[1].compareTo("ssh-dss") == 0) ||
-                   (arr[1].startsWith("ecdsa-sha2-") == 0)) {
+                if ((arr[1].compareTo("ssh-rsa") == 0) ||
+                    (arr[1].compareTo("ssh-dss") == 0) ||
+                    (arr[1].startsWith("ecdsa-sha2-"))) {
                     String[] hostnames = arr[0].split(",");
 
                     byte[] msg = Base64.decode(arr[2].toCharArray());
@@ -702,7 +702,7 @@
         }
         else if("ssh-dss".equals(keyType)) {
         }
-        else if (keyType.startsWith("ecdsa-sha2-") {
+        else if (keyType.startsWith("ecdsa-sha2-")) {
         }
         else {
             throw new IllegalArgumentException("Unknown key type " + keyType);
--- a/src/com/five_ten_sg/connectbot/transport/SSH.java	Tue Jul 29 18:01:08 2014 -0700
+++ b/src/com/five_ten_sg/connectbot/transport/SSH.java	Tue Jul 29 18:08:09 2014 -0700
@@ -147,7 +147,7 @@
                 algorithmName = "RSA";
             else if ("ssh-dss".equals(serverHostKeyAlgorithm))
                 algorithmName = "DSA";
-            else if (serverHostKeyAlgorithm.startsWith("ecdsa-"))
+            else if (serverHostKeyAlgorithm.startsWith("ecdsa-sha2-"))
                 algorithmName = "EC";
             else
                 algorithmName = serverHostKeyAlgorithm;