aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/main/java/com/trilead/ssh2/KnownHosts.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2013-02-06 21:34:15 -0800
committerKenny Root <kenny@the-b.org>2013-02-06 21:34:15 -0800
commit1ad1f57886747362abb2e6f7eb91a221369eed35 (patch)
treed16bf282d04e99f364a5738c4e505b8858a6288c /lib/src/main/java/com/trilead/ssh2/KnownHosts.java
parentebec6db1083652b898b1e382712b59fe1e99e5f4 (diff)
downloadsshlib-1ad1f57886747362abb2e6f7eb91a221369eed35.tar.gz
sshlib-1ad1f57886747362abb2e6f7eb91a221369eed35.tar.bz2
sshlib-1ad1f57886747362abb2e6f7eb91a221369eed35.zip
Add support for ECDSA P-384 and P-521
Diffstat (limited to 'lib/src/main/java/com/trilead/ssh2/KnownHosts.java')
-rw-r--r--lib/src/main/java/com/trilead/ssh2/KnownHosts.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/src/main/java/com/trilead/ssh2/KnownHosts.java b/lib/src/main/java/com/trilead/ssh2/KnownHosts.java
index b88c1b9..3fba4da 100644
--- a/lib/src/main/java/com/trilead/ssh2/KnownHosts.java
+++ b/lib/src/main/java/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))