Better compression handling.

This commit is contained in:
Andris Raugulis 2016-01-05 14:10:48 +02:00
parent c485ffb01e
commit 122588cb00

View File

@ -272,9 +272,12 @@ def process_algorithm(alg_type, alg_name, alg_max_len=0):
f(' ' * len(prefix + alg_name) + padding + ' `- ' + text) f(' ' * len(prefix + alg_name) + padding + ' `- ' + text)
def process_kex(kex): def process_kex(kex):
state = 'zlib@openssh.com' in kex.server.compression compressions = [x for x in kex.server.compression if x != 'none']
state = 'enabled' if state else 'disabled' if len(compressions) > 0:
out.good('[info] compression is ' + state) cmptxt = 'enabled ({0})'.format(', '.join(compressions))
else:
cmptxt = 'disabled'
out.good('[info] compression is ' + cmptxt)
ml = lambda l: max(len(i) for i in l) ml = lambda l: max(len(i) for i in l)
maxlen = max(ml(kex.kex_algorithms), maxlen = max(ml(kex.kex_algorithms),
ml(kex.key_algorithms), ml(kex.key_algorithms),