changeset 301:ca5dd224a87b ganymed

add ecdsa key support everywhere
author Carl Byington <carl@five-ten-sg.com>
date Tue, 29 Jul 2014 18:50:35 -0700
parents 349847b2e318
children beaccc9df37b
files src/ch/ethz/ssh2/ServerConnection.java src/ch/ethz/ssh2/transport/ClientTransportManager.java src/ch/ethz/ssh2/transport/KexManager.java src/ch/ethz/ssh2/transport/KexState.java src/ch/ethz/ssh2/transport/TransportManager.java
diffstat 5 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/ServerConnection.java	Tue Jul 29 18:36:57 2014 -0700
+++ b/src/ch/ethz/ssh2/ServerConnection.java	Tue Jul 29 18:50:35 2014 -0700
@@ -10,6 +10,8 @@
 import java.io.FileReader;
 import java.io.IOException;
 import java.net.Socket;
+import java.util.List;
+import java.util.ArrayList;
 
 import ch.ethz.ssh2.crypto.CryptoWishList;
 import ch.ethz.ssh2.crypto.PEMDecoder;
@@ -49,11 +51,11 @@
 	 */
 	public ServerConnection(Socket s)
 	{
-		this(s, null, null);
+		this(s, null, null, null);
 	}
 
     public ServerConnection(Socket s, String softwareversion) {
-        this(s, null, null);
+        this(s, null, null, null);
         this.softwareversion = softwareversion;
     }
 
--- a/src/ch/ethz/ssh2/transport/ClientTransportManager.java	Tue Jul 29 18:36:57 2014 -0700
+++ b/src/ch/ethz/ssh2/transport/ClientTransportManager.java	Tue Jul 29 18:50:35 2014 -0700
@@ -47,7 +47,7 @@
         KexManager km = new ClientKexManager(this, csh, cwl, hostname, port, verifier, rnd);
         super.init(tc, km);
 
-        km.initiateKEX(cwl, dhgex, null, null);
+        km.initiateKEX(cwl, dhgex, null, null, null);
 
         this.startReceiver();
     }
--- a/src/ch/ethz/ssh2/transport/KexManager.java	Tue Jul 29 18:36:57 2014 -0700
+++ b/src/ch/ethz/ssh2/transport/KexManager.java	Tue Jul 29 18:50:35 2014 -0700
@@ -14,6 +14,8 @@
 import java.security.interfaces.RSAPrivateKey;
 import java.security.interfaces.ECPrivateKey;
 import java.util.Arrays;
+import java.util.Set;
+import java.util.TreeSet;
 
 import ch.ethz.ssh2.ConnectionInfo;
 import ch.ethz.ssh2.DHGexParameters;
--- a/src/ch/ethz/ssh2/transport/KexState.java	Tue Jul 29 18:36:57 2014 -0700
+++ b/src/ch/ethz/ssh2/transport/KexState.java	Tue Jul 29 18:50:35 2014 -0700
@@ -39,4 +39,5 @@
 
 	public KeyPair local_dsa_key;
 	public KeyPair local_rsa_key;
+	public KeyPair local_ec_key;
 }
--- a/src/ch/ethz/ssh2/transport/TransportManager.java	Tue Jul 29 18:36:57 2014 -0700
+++ b/src/ch/ethz/ssh2/transport/TransportManager.java	Tue Jul 29 18:50:35 2014 -0700
@@ -296,7 +296,7 @@
      * @param rsa   may be null if this is a client connection
      * @throws IOException
      */
-    public void forceKeyExchange(CryptoWishList cwl, DHGexParameters dhgex, KeyPair dsa, KeyPair rsa)
+    public void forceKeyExchange(CryptoWishList cwl, DHGexParameters dhgex, KeyPair dsa, KeyPair rsa, KeyPair ec)
             throws IOException {
         synchronized(connectionSemaphore) {
             if(connectionClosed) {
@@ -304,7 +304,7 @@
                 throw reasonClosedCause;
             }
         }
-        km.initiateKEX(cwl, dhgex, dsa, rsa);
+        km.initiateKEX(cwl, dhgex, dsa, rsa, ec);
     }
 
     public void changeRecvCipher(BlockCipher bc, MAC mac) {