summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRobey Pointer <robey@lag.net>2005-11-12 01:38:27 +0000
committerRobey Pointer <robey@lag.net>2005-11-12 01:38:27 +0000
commitba6165a4aa63b3b51ee9f34bcf9626e87ba38555 (patch)
tree070382c7d0c9f76a8b34049a9468997142629504
parent6de6dc72c659f17fec8fb3a5c97f45c7db4c6622 (diff)
[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-81]
copy from jaramiko: only check for rekey at the beginning of a packet
-rw-r--r--paramiko/packet.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/packet.py b/paramiko/packet.py
index 19b59ce3..e6c6ed36 100644
--- a/paramiko/packet.py
+++ b/paramiko/packet.py
@@ -167,7 +167,7 @@ class Packetizer (object):
self.__keepalive_callback = callback
self.__keepalive_last = time.time()
- def read_all(self, n):
+ def read_all(self, n, check_rekey=False):
"""
Read as close to N bytes as possible, blocking as long as necessary.
@@ -191,7 +191,7 @@ class Packetizer (object):
except socket.timeout:
if self.__closed:
raise EOFError()
- if self.__need_rekey:
+ if check_rekey and (len(out) == 0) and self.__need_rekey:
raise NeedRekeyException()
self._check_keepalive()
return out
@@ -278,7 +278,7 @@ class Packetizer (object):
@raise SSHException: if the packet is mangled
@raise NeedRekeyException: if the transport should rekey
"""
- header = self.read_all(self.__block_size_in)
+ header = self.read_all(self.__block_size_in, check_rekey=True)
if self.__block_engine_in != None:
header = self.__block_engine_in.decrypt(header)
if self.__dump_packets: