summaryrefslogtreecommitdiff
path: root/paramiko/kex_ecdh_nist.py
diff options
context:
space:
mode:
authorAndrew Wason <rectalogic@rectalogic.com>2019-02-09 11:23:39 -0500
committerAndrew Wason <rectalogic@rectalogic.com>2019-02-09 11:23:39 -0500
commit893cda63da0f708e4c335a69003746c32ad51895 (patch)
treeda3736fbb732e148daac54a18c3f3be85205e305 /paramiko/kex_ecdh_nist.py
parenta2fa7d3f3514b75f23f3992986f08e3ed1212caf (diff)
downloadparamiko-893cda63da0f708e4c335a69003746c32ad51895.tar.gz
Fix numbers vs key mixups
Diffstat (limited to 'paramiko/kex_ecdh_nist.py')
-rw-r--r--paramiko/kex_ecdh_nist.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/paramiko/kex_ecdh_nist.py b/paramiko/kex_ecdh_nist.py
index beabbe5f..ad5c9c79 100644
--- a/paramiko/kex_ecdh_nist.py
+++ b/paramiko/kex_ecdh_nist.py
@@ -66,9 +66,9 @@ class KexNistp256:
Q_C_bytes = m.get_string()
self.Q_C = ec.EllipticCurvePublicKey.from_encoded_point(
self.curve, Q_C_bytes
- ).public_numbers()
+ )
K_S = self.transport.get_server_key().asbytes()
- K = self.P.exchange(ec.ECDH(), self.Q_C.public_key(default_backend()))
+ K = self.P.exchange(ec.ECDH(), self.Q_C)
K = long(hexlify(K), 16)
# compute exchange hash
hm = Message()
@@ -110,9 +110,9 @@ class KexNistp256:
Q_S_bytes = m.get_string()
self.Q_S = ec.EllipticCurvePublicKey.from_encoded_point(
self.curve, Q_S_bytes
- ).public_numbers()
+ )
sig = m.get_binary()
- K = self.P.exchange(ec.ECDH(), self.Q_S.public_key(default_backend()))
+ K = self.P.exchange(ec.ECDH(), self.Q_S)
K = long(hexlify(K), 16)
# compute exchange hash and verify signature
hm = Message()