tomato42/tlslite-ng

View on GitHub

Showing 1,716 of 1,734 total issues

Function _serverGetClientHello has a Cognitive Complexity of 601 (exceeds 5 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 wk to fix

File tlsconnection.py has 4030 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Authors:
# Trevor Perrin
# Google - added reqCAs parameter
# Google (adapted by Sam Rushing and Marcelo Fernandez) - NPN support
# Google - FALLBACK_SCSV
Severity: Major
Found in tlslite/tlsconnection.py - About 1 wk to fix

    File messages.py has 2125 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Authors:
    # Trevor Perrin
    # Google - handling CertificateRequest.certificate_types
    # Google (adapted by Sam Rushing and Marcelo Fernandez) - NPN support
    # Dimitris Moraitis - Anon ciphersuites
    Severity: Major
    Found in tlslite/messages.py - About 5 days to fix

      Cyclomatic complexity is too high in method _serverGetClientHello. (269)
      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 by radon

      File extensions.py has 1694 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      # Copyright (c) 2014, 2015 Hubert Kario
      #
      # See the LICENSE file for legal information regarding use of this file.
       
      """ Helper package for handling TLS extensions encountered in ClientHello
      Severity: Major
      Found in tlslite/extensions.py - About 4 days to fix

        Function _getMsg has a Cognitive Complexity of 182 (exceeds 5 allowed). Consider refactoring.
        Open

        def _getMsg(self, expectedType, secondaryType=None, constructorType=None):
        try:
        if not isinstance(expectedType, tuple):
        expectedType = (expectedType,)
         
         
        Severity: Minor
        Found in tlslite/tlsrecordlayer.py - About 3 days to fix

        File constants.py has 1358 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        # Authors:
        # Trevor Perrin
        # Google - defining ClientCertificateType
        # Google (adapted by Sam Rushing) - NPN support
        # Dimitris Moraitis - Anon ciphersuites
        Severity: Major
        Found in tlslite/constants.py - About 3 days to fix

          Function _serverTLS13Handshake has a Cognitive Complexity of 151 (exceeds 5 allowed). Consider refactoring.
          Open

          def _serverTLS13Handshake(self, settings, clientHello, cipherSuite,
          privateKey, serverCertChain, version, scheme,
          srv_alpns, reqCert):
          """Perform a TLS 1.3 handshake"""
          prf_name, prf_size = self._getPRFParams(cipherSuite)
          Severity: Minor
          Found in tlslite/tlsconnection.py - About 3 days to fix

          File tlsrecordlayer.py has 1163 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          # Authors:
          # Trevor Perrin
          # Google (adapted by Sam Rushing) - NPN support
          # Google - minimal padding
          # Martin von Loewis - python 3 port
          Severity: Major
          Found in tlslite/tlsrecordlayer.py - About 2 days to fix

            Function _clientTLS13Handshake has a Cognitive Complexity of 143 (exceeds 5 allowed). Consider refactoring.
            Open

            def _clientTLS13Handshake(self, settings, session, clientHello,
            clientCertChain, privateKey, serverHello):
            """Perform TLS 1.3 handshake as a client."""
            prfName, prf_size = self._getPRFParams(serverHello.cipher_suite)
             
             
            Severity: Minor
            Found in tlslite/tlsconnection.py - About 2 days to fix

            Function _clientGetServerHello has a Cognitive Complexity of 141 (exceeds 5 allowed). Consider refactoring.
            Open

            def _clientGetServerHello(self, settings, session, clientHello):
            client_hello_hash = self._handshake_hash.copy()
            for result in self._getMsg(ContentType.handshake,
            HandshakeType.server_hello):
            if result in (0,1): yield result
            Severity: Minor
            Found in tlslite/tlsconnection.py - About 2 days to fix

            Function _handshakeServerAsyncHelper has a Cognitive Complexity of 132 (exceeds 5 allowed). Consider refactoring.
            Open

            def _handshakeServerAsyncHelper(self, verifierDB,
            cert_chain, privateKey, reqCert,
            sessionCache, settings, reqCAs, tacks,
            activationFlags, nextProtos, anon, alpn,
            sni):
            Severity: Minor
            Found in tlslite/tlsconnection.py - About 2 days to fix

            File keyexchange.py has 1053 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            # Authors:
            # Hubert Kario (2015)
            #
            # See the LICENSE file for legal information regarding use of this file.
            """Handling of cryptographic operations for key exchange"""
            Severity: Major
            Found in tlslite/keyexchange.py - About 2 days to fix

              File recordlayer.py has 1047 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              # Copyright (c) 2014, Hubert Kario
              #
              # See the LICENSE file for legal information regarding use of this file.
               
              """Implementation of the TLS Record Layer protocol"""
              Severity: Major
              Found in tlslite/recordlayer.py - About 2 days to fix

                File rijndael.py has 1029 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                # Authors:
                # Bram Cohen
                # Trevor Perrin - various changes
                #
                # See the LICENSE file for legal information regarding use of this file.
                Severity: Major
                Found in tlslite/utils/rijndael.py - About 2 days to fix

                  Function _serverCertKeyExchange has a Cognitive Complexity of 122 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _serverCertKeyExchange(self, clientHello, serverHello, sigHashAlg,
                  serverCertChain, keyExchange,
                  reqCert, reqCAs, cipherSuite,
                  settings):
                  #Send ServerHello, Certificate or Compressed Certificate
                  Severity: Minor
                  Found in tlslite/tlsconnection.py - About 2 days to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  for i in range(BC):
                  tt = Ke[ROUNDS][i]
                  result.append((S[(t[ i ] >> 24) & 0xFF] ^ (tt>>24)) & 0xFF)
                  result.append((S[(t[(i+s1) % BC] >> 16) & 0xFF] ^ (tt>>16)) & 0xFF)
                  result.append((S[(t[(i+s2) % BC] >> 8) & 0xFF] ^ (tt>> 8)) & 0xFF)
                  Severity: Major
                  Found in tlslite/utils/rijndael.py and 1 other location - About 2 days to fix
                  tlslite/utils/rijndael.py on lines 1077..1082

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                  for i in range(BC):
                  tt = Kd[ROUNDS][i]
                  result.append((Si[(t[ i ] >> 24) & 0xFF] ^ (tt>>24)) &0xFF)
                  result.append((Si[(t[(i+s1) % BC] >> 16) & 0xFF] ^ (tt>>16)) &0xFF)
                  result.append((Si[(t[(i+s2) % BC] >> 8) & 0xFF] ^ (tt>> 8)) &0xFF)
                  Severity: Major
                  Found in tlslite/utils/rijndael.py and 1 other location - About 2 days to fix
                  tlslite/utils/rijndael.py on lines 1032..1037

                  Cyclomatic complexity is too high in method _handshakeServerAsyncHelper. (109)
                  Open

                  def _handshakeServerAsyncHelper(self, verifierDB,
                  cert_chain, privateKey, reqCert,
                  sessionCache, settings, reqCAs, tacks,
                  activationFlags, nextProtos, anon, alpn,
                  sni):
                  Severity: Minor
                  Found in tlslite/tlsconnection.py by radon

                  Function _clientKeyExchange has a Cognitive Complexity of 107 (exceeds 5 allowed). Consider refactoring.
                  Open

                  def _clientKeyExchange(self, settings, cipherSuite,
                  clientCertChain, privateKey,
                  certificateType,
                  tackExt, clientRandom, serverRandom,
                  keyExchange):
                  Severity: Minor
                  Found in tlslite/tlsconnection.py - About 2 days to fix
                  Severity
                  Category
                  Status
                  Source
                  Language