summaryrefslogtreecommitdiffhomepage
path: root/kex_group1.py
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2003-11-10 04:54:02 +0000
committerRobey Pointer <robey@lag.net>2003-11-10 04:54:02 +0000
commitaad7b859f194451a0529c4d8aa20cdc724ae33a2 (patch)
tree24b19c05626e547f3f3bc4a12c7a8c64578dbed5 /kex_group1.py
parent0e1ef2c65c80bd76eb62f5dfd953cb987d36ce3a (diff)
[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-7]
cleaned up server code, renamed some files & classes renamed demo-server.py and demo-host-key to demo_server.py and demo_host_key, just to be consistent. renamed SSHException -> SecshException. generalized the mechanism where Channel decides whether to allow different channel requests: 4 of the main ones (pty, window-change, shell, and subsystem) go through easily override-able methods now. you could probably make an actual ssh shell server. gave ChannelFile a repr(). turned off ultra debugging in the demos. demo_server creates a subclass of Channel to allow pty/shell and sets an event when the shell request is made, so that it knows when it can start sending the fake bbs. renamed to charmander and updated some of the distutils files.
Diffstat (limited to 'kex_group1.py')
-rw-r--r--kex_group1.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/kex_group1.py b/kex_group1.py
index 7d65c388..ab16ee4e 100644
--- a/kex_group1.py
+++ b/kex_group1.py
@@ -5,7 +5,7 @@
# "g" generator.
from message import Message, inflate_long
-from secsh import SSHException
+from secsh import SecshException
from transport import MSG_NEWKEYS
from Crypto.Hash import SHA
from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL
@@ -59,14 +59,14 @@ class KexGroup1(object):
return self.parse_kexdh_init(m)
elif not self.transport.server_mode and (ptype == MSG_KEXDH_REPLY):
return self.parse_kexdh_reply(m)
- raise SSHException('KexGroup1 asked to handle packet type %d' % ptype)
+ raise SecshException('KexGroup1 asked to handle packet type %d' % ptype)
def parse_kexdh_reply(self, m):
# client mode
host_key = m.get_string()
self.f = m.get_mpint()
if (self.f < 1) or (self.f > P - 1):
- raise SSHException('Server kex "f" is out of range')
+ raise SecshException('Server kex "f" is out of range')
sig = m.get_string()
K = pow(self.f, self.x, P)
# okay, build up the hash H of (V_C || V_S || I_C || I_S || K_S || e || f || K)
@@ -82,7 +82,7 @@ class KexGroup1(object):
# server mode
self.e = m.get_mpint()
if (self.e < 1) or (self.e > P - 1):
- raise SSHException('Client kex "e" is out of range')
+ raise SecshException('Client kex "e" is out of range')
K = pow(self.e, self.x, P)
key = str(self.transport.get_server_key())
# okay, build up the hash H of (V_C || V_S || I_C || I_S || K_S || e || f || K)