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
- Read upRead up
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
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
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
- Read upRead up
- Exclude checks
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
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,)
- Read upRead up
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
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)
- Read upRead up
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
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)
- Read upRead up
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
- Read upRead up
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):
- Read upRead up
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"""
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"""
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.
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
- Read upRead up
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)
- Read upRead up
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)
- Read upRead up
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):
- Read upRead up
- Exclude checks
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):
- Read upRead up