diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509/extensions.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 7a03139f..442000e3 100644 --- a/src/cryptography/x509/extensions.py +++ b/src/cryptography/x509/extensions.py @@ -412,6 +412,9 @@ class CRLDistributionPoints(object): def __getitem__(self, idx): return self._distribution_points[idx] + def __hash__(self): + return hash(tuple(self._distribution_points)) + class DistributionPoint(object): def __init__(self, full_name, relative_name, reasons, crl_issuer): @@ -487,6 +490,19 @@ class DistributionPoint(object): def __ne__(self, other): return not self == other + def __hash__(self): + if self.full_name is not None: + fn = tuple(self.full_name) + else: + fn = None + + if self.crl_issuer is not None: + crl_issuer = tuple(self.crl_issuer) + else: + crl_issuer = None + + return hash((fn, self.relative_name, self.reasons, crl_issuer)) + full_name = utils.read_only_property("_full_name") relative_name = utils.read_only_property("_relative_name") reasons = utils.read_only_property("_reasons") |