diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-09-14 11:14:28 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-09-13 23:14:28 -0400 |
commit | 83bb406138d344cce22c54ef3576516031c90ec6 (patch) | |
tree | 4a32104570b9a532e01ca8327906f3597ba0a7a9 /src | |
parent | 7b6be923e24481c2db75b3737a3ee07e7f3fb292 (diff) | |
download | cryptography-83bb406138d344cce22c54ef3576516031c90ec6.tar.gz cryptography-83bb406138d344cce22c54ef3576516031c90ec6.tar.bz2 cryptography-83bb406138d344cce22c54ef3576516031c90ec6.zip |
add __hash__ to PolicyConstraints and Extension (#3917)
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509/extensions.py | 8 |
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): |