diff src/ch/ethz/ssh2/transport/KexManager.java @ 358:37f4a3b506d9

move nist ec curves to lower priority
author Carl Byington <carl@five-ten-sg.com>
date Sun, 03 Aug 2014 11:16:40 -0700
parents a1a2e33b3565
children b82713cd787d
line wrap: on
line diff
--- a/src/ch/ethz/ssh2/transport/KexManager.java	Fri Aug 01 13:34:58 2014 -0700
+++ b/src/ch/ethz/ssh2/transport/KexManager.java	Sun Aug 03 11:16:40 2014 -0700
@@ -14,8 +14,7 @@
 import java.security.interfaces.RSAPrivateKey;
 import java.security.interfaces.ECPrivateKey;
 import java.util.Arrays;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.ArrayList;
 
 import ch.ethz.ssh2.ConnectionInfo;
 import ch.ethz.ssh2.DHGexParameters;
@@ -39,24 +38,24 @@
 public abstract class KexManager implements MessageHandler {
     protected static final Logger log = Logger.getLogger(KexManager.class);
 
-    private static final Set<String> HOSTKEY_ALGS = new TreeSet<String>();
+    private static final ArrayList<String> HOSTKEY_ALGS = new ArrayList<String>();
     static {
+        HOSTKEY_ALGS.add("ssh-rsa");
+        HOSTKEY_ALGS.add("ssh-dss");
         HOSTKEY_ALGS.add("ecdsa-sha2-nistp256");
         HOSTKEY_ALGS.add("ecdsa-sha2-nistp384");
         HOSTKEY_ALGS.add("ecdsa-sha2-nistp521");
-        HOSTKEY_ALGS.add("ssh-rsa");
-        HOSTKEY_ALGS.add("ssh-dss");
     }
 
-    private static final Set<String> KEX_ALGS = new TreeSet<String>();
+    private static final ArrayList<String> KEX_ALGS = new ArrayList<String>();
     static {
-        KEX_ALGS.add("ecdh-sha2-nistp256");
-        KEX_ALGS.add("ecdh-sha2-nistp384");
-        KEX_ALGS.add("ecdh-sha2-nistp521");
         KEX_ALGS.add("diffie-hellman-group-exchange-sha256");
         KEX_ALGS.add("diffie-hellman-group-exchange-sha1");
         KEX_ALGS.add("diffie-hellman-group14-sha1");
         KEX_ALGS.add("diffie-hellman-group1-sha1");
+        KEX_ALGS.add("ecdh-sha2-nistp256");
+        KEX_ALGS.add("ecdh-sha2-nistp384");
+        KEX_ALGS.add("ecdh-sha2-nistp521");
     }
 
     KexState kxs;