summaryrefslogtreecommitdiff
path: root/paramiko/kex_group1.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-05-21 20:35:29 +0000
committerRobey Pointer <robey@lag.net>2005-05-21 20:35:29 +0000
commit44239ae077358a40f58c46449cfb929a3061bb67 (patch)
treea478b25840d296e2258509df6ac1af5dce2ad33d /paramiko/kex_group1.py
parentcb5aa0671bfeafacd225de350db3f4e7a049e7bc (diff)
downloadparamiko-44239ae077358a40f58c46449cfb929a3061bb67.tar.gz
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-10]
fix stupid bug in kex_group1 which luckily only affected unit tests
Diffstat (limited to 'paramiko/kex_group1.py')
-rw-r--r--paramiko/kex_group1.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/paramiko/kex_group1.py b/paramiko/kex_group1.py
index 263cf8a3..12255aac 100644
--- a/paramiko/kex_group1.py
+++ b/paramiko/kex_group1.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
# Copyright (C) 2003-2005 Robey Pointer <robey@lag.net>
#
# This file is part of paramiko.
@@ -96,8 +94,11 @@ class KexGroup1(object):
# okay, build up the hash H of (V_C || V_S || I_C || I_S || K_S || e || f || K)
hm = Message()
hm.add(self.transport.local_version, self.transport.remote_version,
- self.transport.local_kex_init, self.transport.remote_kex_init,
- host_key, self.e, self.f, K)
+ self.transport.local_kex_init, self.transport.remote_kex_init)
+ hm.add_string(host_key)
+ hm.add_mpint(self.e)
+ hm.add_mpint(self.f)
+ hm.add_mpint(K)
self.transport._set_K_H(K, SHA.new(str(hm)).digest())
self.transport._verify_key(host_key, sig)
self.transport._activate_outbound()
@@ -112,8 +113,11 @@ class KexGroup1(object):
# okay, build up the hash H of (V_C || V_S || I_C || I_S || K_S || e || f || K)
hm = Message()
hm.add(self.transport.remote_version, self.transport.local_version,
- self.transport.remote_kex_init, self.transport.local_kex_init,
- key, self.e, self.f, K)
+ self.transport.remote_kex_init, self.transport.local_kex_init)
+ hm.add_string(key)
+ hm.add_mpint(self.e)
+ hm.add_mpint(self.f)
+ hm.add_mpint(K)
H = SHA.new(str(hm)).digest()
self.transport._set_K_H(K, H)
# sign it