summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--Makefile1
-rw-r--r--paramiko/kex_gex.py7
-rw-r--r--tests/test_kex.py2
3 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 6706f412..742a4127 100644
--- a/Makefile
+++ b/Makefile
@@ -65,3 +65,4 @@ test:
# transport.py
#
# POST md5sum on website!
+# RUN setup.py
diff --git a/paramiko/kex_gex.py b/paramiko/kex_gex.py
index c29c288d..63a0c994 100644
--- a/paramiko/kex_gex.py
+++ b/paramiko/kex_gex.py
@@ -64,6 +64,7 @@ class KexGex (object):
# only used for unit tests: we shouldn't ever send this
m.add_byte(chr(_MSG_KEXDH_GEX_REQUEST_OLD))
m.add_int(self.preferred_bits)
+ self.old_style = True
else:
m.add_byte(chr(_MSG_KEXDH_GEX_REQUEST))
m.add_int(self.min_bits)
@@ -228,9 +229,11 @@ class KexGex (object):
hm.add(self.transport.local_version, self.transport.remote_version,
self.transport.local_kex_init, self.transport.remote_kex_init,
host_key)
- hm.add_int(self.min_bits)
+ if not self.old_style:
+ hm.add_int(self.min_bits)
hm.add_int(self.preferred_bits)
- hm.add_int(self.max_bits)
+ if not self.old_style:
+ hm.add_int(self.max_bits)
hm.add_mpint(self.p)
hm.add_mpint(self.g)
hm.add_mpint(self.e)
diff --git a/tests/test_kex.py b/tests/test_kex.py
index 1989117f..f3042753 100644
--- a/tests/test_kex.py
+++ b/tests/test_kex.py
@@ -179,7 +179,7 @@ class KexTest (unittest.TestCase):
msg.add_string('fake-sig')
msg.rewind()
kex.parse_next(paramiko.kex_gex._MSG_KEXDH_GEX_REPLY, msg)
- H = 'A265563F2FA87F1A89BF007EE90D58BE2E4A4BD0'
+ H = '807F87B269EF7AC5EC7E75676808776A27D5864C'
self.assertEquals(self.K, transport._K)
self.assertEquals(H, hexlify(transport._H).upper())
self.assertEquals(('fake-host-key', 'fake-sig'), transport._verify)