tlsfuzzer/tlslite-ng

View on GitHub

Showing 324 of 1,708 total issues

Function decrypt has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def decrypt(self, encBytes):
        """Decrypt the passed-in bytes.

        This requires the key to have a private component.  It performs
        PKCS#1 v1.5 decryption operation of the passed-in data.
Severity: Minor
Found in tlslite/utils/rsakey.py - About 1 hr to fix

    Function _serverGetClientHello has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def _serverGetClientHello(self, settings, private_key, cert_chain,
                                  verifierDB,
                                  sessionCache, anon, alpn, sni):
            # Tentatively set version to most-desirable version, so if an error
            # occurs parsing the ClientHello, this will be the version we'll use
    Severity: Minor
    Found in tlslite/tlsconnection.py - About 1 hr to fix

      Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def __init__(self,
      Severity: Major
      Found in tlslite/integration/clienthelper.py - About 1 hr to fix

        Function calcVerifyBytes has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def calcVerifyBytes(version, handshakeHashes, signatureAlg,
        Severity: Major
        Found in tlslite/keyexchange.py - About 1 hr to fix

          Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def __init__(self, use_datetime=0,
          Severity: Major
          Found in tlslite/integration/xmlrpctransport.py - About 1 hr to fix

            Function create has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def create(self, version, random, session_id, cipher_suite,
            Severity: Major
            Found in tlslite/messages.py - About 1 hr to fix

              Function _serverGetClientHello has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  def _serverGetClientHello(self, settings, private_key, cert_chain,
              Severity: Major
              Found in tlslite/tlsconnection.py - About 1 hr to fix

                Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    def __init__(self, cipherSuite, clientHello, serverHello, privateKey,
                Severity: Major
                Found in tlslite/keyexchange.py - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                          if (psk and
                                  PskKeyExchangeMode.psk_dhe_ke in psk_types.modes and
                                  "psk_dhe_ke" in settings.psk_modes) or\
                                  (psk is None and privateKey):
                              self.ecdhCurve = selected_group
                  Severity: Major
                  Found in tlslite/tlsconnection.py - About 1 hr to fix

                    Function __init__ has 8 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        def __init__(self, host = '', port = IMAP4_TLS_PORT,
                    Severity: Major
                    Found in tlslite/integration/imap4_tls.py - About 1 hr to fix

                      Function handshakeClientSRP has 8 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          def handshakeClientSRP(self, username, password, session=None,
                      Severity: Major
                      Found in tlslite/tlsconnection.py - About 1 hr to fix

                        Function calc_key has 8 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        def calc_key(version, secret, cipher_suite, label, handshake_hashes=None,
                        Severity: Major
                        Found in tlslite/mathtls.py - About 1 hr to fix

                          Function encrypt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def encrypt(self, plaintext):
                                  """Encrypt a single block of plaintext."""
                                  if len(plaintext) != self.block_size:
                                      raise ValueError('wrong block length, expected {0} got {1}'
                                                       .format(self.block_size, len(plaintext)))
                          Severity: Minor
                          Found in tlslite/utils/rijndael.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function EMSA_PSS_verify has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def EMSA_PSS_verify(self, mHash, EM, emBits, hAlg, sLen=0):
                                  """Verify signature in passed in encoded message
                          
                                  This verifies the signature in encoded message
                          
                          
                          Severity: Minor
                          Found in tlslite/utils/rsakey.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function password_callback has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def password_callback(v, prompt1='Enter private key passphrase:',
                                                     prompt2='Verify passphrase:'):
                              from getpass import getpass
                              while 1:
                                  try:
                          Severity: Minor
                          Found in tlslite/utils/openssl_rsakey.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function _parseKeyHelper has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def _parseKeyHelper(key, private, public):
                              if private and not key.hasPrivateKey():
                                  raise SyntaxError("Not a private key!")
                          
                              if public:
                          Severity: Minor
                          Found in tlslite/utils/keyfactory.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function add_dynamic_size has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def add_dynamic_size(self, msg_type, size_offset, size_of_size):
                                  """Add a message type which has a dynamic size set in a header"""
                                  if msg_type in self.priorities:
                                      raise ValueError("Message type already defined")
                                  if size_of_size < 1:
                          Severity: Minor
                          Found in tlslite/defragmenter.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function ct_check_cbc_mac_and_pad has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                          def ct_check_cbc_mac_and_pad(data, mac, seqnumBytes, contentType, version,
                                                       block_size=16):
                              """
                              Check CBC cipher HMAC and padding. Close to constant time.
                          
                          
                          Severity: Minor
                          Found in tlslite/utils/constanttime.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function decrypt has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def decrypt(self, ciphertext):
                                  """Decrypt a block of ciphertext."""
                                  if len(ciphertext) != self.block_size:
                                      raise ValueError('wrong block length, expected {0} got {1}'
                                                       .format(self.block_size, len(ciphertext)))
                          Severity: Minor
                          Found in tlslite/utils/rijndael.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Function _guard_against_unicode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                          Open

                              def _guard_against_unicode(self, data):
                                  """Check the data for valid datatype and return them.
                          
                                  Only accept byte strings or ascii unicode values.
                                  Otherwise there is no way to correctly decode the data into bytes.
                          Severity: Minor
                          Found in tlslite/utils/python_tripledes.py - About 55 mins to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          Severity
                          Category
                          Status
                          Source
                          Language