diff src/ch/ethz/ssh2/KnownHosts.java @ 287:db9b028016de ganymed

start conversion from trilead to ganymed
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jul 2014 19:52:08 -0700
parents 4656869af8fe
children ab3a99f11a36
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/KnownHosts.java	Fri Jul 18 19:26:29 2014 -0700
+++ b/src/ch/ethz/ssh2/KnownHosts.java	Fri Jul 18 19:52:08 2014 -0700
@@ -564,7 +564,7 @@
      * @throws IOException if the supplied key blob cannot be parsed or does not match the given hostkey type.
      */
     public int verifyHostkey(String hostname, String serverHostKeyAlgorithm, byte[] serverHostKey) throws IOException {
-        Object remoteKey;
+        PublicKey remoteKey;
 
         if("ssh-rsa".equals(serverHostKeyAlgorithm)) {
             remoteKey = RSASHA1Verify.decodeSSHRSAPublicKey(serverHostKey);
@@ -572,6 +572,9 @@
         else if("ssh-dss".equals(serverHostKeyAlgorithm)) {
             remoteKey = DSASHA1Verify.decodeSSHDSAPublicKey(serverHostKey);
         }
+        else if (serverHostKeyAlgorithm.startsWith("ecdsa-sha2-")) {
+            remoteKey = ECDSASHA2Verify.decodeSSHECDSAPublicKey(serverHostKey);
+        }
         else {
             throw new IllegalArgumentException("Unknown hostkey type " + serverHostKeyAlgorithm);
         }