mirror of
https://github.com/jtesta/ssh-audit.git
synced 2024-11-25 20:11:40 +01:00
Lazy CRC32 initialization.
This commit is contained in:
parent
4b69544d91
commit
a193059bc9
@ -204,12 +204,14 @@ class SSH1(object):
|
|||||||
crc = (crc >> 8) ^ self._table[n]
|
crc = (crc >> 8) ^ self._table[n]
|
||||||
return crc
|
return crc
|
||||||
|
|
||||||
_crc32 = CRC32()
|
_crc32 = None
|
||||||
CIPHERS = ['none', 'idea', 'des', '3des', 'tss', 'rc4', 'blowfish']
|
CIPHERS = ['none', 'idea', 'des', '3des', 'tss', 'rc4', 'blowfish']
|
||||||
AUTHS = [None, 'rhosts', 'rsa', 'password', 'rhosts_rsa', 'tis', 'kerberos']
|
AUTHS = [None, 'rhosts', 'rsa', 'password', 'rhosts_rsa', 'tis', 'kerberos']
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def crc32(cls, v):
|
def crc32(cls, v):
|
||||||
|
if cls._crc32 is None:
|
||||||
|
cls._crc32 = cls.CRC32()
|
||||||
return cls._crc32.calc(v)
|
return cls._crc32.calc(v)
|
||||||
|
|
||||||
class KexDB(object):
|
class KexDB(object):
|
||||||
|
Loading…
Reference in New Issue
Block a user