diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-26 15:01:25 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-26 15:01:25 -0500 |
commit | 410fe35dab3eb60fbcc5791e5ef24584ab45c324 (patch) | |
tree | 0eb7eaf9624e0832d1fc5ab77e25b541ca577e4f /tests/test_x509_ext.py | |
parent | f9a77b6886ac8942645a24b8cb65479fcfd23d09 (diff) | |
download | cryptography-410fe35dab3eb60fbcc5791e5ef24584ab45c324.tar.gz cryptography-410fe35dab3eb60fbcc5791e5ef24584ab45c324.tar.bz2 cryptography-410fe35dab3eb60fbcc5791e5ef24584ab45c324.zip |
Refs #2578 -- implement __hash__ on SubjectKeyIdentifier
Diffstat (limited to 'tests/test_x509_ext.py')
-rw-r--r-- | tests/test_x509_ext.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_x509_ext.py b/tests/test_x509_ext.py index 49a3433c..0f5d7823 100644 --- a/tests/test_x509_ext.py +++ b/tests/test_x509_ext.py @@ -656,6 +656,20 @@ class TestSubjectKeyIdentifier(object): assert ski != ski2 assert ski != object() + def test_hash(self): + ski1 = x509.SubjectKeyIdentifier( + binascii.unhexlify(b"092384932230498bc980aa8098456f6ff7ff3ac9") + ) + ski2 = x509.SubjectKeyIdentifier( + binascii.unhexlify(b"092384932230498bc980aa8098456f6ff7ff3ac9") + ) + ski3 = x509.SubjectKeyIdentifier( + binascii.unhexlify(b"aa8098456f6ff7ff3ac9092384932230498bc980") + ) + + assert hash(ski1) == hash(ski2) + assert hash(ski1) != hash(ski3) + class TestAuthorityKeyIdentifier(object): def test_authority_cert_issuer_not_generalname(self): |