diff src/ch/ethz/ssh2/KnownHosts.java @ 284:4ec87de11e71 ganymed

start conversion from trilead to ganymed
author Carl Byington <carl@five-ten-sg.com>
date Fri, 18 Jul 2014 18:08:56 -0700
parents d7e088fa2123
children 486df527ddc5
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/KnownHosts.java	Fri Jul 18 17:32:11 2014 -0700
+++ b/src/ch/ethz/ssh2/KnownHosts.java	Fri Jul 18 18:08:56 2014 -0700
@@ -430,46 +430,8 @@
         initialize(cw.toCharArray());
     }
 
-    private boolean matchKeys(Object key1, Object key2) {
-        if((key1 instanceof RSAPublicKey) && (key2 instanceof RSAPublicKey)) {
-            RSAPublicKey savedRSAKey = (RSAPublicKey) key1;
-            RSAPublicKey remoteRSAKey = (RSAPublicKey) key2;
-
-            if(savedRSAKey.getE().equals(remoteRSAKey.getE()) == false) {
-                return false;
-            }
-
-            if(savedRSAKey.getN().equals(remoteRSAKey.getN()) == false) {
-                return false;
-            }
-
-            return true;
-        }
-
-        if((key1 instanceof DSAPublicKey) && (key2 instanceof DSAPublicKey)) {
-            DSAPublicKey savedDSAKey = (DSAPublicKey) key1;
-            DSAPublicKey remoteDSAKey = (DSAPublicKey) key2;
-
-            if(savedDSAKey.getG().equals(remoteDSAKey.getG()) == false) {
-                return false;
-            }
-
-            if(savedDSAKey.getP().equals(remoteDSAKey.getP()) == false) {
-                return false;
-            }
-
-            if(savedDSAKey.getQ().equals(remoteDSAKey.getQ()) == false) {
-                return false;
-            }
-
-            if(savedDSAKey.getY().equals(remoteDSAKey.getY()) == false) {
-                return false;
-            }
-
-            return true;
-        }
-
-        return false;
+    private final boolean matchKeys(PublicKey key1, PublicKey key2) {
+        return key1.equals(key2);
     }
 
     private boolean pseudoRegex(char[] pattern, int i, char[] match, int j) {