aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2013-04-11 20:45:22 -0700
committerKenny Root <kenny@the-b.org>2013-04-11 20:45:22 -0700
commit6d03f247ab19724c3c724b743917a63487e4b0b1 (patch)
treea7867a1c211b2aac612fce93493c01e65522b39b
parent1e98217978aaccfcf62097266f699acf5b22493e (diff)
downloadconnectbot-6d03f247ab19724c3c724b743917a63487e4b0b1.tar.gz
connectbot-6d03f247ab19724c3c724b743917a63487e4b0b1.tar.bz2
connectbot-6d03f247ab19724c3c724b743917a63487e4b0b1.zip
Fix bug in EC point encoding
-rw-r--r--src/com/trilead/ssh2/signature/ECDSASHA2Verify.java5
-rw-r--r--src/com/trilead/ssh2/transport/KexManager.java2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/com/trilead/ssh2/signature/ECDSASHA2Verify.java b/src/com/trilead/ssh2/signature/ECDSASHA2Verify.java
index 97bda5f..4f3bae2 100644
--- a/src/com/trilead/ssh2/signature/ECDSASHA2Verify.java
+++ b/src/com/trilead/ssh2/signature/ECDSASHA2Verify.java
@@ -382,12 +382,13 @@ public class ECDSASHA2Verify {
{
byte[] affineX = removeLeadingZeroes(group.getAffineX().toByteArray());
- System.arraycopy(affineX, 0, M, 1, affineX.length);
+ System.arraycopy(affineX, 0, M, 1 + elementSize - affineX.length, affineX.length);
}
{
byte[] affineY = removeLeadingZeroes(group.getAffineY().toByteArray());
- System.arraycopy(affineY, 0, M, 1 + elementSize, affineY.length);
+ System.arraycopy(affineY, 0, M, 1 + elementSize + elementSize - affineY.length,
+ affineY.length);
}
return M;
diff --git a/src/com/trilead/ssh2/transport/KexManager.java b/src/com/trilead/ssh2/transport/KexManager.java
index 04043e4..6e0d904 100644
--- a/src/com/trilead/ssh2/transport/KexManager.java
+++ b/src/com/trilead/ssh2/transport/KexManager.java
@@ -483,7 +483,7 @@ public class KexManager
return;
}
- throw new IllegalStateException("Unkown KEX method!");
+ throw new IllegalStateException("Unknown KEX method!");
}
if (msg[0] == Packets.SSH_MSG_NEWKEYS)