tlsfuzzer/tlslite-ng

View on GitHub

Showing 324 of 1,708 total issues

Function _serverCertKeyExchange has 9 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def _serverCertKeyExchange(self, clientHello, serverHello, sigHashAlg,
Severity: Major
Found in tlslite/tlsconnection.py - About 1 hr to fix

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

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

      Function _serverTLS13Handshake has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          def _serverTLS13Handshake(self, settings, clientHello, cipherSuite,
      Severity: Major
      Found in tlslite/tlsconnection.py - About 1 hr to fix

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

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

          Function _handshakeClientAsyncHelper has 9 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              def _handshakeClientAsyncHelper(self, srpParams, certParams, anonParams,
          Severity: Major
          Found in tlslite/tlsconnection.py - About 1 hr to fix

            Function _serverFinished has 9 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                def _serverFinished(self, premasterSecret, clientRandom, serverRandom,
            Severity: Major
            Found in tlslite/tlsconnection.py - About 1 hr to fix

              Function __string_to_bitlist has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __string_to_bitlist(self, data):
                      """Turn the string data into a list of bits (1, 0)'s."""
              
                      if PY_VER < (3, ):
                          # Turn the strings into integers. Python 3 uses a bytes
              Severity: Minor
              Found in tlslite/utils/python_tripledes.py - About 1 hr 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 write has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                      def write(self, password=None):
                          bio = m2.bio_new(m2.bio_s_mem())
                          if self._hasPrivateKey:
                              if password:
                                  def f(v): return password
              Severity: Minor
              Found in tlslite/utils/openssl_rsakey.py - About 1 hr 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 _sendMsg has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _sendMsg(self, msg, randomizeFirstBlock=True, update_hashes=True):
                      """Fragment and send message through socket"""
                      #Whenever we're connected and asked to send an app data message,
                      #we first send the first byte of the message.  This prevents
                      #an attacker from launching a chosen-plaintext attack based on
              Severity: Minor
              Found in tlslite/tlsrecordlayer.py - About 1 hr 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 transformDictionaryWord has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def transformDictionaryWord(dst, idx, word, length, transform):
                      prefix = kTransforms[transform].prefix
                      suffix = kTransforms[transform].suffix
                      t = kTransforms[transform].transform
                      skip = t < (0 if kOmitFirst1 else (t - (kOmitFirst1 - 1)))
              Severity: Minor
              Found in tlslite/utils/brotlidecpy/transform.py - About 1 hr 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 __getattr__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                      def __getattr__(self, name):
                          if name == 'e':
                              if not self.rsa:
                                  return 0
                              return mpiToNumber(m2.rsa_get_e(self.rsa))
              Severity: Minor
              Found in tlslite/utils/openssl_rsakey.py - About 1 hr 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 int_to_bytes has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def int_to_bytes(val, length=None, byteorder="big"):
                      """Return number converted to bytes"""
                      if length is None:
                          if val:
                              length = byte_length(val)
              Severity: Minor
              Found in tlslite/utils/compat.py - About 1 hr 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 __init__ has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def __init__(self, x, y, curve_name, secret_multiplier=None):
                      if not curve_name:
                          raise ValueError("curve_name must be specified")
                      self.curve_name = curve_name
              
              
              Severity: Minor
              Found in tlslite/utils/python_ecdsakey.py - About 1 hr 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 addVarSeq has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                      def addVarSeq(self, seq, length, lengthLength):
                          """
                          Add a bounded list of same-sized values
              
                          Create a list of specific length with all items being of the same
              Severity: Minor
              Found in tlslite/utils/codec.py - About 1 hr 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 _decryptSSL2 has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _decryptSSL2(self, data, padding):
                      """Decrypt SSL2 encrypted data"""
                      # sequence numbers are incremented for plaintext records too
                      seqnumBytes = self._readState.getSeqNumBytes()
              
              
              Severity: Minor
              Found in tlslite/recordlayer.py - About 1 hr 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 recv has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def recv(self):
                      """
                      Read a single record from socket, handle SSLv2 and SSLv3 record layer
              
                      :rtype: generator
              Severity: Minor
              Found in tlslite/recordlayer.py - About 1 hr 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 filter_for_certificate has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def filter_for_certificate(suites, cert_chain):
                      """Return a copy of suites without ciphers incompatible with the cert.
                      """
                      includeSuites = set([])
                      includeSuites.update(CipherSuite.tls13Suites)
              Severity: Minor
              Found in tlslite/constants.py - About 1 hr 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 _decryptStreamThenMAC has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _decryptStreamThenMAC(self, recordType, data):
                      """Decrypt a stream cipher and check MAC"""
                      if self._readState.encContext:
                          assert self.version in ((3, 0), (3, 1), (3, 2), (3, 3))
              
              
              Severity: Minor
              Found in tlslite/recordlayer.py - About 1 hr 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 calcPendingStates has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def calcPendingStates(self, cipherSuite, masterSecret, clientRandom,
                                        serverRandom, implementations):
                      """Create pending states for encryption and decryption."""
                      keyLength, ivLength, createCipherFunc = \
                              self._getCipherSettings(cipherSuite)
              Severity: Minor
              Found in tlslite/recordlayer.py - About 1 hr 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 _sanityCheckECDHSettings has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def _sanityCheckECDHSettings(other):
                      """Check ECDHE settings if they are sane."""
                      not_matching = HandshakeSettings._not_matching
              
                      unknownCurve = not_matching(other.eccCurves, ALL_CURVE_NAMES)
              Severity: Minor
              Found in tlslite/handshakesettings.py - About 1 hr 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