Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Unified Diff: third_party/tlslite/tlslite/errors.py

Issue 210323002: Update tlslite to 0.4.6. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Executable bit and --similarity=80 Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/tlslite/tlslite/constants.py ('k') | third_party/tlslite/tlslite/fileobject.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/tlslite/tlslite/errors.py
diff --git a/third_party/tlslite/tlslite/errors.py b/third_party/tlslite/tlslite/errors.py
index 45087e6e0790d2ee54f63d1b22e98f7d3b008e05..001ef33e00b799e6d09309ba1c12b0d2a511d8af 100644
--- a/third_party/tlslite/tlslite/errors.py
+++ b/third_party/tlslite/tlslite/errors.py
@@ -1,13 +1,28 @@
+# Authors:
+# Trevor Perrin
+# Dave Baggett (Arcode Corporation) - Added TLSUnsupportedError.
+#
+# See the LICENSE file for legal information regarding use of this file.
+
"""Exception classes.
@sort: TLSError, TLSAbruptCloseError, TLSAlert, TLSLocalAlert, TLSRemoteAlert,
TLSAuthenticationError, TLSNoAuthenticationError, TLSAuthenticationTypeError,
-TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError
+TLSFingerprintError, TLSAuthorizationError, TLSValidationError, TLSFaultError,
+TLSUnsupportedError
"""
+import socket
-from constants import AlertDescription, AlertLevel
+from .constants import AlertDescription, AlertLevel
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 TLSClosedConnectionError(TLSError, socket.error):
+ """An attempt was made to use the connection after it was closed."""
pass
class TLSAbruptCloseError(TLSError):
@@ -51,8 +66,7 @@ class TLSAlert(TLSError):
AlertDescription.inappropriate_fallback: "inappropriate_fallback",\
AlertDescription.user_canceled: "user_canceled",\
AlertDescription.no_renegotiation: "no_renegotiation",\
- AlertDescription.unknown_srp_username: "unknown_srp_username",\
- AlertDescription.missing_srp_username: "missing_srp_username"}
+ AlertDescription.unknown_psk_identity: "unknown_psk_identity"}
class TLSLocalAlert(TLSAlert):
"""A TLS alert has been signalled by the local implementation.
@@ -138,7 +152,10 @@ class TLSAuthorizationError(TLSAuthenticationError):
class TLSValidationError(TLSAuthenticationError):
"""The Checker has determined that the other party's certificate
chain is invalid."""
- pass
+ def __init__(self, msg, info=None):
+ # Include a dict containing info about this validation failure
+ TLSAuthenticationError.__init__(self, msg)
+ self.info = info
class TLSFaultError(TLSError):
"""The other party responded incorrectly to an induced fault.
@@ -148,3 +165,9 @@ class TLSFaultError(TLSError):
faulty behavior, and the other party doesn't respond appropriately.
"""
pass
+
+
+class TLSUnsupportedError(TLSError):
+ """The implementation doesn't support the requested (or required)
+ capabilities."""
+ pass
« no previous file with comments | « third_party/tlslite/tlslite/constants.py ('k') | third_party/tlslite/tlslite/fileobject.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698