Skip to content

Commit

Permalink
Define a TLSException that other more specific exceptions inherit from
Browse files Browse the repository at this point in the history
  • Loading branch information
ashfall committed Dec 3, 2016
1 parent 3e1758a commit 17a3280
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions tls/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
from __future__ import absolute_import, division, print_function


class UnsupportedCipherException(Exception):
class TLSException(Exception):
"""
This is the root exception from which all other exceptions inherit.
Lower-level parsing code raises very specific exceptions that higher-level
code can catch with this exception.
"""


class UnsupportedCipherException(TLSException):
pass


class UnsupportedExtensionException(Exception):
class UnsupportedExtensionException(TLSException):
pass


class InvalidPaddingException(Exception):
# XXX: Is leaking this info in CertificateURL (i.e. revealing the specific
# byte that is invalid) a good idea? Need to check -- could be a
# vulnerability in disguise.
class InvalidPaddingException(TLSException):
pass

0 comments on commit 17a3280

Please sign in to comment.