# Path: tlslite/constants.py
# class AlertDescription:
#     """
#     @cvar bad_record_mac: A TLS record failed to decrypt properly.
# 
#     If this occurs during a SRP handshake it most likely
#     indicates a bad password.  It may also indicate an implementation
#     error, or some tampering with the data in transit.
# 
#     This alert will be signalled by the server if the SRP password is bad.  It
#     may also be signalled by the server if the SRP username is unknown to the
#     server, but it doesn't wish to reveal that fact.
# 
# 
#     @cvar handshake_failure: A problem occurred while handshaking.
# 
#     This typically indicates a lack of common ciphersuites between client and
#     server, or some other disagreement (about SRP parameters or key sizes,
#     for example).
# 
#     @cvar protocol_version: The other party's SSL/TLS version was unacceptable.
# 
#     This indicates that the client and server couldn't agree on which version
#     of SSL or TLS to use.
# 
#     @cvar user_canceled: The handshake is being cancelled for some reason.
# 
#     """
# 
#     close_notify = 0
#     unexpected_message = 10
#     bad_record_mac = 20
#     decryption_failed = 21
#     record_overflow = 22
#     decompression_failure = 30
#     handshake_failure = 40
#     no_certificate = 41 #SSLv3
#     bad_certificate = 42
#     unsupported_certificate = 43
#     certificate_revoked = 44
#     certificate_expired = 45
#     certificate_unknown = 46
#     illegal_parameter = 47
#     unknown_ca = 48
#     access_denied = 49
#     decode_error = 50
#     decrypt_error = 51
#     export_restriction = 60
#     protocol_version = 70
#     insufficient_security = 71
#     internal_error = 80
#     user_canceled = 90
#     no_renegotiation = 100
#     unknown_psk_identity = 115
# 
# class AlertLevel:
#     warning = 1
#     fatal = 2


from .constants import AlertDescription, AlertLevel
"""Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError,
TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError
"""


class TLSError(Exception):
    """Base class for all TLS Lite exceptions."""
    
    def __str__(self):
        """"At least print out the Exception time for str(...)."""
        return repr(self)    

class TLSAbruptCloseError(TLSError):
    """The socket was closed without a proper TLS shutdown.

    The TLS specification mandates that an alert of some sort
    must be sent before the underlying socket is closed.  If the socket
    is closed without this, it could signify that an attacker is trying
    to truncate the connection.  It could also signify a misbehaving
    TLS implementation, or a random network failure.
    """
    pass

class TLSAlert(TLSError):
    """A TLS alert has been signalled."""
    pass

    _descriptionStr = {\

# Path: tlslite/constants.py
# class AlertDescription:
#     """
#     @cvar bad_record_mac: A TLS record failed to decrypt properly.
# 
#     If this occurs during a SRP handshake it most likely
#     indicates a bad password.  It may also indicate an implementation
#     error, or some tampering with the data in transit.
# 
#     This alert will be signalled by the server if the SRP password is bad.  It
#     may also be signalled by the server if the SRP username is unknown to the
#     server, but it doesn't wish to reveal that fact.
# 
# 
#     @cvar handshake_failure: A problem occurred while handshaking.
# 
#     This typically indicates a lack of common ciphersuites between client and
#     server, or some other disagreement (about SRP parameters or key sizes,
#     for example).
# 
#     @cvar protocol_version: The other party's SSL/TLS version was unacceptable.
# 
#     This indicates that the client and server couldn't agree on which version
#     of SSL or TLS to use.
# 
#     @cvar user_canceled: The handshake is being cancelled for some reason.
# 
#     """
# 
#     close_notify = 0
#     unexpected_message = 10
#     bad_record_mac = 20
#     decryption_failed = 21
#     record_overflow = 22
#     decompression_failure = 30
#     handshake_failure = 40
#     no_certificate = 41 #SSLv3
#     bad_certificate = 42
#     unsupported_certificate = 43
#     certificate_revoked = 44
#     certificate_expired = 45
#     certificate_unknown = 46
#     illegal_parameter = 47
#     unknown_ca = 48
#     access_denied = 49
#     decode_error = 50
#     decrypt_error = 51
#     export_restriction = 60
#     protocol_version = 70
#     insufficient_security = 71
#     internal_error = 80
#     user_canceled = 90
#     no_renegotiation = 100
#     unknown_psk_identity = 115
# 
# class AlertLevel:
#     warning = 1
#     fatal = 2


# Path: tlslite/errors.py
from .constants import AlertDescription, AlertLevel

"""Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError,
TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError
"""


class TLSError(Exception):
    """Base class for all TLS Lite exceptions."""
    
    def __str__(self):
        """"At least print out the Exception time for str(...)."""
        return repr(self)    

class TLSAbruptCloseError(TLSError):
    """The socket was closed without a proper TLS shutdown.

    The TLS specification mandates that an alert of some sort
    must be sent before the underlying socket is closed.  If the socket
    is closed without this, it could signify that an attacker is trying
    to truncate the connection.  It could also signify a misbehaving
    TLS implementation, or a random network failure.
    """
    pass

class TLSAlert(TLSError):
    """A TLS alert has been signalled."""
    pass

    _descriptionStr = {\

        AlertDescription.close_notify: "close_notify",\