tlsfuzzer/tlslite-ng

View on GitHub
tlslite/tlsrecordlayer.py

Summary

Maintainability
F
2 wks
Test Coverage
C
76%

Showing 132 of 132 total issues

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 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

    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

    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

    TLSRecordLayer has 59 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class TLSRecordLayer(object):
    """
    This class handles data transmission for a TLS connection.
     
    Its only subclass is :py:class:`~tlslite.tlsconnection.TLSConnection`.
    Severity: Major
    Found in tlslite/tlsrecordlayer.py - About 1 day to fix

      Function _handle_srv_pha has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
      Open

      def _handle_srv_pha(self, cert):
      """Process the post-handshake authentication from client."""
      prf_name = 'sha256'
      prf_size = 32
      if self.session.cipherSuite in CipherSuite.sha384PrfSuites:
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 6 hrs to fix

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

      Function _decrefAsync has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
      Open

      def _decrefAsync(self):
      self._refCount -= 1
      if self._refCount == 0 and not self.closed:
      try:
      for result in self._sendMsg(Alert().create(\
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 4 hrs to fix

      Cyclomatic complexity is too high in method _handle_srv_pha. (25)
      Open

      def _handle_srv_pha(self, cert):
      """Process the post-handshake authentication from client."""
      prf_name = 'sha256'
      prf_size = 32
      if self.session.cipherSuite in CipherSuite.sha384PrfSuites:
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py by radon

      Function _getNextRecordFromSocket has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
      Open

      def _getNextRecordFromSocket(self):
      """Read a record, handle errors"""
       
      try:
      # otherwise... read the next record
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 3 hrs to fix

      Function _handle_pha has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      def _handle_pha(self, cert_request):
      cert, p_key = self._client_keypair
       
      handshake_context = self._first_handshake_hashes.copy()
      handshake_context.update(cert_request.write())
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 3 hrs to fix

      Function _getNextRecord has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
      Open

      def _getNextRecord(self):
      """read next message from socket, defragment message"""
       
      while True:
      # support for fragmentation
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 3 hrs to fix

      Cyclomatic complexity is too high in method _getNextRecordFromSocket. (18)
      Open

      def _getNextRecordFromSocket(self):
      """Read a record, handle errors"""
       
      try:
      # otherwise... read the next record
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py by radon

      Cyclomatic complexity is too high in method _handle_pha. (16)
      Open

      def _handle_pha(self, cert_request):
      cert, p_key = self._client_keypair
       
      handshake_context = self._first_handshake_hashes.copy()
      handshake_context.update(cert_request.write())
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py by radon

      Function _sendMsgThroughSocket has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
      Open

      def _sendMsgThroughSocket(self, msg):
      """Send message, handle errors"""
       
      try:
      for result in self._recordLayer.sendRecord(msg):
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 2 hrs to fix

      Cyclomatic complexity is too high in method _decrefAsync. (13)
      Open

      def _decrefAsync(self):
      self._refCount -= 1
      if self._refCount == 0 and not self.closed:
      try:
      for result in self._sendMsg(Alert().create(\
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py by radon

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

      Cyclomatic complexity is too high in method _getNextRecord. (12)
      Open

      def _getNextRecord(self):
      """read next message from socket, defragment message"""
       
      while True:
      # support for fragmentation
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py by radon

      Function __init__ has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      def __init__(self, sock):
      sock = BufferedSocket(sock)
      self.sock = sock
      self._recordLayer = RecordLayer(sock)
       
       
      Severity: Minor
      Found in tlslite/tlsrecordlayer.py - About 1 hr to fix

        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

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

        def _handle_keyupdate_request(self, request):
        """Process the KeyUpdate request.
         
        :type request: KeyUpdate
        :param request: Recieved KeyUpdate message.
        Severity: Minor
        Found in tlslite/tlsrecordlayer.py - About 55 mins to fix

        Function _create_cert_msg has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        def _create_cert_msg(self, peer, request_msg, valid_compression_algos,
        Severity: Major
        Found in tlslite/tlsrecordlayer.py - About 50 mins to fix

          Avoid deeply nested control flow statements.
          Open

          if subType == HandshakeType.client_hello:
          reneg = True
          # Send no_renegotiation if we're not negotiating
          # a connection now, then try again
          if reneg and self.session:
          Severity: Major
          Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

            for result in self._sendMsg(alertMsg):
            yield result
            continue
            Severity: Major
            Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

              Avoid deeply nested control flow statements.
              Open

              if not self.heartbeat_can_receive:
              for result in self._sendError(
              AlertDescription.
              unexpected_message,
              "Received heartbeat_request to "
              Severity: Major
              Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                if result in (0,1):
                yield result
                if result.contentType == ContentType.alert:
                Severity: Major
                Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                  if subType == HandshakeType.hello_request:
                  reneg = True
                  else:
                  Severity: Major
                  Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                    if len(heartbeat_message.padding) < 16:
                    # per RFC, silently ignore if the message
                    # is malformed
                    continue
                    heartbeat_response = heartbeat_message.\
                    Severity: Major
                    Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                      if alert.description == \
                      AlertDescription.close_notify:
                      self._shutdown(True)
                      elif alert.level == AlertLevel.warning:
                      self._shutdown(False)
                      Severity: Major
                      Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                        for result in self._sendMsg(alertMsg):
                        yield result
                        except socket.error:
                        Severity: Major
                        Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                          for result in self._sendMsg(
                          heartbeat_response):
                          yield result
                          # If we received heartbeat response, then we
                          # check, if its payload is same as payload of
                          Severity: Major
                          Found in tlslite/tlsrecordlayer.py - About 45 mins to fix

                            Function _calcPendingStates has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            def _calcPendingStates(self, cipherSuite, masterSecret,
                            Severity: Minor
                            Found in tlslite/tlsrecordlayer.py - About 35 mins to fix

                              Function makefile has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                              def makefile(self, mode='r', bufsize=-1):
                              """Create a file object for the TLS connection (socket emulation).
                               
                              :rtype: socket._fileobject
                              """
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py - About 25 mins to fix

                              TODO found
                              Open

                              # TODO: verify that the extensions used by client were sent by us in
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by fixme

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

                              while True:
                              # empty message buffer
                              ret = self._defragmenter.get_message()
                              if ret is None:
                              break
                              Severity: Major
                              Found in tlslite/tlsrecordlayer.py and 1 other location - About 3 hrs to fix
                              tlslite/messagesocket.py on lines 75..82

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

                              elif sig_scheme[1] == SignatureAlgorithm.ecdsa:
                              pad_type = None
                              hash_name = HashAlgorithm.toRepr(sig_scheme[0])
                              salt_len = None
                              sig_func = p_key.sign
                              Severity: Major
                              Found in tlslite/tlsrecordlayer.py and 2 other locations - About 1 hr to fix
                              tlslite/tlsconnection.py on lines 1579..1590
                              tlslite/tlsconnection.py on lines 3069..3080

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

                              if not ver_func(
                              cert_verify.signature, signature_context, pad_type,
                              hash_name, salt_len):
                              for result in self._sendError(
                              AlertDescription.decrypt_error,
                              Severity: Major
                              Found in tlslite/tlsrecordlayer.py and 2 other locations - About 45 mins to fix
                              tlslite/tlsconnection.py on lines 3208..3216
                              tlslite/tlsconnection.py on lines 4676..4684

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

                              self.session.cl_app_secret, self.session.sr_app_secret = self._recordLayer.\
                              calcTLS1_3KeyUpdate_sender(
                              self.session.cipherSuite,
                              self.session.cl_app_secret,
                              self.session.sr_app_secret)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py and 1 other location - About 45 mins to fix
                              tlslite/tlsrecordlayer.py on lines 1535..1539

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

                              self.session.cl_app_secret, self.session.sr_app_secret = \
                              self._recordLayer.calcTLS1_3KeyUpdate_reciever(
                              self.session.cipherSuite,
                              self.session.cl_app_secret,
                              self.session.sr_app_secret)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py and 1 other location - About 45 mins to fix
                              tlslite/tlsrecordlayer.py on lines 1502..1506

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

                              for result in self._getMsg(ContentType.handshake,
                              HandshakeType.certificate_verify):
                              if result in (0, 1):
                              yield result
                              Severity: Major
                              Found in tlslite/tlsrecordlayer.py and 9 other locations - About 40 mins to fix
                              tlslite/tlsconnection.py on lines 972..974
                              tlslite/tlsconnection.py on lines 1084..1087
                              tlslite/tlsconnection.py on lines 1335..1338
                              tlslite/tlsconnection.py on lines 1426..1429
                              tlslite/tlsconnection.py on lines 1836..1839
                              tlslite/tlsconnection.py on lines 3159..3162
                              tlslite/tlsconnection.py on lines 3335..3337
                              tlslite/tlsconnection.py on lines 4085..4088
                              tlslite/tlsconnection.py on lines 4599..4602

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

                              if not ver_func(signature, signature_context,
                              pad_type,
                              hash_name,
                              salt_len):
                              for result in self._sendError(
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py and 2 other locations - About 35 mins to fix
                              tlslite/tlsconnection.py on lines 1596..1603
                              tlslite/tlsconnection.py on lines 3086..3093

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

                              if comp_cert_ext and not comp_cert_ext.algorithms:
                              for result in self._sendError(
                              AlertDescription.decode_error,
                              "Empty algorithm list in compress_certificate "
                              "extension"):
                              Severity: Major
                              Found in tlslite/tlsrecordlayer.py and 6 other locations - About 30 mins to fix
                              tlslite/tlsconnection.py on lines 1346..1351
                              tlslite/tlsconnection.py on lines 1375..1380
                              tlslite/tlsconnection.py on lines 1828..1833
                              tlslite/tlsconnection.py on lines 2822..2826
                              tlslite/tlsconnection.py on lines 4222..4226
                              tlslite/tlsconnection.py on lines 4452..4457

                              Block comment should start with '# '
                              Open

                              #and pretend the connection was shut down properly? (writeable)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Indentation is not a multiple of 4 (comment)
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (80 > 79 characters)
                              Open

                              if request.message_type == KeyUpdateMessageType.update_not_requested or\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Handshake digests
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Is this a resumed session?
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Expected 1 blank line, found 0
                              Open

                              def read(self, max=None, min=1):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Comparison to none should be 'if cond is none:'
                              Open

                              if max == None:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (80 > 79 characters)
                              Open

                              unread the last data from a socket, that won't wake up selected waiters,
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If the sendMsg() call fails because the socket has
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If the socket is abruptly closed, do we ignore it
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #a close_notify, but ignore any socket errors, since
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #of the session.
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Convert secondaryType to tuple, if it isn't already
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendError(\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Update handshake hashes
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Expected 2 blank lines, found 1
                              Open

                              class TLSRecordLayer(object):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (87 > 79 characters)
                              Open

                              raise TLSClosedConnectionError("attempt to write to closed connection")
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Continuation line under-indented for visual indent
                              Open

                              ContentType.application_data)):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Fragment big messages
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Inline comment should start with '# '
                              Open

                              else: #Fatal alert:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Parse based on content_type
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If an exception was raised by a Parser or Message instance:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              At least two spaces before inline comment
                              Open

                              self.closed = True #read-only
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Inline comment should start with '# '
                              Open

                              self.resumed = False #read-only
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If we received an alert...
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #an attacker from launching a chosen-plaintext attack based on
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #expect. The loop will be repeated if:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #alert nor renegotiation
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendError(\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Returns next record or next handshake message
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._getMsg((ContentType.alert, \
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Indentation is not a multiple of 4 (comment)
                              Open

                              # Public Functions END
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Missing whitespace after ','
                              Open

                              self.version = (0,0)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Too many blank lines (2)
                              Open

                              def _sendError(self, alertDescription, errorStr=None):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #already been closed, we will be forgiving and not
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              AlertDescription.unexpected_message, \
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendMsg(applicationData, \
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (80 > 79 characters)
                              Open

                              # Don't invalidate the session on write failure if abrupt closes are
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Indentation is not a multiple of 4 (comment)
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If we received a renegotiation attempt...
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Otherwise: this is an unexpected record, but neither an
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Buffers for processing messages
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Spin in a loop, until we've got a non-empty record of a type we
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Continuation line over-indented for visual indent
                              Open

                              AlertDescription.close_notify:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #My session object (Session instance; read-only)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Is the connection open?
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Inline comment should start with '# '
                              Open

                              self._refCount = 0 #Used to trigger closure
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #On a call to close(), do we close the socket? (writeable)
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Fault we will induce, for testing purposes
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendMsg(Alert().create(\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #We either received a fatal error, a warning, or a
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #report the error nor invalidate the "resumability"
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If it's a handshake message, check handshake header
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              At least two spaces before inline comment
                              Open

                              self.resumed = False #read-only
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              At least two spaces before inline comment
                              Open

                              self._refCount = 0 #Used to trigger closure
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If the other side closes the socket, that's okay
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Missing whitespace after ','
                              Open

                              if result in (0,1):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Whenever we're connected and asked to send an app data message,
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #connection. In the latter two cases we respond with
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Parse based on handshake type
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #knowing the next IV (a la BEAST).
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Missing whitespace after ','
                              Open

                              if result in (0,1):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (88 > 79 characters)
                              Open

                              self.session.cl_app_secret, self.session.sr_app_secret = self._recordLayer.\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              At least two spaces before inline comment
                              Open

                              else: #Fatal alert:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Raise the alert as an exception
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendError(\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              for result in self._sendError(\
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Inline comment should start with '# '
                              Open

                              self.closed = True #read-only
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #What username did the client claim in his handshake?
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Do not use bare 'except'
                              Open

                              except:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Expected 1 blank line, found 0
                              Open

                              def _handle_pha(self, cert_request):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #close_notify. In any case, we're going to close the
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              The backslash is redundant between brackets
                              Open

                              yield ClientKeyExchange(constructorType, \
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Do not use bare 'except'
                              Open

                              except:
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (81 > 79 characters)
                              Open

                              ContentType.application_data)):
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Emulate a socket, somewhat -
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Update handshake hashes
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If we received an unexpected record type...
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #the other side might have already closed the socket.
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #If this is an empty application-data fragment, try again
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Too many blank lines (2)
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (80 > 79 characters)
                              Open

                              ver_func = cert.cert_chain.getEndEntityPublicKey().hashAndVerify
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #we first send the first byte of the message. This prevents
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Line too long (80 > 79 characters)
                              Open

                              raise TLSIllegalParameterException("KeyUpdate is a TLS 1.3 specific"
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Too many blank lines (2)
                              Open

                              #*********************************************************
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8

                              Block comment should start with '# '
                              Open

                              #Even if resumable is False, we'll never toggle this on
                              Severity: Minor
                              Found in tlslite/tlsrecordlayer.py by pep8
                              Category
                              Status