Refactoring

pull/104/head
Sheng 2019-10-09 11:46:47 +08:00
parent fc30ead69e
commit d5d654407f
1 changed files with 3 additions and 2 deletions

View File

@ -65,9 +65,10 @@ class Server(paramiko.ServerInterface):
self.key_verified = False self.key_verified = False
def get_cmd2enc(self, encodings): def get_cmd2enc(self, encodings):
while len(encodings) < len(self.commands): n = len(self.commands)
while len(encodings) < n:
encodings.append(random.choice(self.encodings)) encodings.append(random.choice(self.encodings))
return dict(zip(self.commands, encodings[0:2])) return dict(zip(self.commands, encodings[0:n]))
def check_channel_request(self, kind, chanid): def check_channel_request(self, kind, chanid):
if kind == 'session': if kind == 'session':