From a193059bc96e7b0361f3ad5c58bfffdc53e1c58c Mon Sep 17 00:00:00 2001 From: Andris Raugulis Date: Wed, 5 Oct 2016 14:56:36 +0300 Subject: [PATCH] Lazy CRC32 initialization. --- ssh-audit.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssh-audit.py b/ssh-audit.py index 3408a90..6add4c7 100755 --- a/ssh-audit.py +++ b/ssh-audit.py @@ -204,12 +204,14 @@ class SSH1(object): crc = (crc >> 8) ^ self._table[n] return crc - _crc32 = CRC32() + _crc32 = None CIPHERS = ['none', 'idea', 'des', '3des', 'tss', 'rc4', 'blowfish'] AUTHS = [None, 'rhosts', 'rsa', 'password', 'rhosts_rsa', 'tis', 'kerberos'] @classmethod def crc32(cls, v): + if cls._crc32 is None: + cls._crc32 = cls.CRC32() return cls._crc32.calc(v) class KexDB(object):