aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/x509
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-09-14 11:14:28 +0800
committerAlex Gaynor <alex.gaynor@gmail.com>2017-09-13 23:14:28 -0400
commit83bb406138d344cce22c54ef3576516031c90ec6 (patch)
tree4a32104570b9a532e01ca8327906f3597ba0a7a9 /src/cryptography/x509
parent7b6be923e24481c2db75b3737a3ee07e7f3fb292 (diff)
downloadcryptography-83bb406138d344cce22c54ef3576516031c90ec6.tar.gz
cryptography-83bb406138d344cce22c54ef3576516031c90ec6.tar.bz2
cryptography-83bb406138d344cce22c54ef3576516031c90ec6.zip
add __hash__ to PolicyConstraints and Extension (#3917)
Diffstat (limited to 'src/cryptography/x509')
-rw-r--r--src/cryptography/x509/extensions.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py
index f6957b9d..0bfe6f92 100644
--- a/src/cryptography/x509/extensions.py
+++ b/src/cryptography/x509/extensions.py
@@ -554,6 +554,11 @@ class PolicyConstraints(object):
def __ne__(self, other):
return not self == other
+ def __hash__(self):
+ return hash(
+ (self.require_explicit_policy, self.inhibit_policy_mapping)
+ )
+
require_explicit_policy = utils.read_only_property(
"_require_explicit_policy"
)
@@ -1063,6 +1068,9 @@ class Extension(object):
def __ne__(self, other):
return not self == other
+ def __hash__(self):
+ return hash((self.oid, self.critical, self.value))
+
class GeneralNames(object):
def __init__(self, general_names):