aboutsummaryrefslogtreecommitdiffstats
path: root/lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java
diff options
context:
space:
mode:
authorKenny Root <kenny@the-b.org>2015-04-05 23:34:54 -0700
committerKenny Root <kenny@the-b.org>2015-04-05 23:41:14 -0700
commit294bb3977441b5b8727b82f4453d12892a248e44 (patch)
tree590d095426a21bae3db169361d8c28e145ca66ce /lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java
parentca2025f49fa113286632fa47e9037a564766a3e5 (diff)
downloadsshlib-294bb3977441b5b8727b82f4453d12892a248e44.tar.gz
sshlib-294bb3977441b5b8727b82f4453d12892a248e44.tar.bz2
sshlib-294bb3977441b5b8727b82f4453d12892a248e44.zip
ECDH there should be no negative bigint
Since the hash is over the canonical values of the agreed parameters when the shared secret was encoded as a negative biginteger, the two sides didn't agree. Make sure this doesn't occur by setting the bigint signum to 1. Change-Id: Ib0581cd7dc280dcce8cc3309d7102f8f5a444158
Diffstat (limited to 'lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java')
-rw-r--r--lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java b/lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java
index 43d31ad..870a3b4 100644
--- a/lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java
+++ b/lib/src/main/java/com/trilead/ssh2/crypto/dh/EcDhExchange.java
@@ -96,7 +96,7 @@ public class EcDhExchange extends GenericDhExchange {
throw (IOException) new IOException("Invalid ECDH key").initCause(e);
}
- sharedSecret = new BigInteger(ka.generateSecret());
+ sharedSecret = new BigInteger(1, ka.generateSecret());
}
@Override