Mercurial > 510Connectbot
comparison 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 |
comparison
equal
deleted
inserted
replaced
357:46c2115ae1c8 | 358:37f4a3b506d9 |
---|---|
12 import java.security.SecureRandom; | 12 import java.security.SecureRandom; |
13 import java.security.interfaces.DSAPrivateKey; | 13 import java.security.interfaces.DSAPrivateKey; |
14 import java.security.interfaces.RSAPrivateKey; | 14 import java.security.interfaces.RSAPrivateKey; |
15 import java.security.interfaces.ECPrivateKey; | 15 import java.security.interfaces.ECPrivateKey; |
16 import java.util.Arrays; | 16 import java.util.Arrays; |
17 import java.util.Set; | 17 import java.util.ArrayList; |
18 import java.util.TreeSet; | |
19 | 18 |
20 import ch.ethz.ssh2.ConnectionInfo; | 19 import ch.ethz.ssh2.ConnectionInfo; |
21 import ch.ethz.ssh2.DHGexParameters; | 20 import ch.ethz.ssh2.DHGexParameters; |
22 import ch.ethz.ssh2.compression.CompressionFactory; | 21 import ch.ethz.ssh2.compression.CompressionFactory; |
23 import ch.ethz.ssh2.compression.Compressor; | 22 import ch.ethz.ssh2.compression.Compressor; |
37 * @version $Id: KexManager.java 152 2014-04-28 11:02:23Z dkocher@sudo.ch $ | 36 * @version $Id: KexManager.java 152 2014-04-28 11:02:23Z dkocher@sudo.ch $ |
38 */ | 37 */ |
39 public abstract class KexManager implements MessageHandler { | 38 public abstract class KexManager implements MessageHandler { |
40 protected static final Logger log = Logger.getLogger(KexManager.class); | 39 protected static final Logger log = Logger.getLogger(KexManager.class); |
41 | 40 |
42 private static final Set<String> HOSTKEY_ALGS = new TreeSet<String>(); | 41 private static final ArrayList<String> HOSTKEY_ALGS = new ArrayList<String>(); |
43 static { | 42 static { |
43 HOSTKEY_ALGS.add("ssh-rsa"); | |
44 HOSTKEY_ALGS.add("ssh-dss"); | |
44 HOSTKEY_ALGS.add("ecdsa-sha2-nistp256"); | 45 HOSTKEY_ALGS.add("ecdsa-sha2-nistp256"); |
45 HOSTKEY_ALGS.add("ecdsa-sha2-nistp384"); | 46 HOSTKEY_ALGS.add("ecdsa-sha2-nistp384"); |
46 HOSTKEY_ALGS.add("ecdsa-sha2-nistp521"); | 47 HOSTKEY_ALGS.add("ecdsa-sha2-nistp521"); |
47 HOSTKEY_ALGS.add("ssh-rsa"); | 48 } |
48 HOSTKEY_ALGS.add("ssh-dss"); | 49 |
49 } | 50 private static final ArrayList<String> KEX_ALGS = new ArrayList<String>(); |
50 | |
51 private static final Set<String> KEX_ALGS = new TreeSet<String>(); | |
52 static { | 51 static { |
53 KEX_ALGS.add("ecdh-sha2-nistp256"); | |
54 KEX_ALGS.add("ecdh-sha2-nistp384"); | |
55 KEX_ALGS.add("ecdh-sha2-nistp521"); | |
56 KEX_ALGS.add("diffie-hellman-group-exchange-sha256"); | 52 KEX_ALGS.add("diffie-hellman-group-exchange-sha256"); |
57 KEX_ALGS.add("diffie-hellman-group-exchange-sha1"); | 53 KEX_ALGS.add("diffie-hellman-group-exchange-sha1"); |
58 KEX_ALGS.add("diffie-hellman-group14-sha1"); | 54 KEX_ALGS.add("diffie-hellman-group14-sha1"); |
59 KEX_ALGS.add("diffie-hellman-group1-sha1"); | 55 KEX_ALGS.add("diffie-hellman-group1-sha1"); |
56 KEX_ALGS.add("ecdh-sha2-nistp256"); | |
57 KEX_ALGS.add("ecdh-sha2-nistp384"); | |
58 KEX_ALGS.add("ecdh-sha2-nistp521"); | |
60 } | 59 } |
61 | 60 |
62 KexState kxs; | 61 KexState kxs; |
63 int kexCount = 0; | 62 int kexCount = 0; |
64 KeyMaterial km; | 63 KeyMaterial km; |