diff options
author | Kenny Root <kenny@the-b.org> | 2013-02-06 21:34:15 -0800 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2013-02-06 21:34:15 -0800 |
commit | d36f48b37697e8f7797a9a8435647577675a6a5b (patch) | |
tree | 2b4f83c2aa22c02b72404aa93d7c942710659ed8 /src/com/trilead/ssh2/KnownHosts.java | |
parent | aee3c2fdf1d32edec258cb5fb1c25357dde5183e (diff) | |
download | connectbot-d36f48b37697e8f7797a9a8435647577675a6a5b.tar.gz connectbot-d36f48b37697e8f7797a9a8435647577675a6a5b.tar.bz2 connectbot-d36f48b37697e8f7797a9a8435647577675a6a5b.zip |
Add support for ECDSA P-384 and P-521
Diffstat (limited to 'src/com/trilead/ssh2/KnownHosts.java')
-rw-r--r-- | src/com/trilead/ssh2/KnownHosts.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/com/trilead/ssh2/KnownHosts.java b/src/com/trilead/ssh2/KnownHosts.java index b88c1b9..3fba4da 100644 --- a/src/com/trilead/ssh2/KnownHosts.java +++ b/src/com/trilead/ssh2/KnownHosts.java @@ -117,7 +117,7 @@ public class KnownHosts publicKeys.add(new KnownHostsEntry(hostnames, dpk));
}
}
- else if ("ecdsa-sha2-nistp256".equals(serverHostKeyAlgorithm))
+ else if (serverHostKeyAlgorithm.startsWith(ECDSASHA2Verify.ECDSA_SHA2_PREFIX))
{
ECPublicKey epk = ECDSASHA2Verify.decodeSSHECDSAPublicKey(serverHostKey);
@@ -465,7 +465,7 @@ public class KnownHosts private final boolean matchKeys(PublicKey key1, PublicKey key2)
{
- return key1.equals(key2);
+ return key1.equals(key2);
}
private final boolean pseudoRegex(char[] pattern, int i, char[] match, int j)
@@ -600,9 +600,9 @@ public class KnownHosts {
remoteKey = DSASHA1Verify.decodeSSHDSAPublicKey(serverHostKey);
}
- else if ("ecdsa-sha2-nistp256".equals(serverHostKeyAlgorithm))
+ else if (serverHostKeyAlgorithm.startsWith("ecdsa-sha2-"))
{
- remoteKey = ECDSASHA2Verify.decodeSSHECDSAPublicKey(serverHostKey);
+ remoteKey = ECDSASHA2Verify.decodeSSHECDSAPublicKey(serverHostKey);
}
else
throw new IllegalArgumentException("Unknown hostkey type " + serverHostKeyAlgorithm);
@@ -719,7 +719,7 @@ public class KnownHosts throw new IllegalArgumentException("Unknown hash type " + type);
}
- if ("ecdsa-sha2-nistp256".equals(keyType))
+ if (keyType.startsWith("ecdsa-sha2-"))
{
}
else if ("ssh-rsa".equals(keyType))
|