Mercurial > 510Connectbot
diff src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java @ 302:beaccc9df37b ganymed
add ecdsa key support everywhere
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 29 Jul 2014 20:23:00 -0700 |
parents | 349847b2e318 |
children | a218d9cd725b |
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java Tue Jul 29 18:50:35 2014 -0700 +++ b/src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java Tue Jul 29 20:23:00 2014 -0700 @@ -28,6 +28,7 @@ import java.security.PublicKey; import java.security.SecureRandom; import java.security.interfaces.DSAPrivateKey; +import java.security.interfaces.ECPrivateKey; import java.security.interfaces.RSAPrivateKey; import java.security.spec.DSAPrivateKeySpec; import java.security.spec.DSAPublicKeySpec; @@ -460,11 +461,12 @@ else if (privKey instanceof DSAPrivateKey) { byte[] signature = DSASHA1Verify.generateSignature(challenge, (DSAPrivateKey) privKey, new SecureRandom()); - response = DSASHA1Verify.encodeSSHDSASignature(signature); + response = DSASHA1Verify.encodeSSHDSASignature(signature, ); } else if (privKey instanceof ECPrivateKey) { + ECPrivateKey pk = (ECPrivateKey) privKey; byte[] signature = ECDSASHA2Verify.generateSignature(challenge, - (ECPrivateKey) privKey); + (ECPrivateKey) privKey, pk.getParams()); response = ECDSASHA2Verify.encodeSSHECDSASignature(signature); } else {