tomato42/tlslite-ng

View on GitHub

Showing 1,716 of 1,734 total issues

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

Function brotli_decompress_buffer has a Cognitive Complexity of 100 (exceeds 5 allowed). Consider refactoring.
Open

def brotli_decompress_buffer(input_buffer, buffer_limit=None):
br = BrotliBitReader(input_buffer)
output_buffer = bytearray([])
pos = 0
input_end = 0
Severity: Minor
Found in tlslite/utils/brotlidecpy/decode.py - About 2 days to fix

File mathtls.py has 834 lines of code (exceeds 250 allowed). Consider refactoring.
Open

# Authors:
# Trevor Perrin
# Dave Baggett (Arcode Corporation) - MD5 support for MAC_SSL
# Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
# Hubert Kario - SHA384 PRF
Severity: Major
Found in tlslite/mathtls.py - About 2 days to fix

    Function _handshakeClientAsyncHelper has a Cognitive Complexity of 99 (exceeds 5 allowed). Consider refactoring.
    Open

    def _handshakeClientAsyncHelper(self, srpParams, certParams, anonParams,
    session, settings, serverName, nextProtos,
    reqTack, alpn):
     
    self._handshakeStart(client=True)
    Severity: Minor
    Found in tlslite/tlsconnection.py - About 1 day to fix

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

    for r in range(1, ROUNDS):
    for i in range(BC):
    a[i] = (T5[(t[ i ] >> 24) & 0xFF] ^
    T6[(t[(i + s1) % BC] >> 16) & 0xFF] ^
    T7[(t[(i + s2) % BC] >> 8) & 0xFF] ^
    Severity: Major
    Found in tlslite/utils/rijndael.py and 1 other location - About 1 day to fix
    tlslite/utils/rijndael.py on lines 1023..1029

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

    for r in range(1, ROUNDS):
    for i in range(BC):
    a[i] = (T1[(t[ i ] >> 24) & 0xFF] ^
    T2[(t[(i + s1) % BC] >> 16) & 0xFF] ^
    T3[(t[(i + s2) % BC] >> 8) & 0xFF] ^
    Severity: Major
    Found in tlslite/utils/rijndael.py and 1 other location - About 1 day to fix
    tlslite/utils/rijndael.py on lines 1068..1074

    Function _sigHashesToList has a Cognitive Complexity of 87 (exceeds 5 allowed). Consider refactoring.
    Open

    def _sigHashesToList(settings, privateKey=None, certList=None,
    version=(3, 3)):
    """Convert list of valid signature hashes to array of tuples"""
    certType = None
    publicKey = None
    Severity: Minor
    Found in tlslite/tlsconnection.py - About 1 day to fix

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

    Cyclomatic complexity is too high in method _getMsg. (81)
    Open

    def _getMsg(self, expectedType, secondaryType=None, constructorType=None):
    try:
    if not isinstance(expectedType, tuple):
    expectedType = (expectedType,)
     
     
    Severity: Minor
    Found in tlslite/tlsrecordlayer.py by radon

    Cyclomatic complexity is too high in method _handshakeClientAsyncHelper. (81)
    Open

    def _handshakeClientAsyncHelper(self, srpParams, certParams, anonParams,
    session, settings, serverName, nextProtos,
    reqTack, alpn):
     
    self._handshakeStart(client=True)
    Severity: Minor
    Found in tlslite/tlsconnection.py by radon

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

    File handshakesettings.py has 694 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    # Authors:
    # Trevor Perrin
    # Dave Baggett (Arcode Corporation) - cleanup handling of constants
    # Yngve Pettersen (ported by Paul Sokolovsky) - TLS 1.2
    #
    Severity: Major
    Found in tlslite/handshakesettings.py - About 1 day to fix

      Cyclomatic complexity is too high in method _clientSendClientHello. (75)
      Open

      def _clientSendClientHello(self, settings, session, srpUsername,
      srpParams, certParams, anonParams,
      serverName, nextProtos, reqTack, alpn):
      #Initialize acceptable ciphersuites
      cipherSuites = [CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
      Severity: Minor
      Found in tlslite/tlsconnection.py by radon

      Function _clientSendClientHello has a Cognitive Complexity of 76 (exceeds 5 allowed). Consider refactoring.
      Open

      def _clientSendClientHello(self, settings, session, srpUsername,
      srpParams, certParams, anonParams,
      serverName, nextProtos, reqTack, alpn):
      #Initialize acceptable ciphersuites
      cipherSuites = [CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV]
      Severity: Minor
      Found in tlslite/tlsconnection.py - About 1 day to fix

      Function _server_select_certificate has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
      Open

      def _server_select_certificate(self, settings, client_hello,
      cipher_suites, cert_chain,
      private_key, version):
      """
      This method makes the decision on which certificate/key pair,
      Severity: Minor
      Found in tlslite/tlsconnection.py - About 1 day to fix

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

      Severity: Major
      Found in tlslite/utils/pycrypto_aes.py and 1 other location - About 1 day to fix
      tlslite/utils/pycrypto_tripledes.py on lines 0..29

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

      Severity: Major
      Found in tlslite/utils/pycrypto_tripledes.py and 1 other location - About 1 day to fix
      tlslite/utils/pycrypto_aes.py on lines 0..29

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

      Function readAsync has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
      Open

      def readAsync(self, max=None, min=1):
      """Start a read operation on the TLS connection.
       
      This function returns a generator which behaves similarly to
      read(). Successive invocations of the generator will return 0
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 1 day to fix

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

      def _copy_extension_settings(self, other):
      """Copy values of settings related to extensions."""
      other.useExtendedMasterSecret = self.useExtendedMasterSecret
      other.requireExtendedMasterSecret = self.requireExtendedMasterSecret
      other.useExperimentalTackExtension = self.useExperimentalTackExtension
      Severity: Major
      Found in tlslite/handshakesettings.py and 1 other location - About 1 day to fix
      tlslite/handshakesettings.py on lines 800..818
      Severity
      Category
      Status
      Source
      Language