Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/ServerConnection.java @ 289:d2ee20d9dff1 ganymed
start conversion from trilead to ganymed
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Fri, 18 Jul 2014 20:17:53 -0700 |
parents | db9b028016de |
children | ab3a99f11a36 |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/ServerConnection.java Fri Jul 18 19:59:32 2014 -0700 +++ b/src/ch/ethz/ssh2/ServerConnection.java Fri Jul 18 20:17:53 2014 -0700 @@ -252,13 +252,12 @@ */ public void setPEMHostKey(char[] pemdata, String password) throws IOException { - PrivateKey key = PEMDecoder.decode(pemdata, password).getPrivate(); + KeyPair pair = PEMDecoder.decode(pemdata, password); + PrivateKey key = pair.getPrivate(); - if (key instanceof DSAPrivateKey) - setDsaHostKey((DSAPrivateKey) key); + if (key instanceof DSAPrivateKey) setDsaHostKey(pair); - if (key instanceof RSAPrivateKey) - setRsaHostKey((RSAPrivateKey) key); + if (key instanceof RSAPrivateKey) setRsaHostKey(pair); } /** @@ -293,8 +292,7 @@ setPEMHostKey(cw.toCharArray(), password); } - private void fixCryptoWishList(CryptoWishList next_cryptoWishList, DSAPrivateKey next_dsa_key, - RSAPrivateKey next_rsa_key) + private void fixCryptoWishList(CryptoWishList next_cryptoWishList, KeyPair next_dsa_key, KeyPair next_rsa_key) { if ((next_dsa_key != null) && (next_rsa_key != null)) next_cryptoWishList.serverHostKeyAlgorithms = new String[] { "ssh-rsa", "ssh-dss" };