diff src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java @ 298:ab3a99f11a36 ganymed

add ecdsa key support everywhere
author Carl Byington <carl@five-ten-sg.com>
date Tue, 29 Jul 2014 18:01:08 -0700
parents deb5fb087b6f
children 349847b2e318
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java	Tue Jul 29 16:43:12 2014 -0700
+++ b/src/ch/ethz/ssh2/channel/AuthAgentForwardThread.java	Tue Jul 29 18:01:08 2014 -0700
@@ -462,6 +462,11 @@
                                    (DSAPrivateKey) privKey, new SecureRandom());
                 response = DSASHA1Verify.encodeSSHDSASignature(signature);
             }
+            else if (privKey instanceof ECPrivateKey) {
+                byte[] signature = ECDSASHA2Verify.generateSignature(challenge,
+                                   (ECPrivateKey) privKey);
+                response = ECDSASHA2Verify.encodeSSHECDSASignature(signature);
+            }
             else {
                 os.write(SSH_AGENT_FAILURE);
                 return;