mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-12-23 06:27:41 +01:00
Fix method type and naming.
This commit is contained in:
parent
c132c62b96
commit
e4bdabb891
17
ssh-audit.py
17
ssh-audit.py
@ -198,6 +198,7 @@ class Output(object):
|
|||||||
self.colors = True
|
self.colors = True
|
||||||
self.verbose = False
|
self.verbose = False
|
||||||
self.__minlevel = 0
|
self.__minlevel = 0
|
||||||
|
self.__colsupport = 'colorama' in sys.modules or os.name == 'posix'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def minlevel(self):
|
def minlevel(self):
|
||||||
@ -226,7 +227,7 @@ class Output(object):
|
|||||||
@property
|
@property
|
||||||
def colors_supported(self):
|
def colors_supported(self):
|
||||||
# type: () -> bool
|
# type: () -> bool
|
||||||
return 'colorama' in sys.modules or os.name == 'posix'
|
return self.__colsupport
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def _colorized(color):
|
def _colorized(color):
|
||||||
@ -1270,19 +1271,19 @@ class SSH(object): # pylint: disable=too-few-public-methods
|
|||||||
@property
|
@property
|
||||||
def maxlen(self):
|
def maxlen(self):
|
||||||
# type: () -> int
|
# type: () -> int
|
||||||
def ml(items):
|
def _ml(items):
|
||||||
# type: (Sequence[text_type]) -> int
|
# type: (Sequence[text_type]) -> int
|
||||||
return max(len(i) for i in items)
|
return max(len(i) for i in items)
|
||||||
maxlen = 0
|
maxlen = 0
|
||||||
if self.ssh1kex is not None:
|
if self.ssh1kex is not None:
|
||||||
maxlen = max(ml(self.ssh1kex.supported_ciphers),
|
maxlen = max(_ml(self.ssh1kex.supported_ciphers),
|
||||||
ml(self.ssh1kex.supported_authentications),
|
_ml(self.ssh1kex.supported_authentications),
|
||||||
maxlen)
|
maxlen)
|
||||||
if self.ssh2kex is not None:
|
if self.ssh2kex is not None:
|
||||||
maxlen = max(ml(self.ssh2kex.kex_algorithms),
|
maxlen = max(_ml(self.ssh2kex.kex_algorithms),
|
||||||
ml(self.ssh2kex.key_algorithms),
|
_ml(self.ssh2kex.key_algorithms),
|
||||||
ml(self.ssh2kex.server.encryption),
|
_ml(self.ssh2kex.server.encryption),
|
||||||
ml(self.ssh2kex.server.mac),
|
_ml(self.ssh2kex.server.mac),
|
||||||
maxlen)
|
maxlen)
|
||||||
return maxlen
|
return maxlen
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user