diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2017-09-14 01:55:31 +0800 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2017-09-13 13:55:31 -0400 |
commit | 54024493bd50ea6f27aa094dce2d0ddac43221f0 (patch) | |
tree | 2cb83e82fc20a7884ef9219233762d1cad467231 /tests/x509 | |
parent | 89aaecb518ced08d8e244583e75a8c3fb600758e (diff) | |
download | cryptography-54024493bd50ea6f27aa094dce2d0ddac43221f0.tar.gz cryptography-54024493bd50ea6f27aa094dce2d0ddac43221f0.tar.bz2 cryptography-54024493bd50ea6f27aa094dce2d0ddac43221f0.zip |
AIA hashing (#3911)
Diffstat (limited to 'tests/x509')
-rw-r--r-- | tests/x509/test_x509_ext.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/x509/test_x509_ext.py b/tests/x509/test_x509_ext.py index 929a9380..808b3681 100644 --- a/tests/x509/test_x509_ext.py +++ b/tests/x509/test_x509_ext.py @@ -2749,6 +2749,40 @@ class TestAuthorityInformationAccess(object): assert aia[-1] == aia[4] assert aia[2:6:2] == [aia[2], aia[4]] + def test_hash(self): + aia = x509.AuthorityInformationAccess([ + x509.AccessDescription( + AuthorityInformationAccessOID.OCSP, + x509.UniformResourceIdentifier(b"http://ocsp.domain.com") + ), + x509.AccessDescription( + AuthorityInformationAccessOID.CA_ISSUERS, + x509.UniformResourceIdentifier(b"http://domain.com/ca.crt") + ) + ]) + aia2 = x509.AuthorityInformationAccess([ + x509.AccessDescription( + AuthorityInformationAccessOID.OCSP, + x509.UniformResourceIdentifier(b"http://ocsp.domain.com") + ), + x509.AccessDescription( + AuthorityInformationAccessOID.CA_ISSUERS, + x509.UniformResourceIdentifier(b"http://domain.com/ca.crt") + ) + ]) + aia3 = x509.AuthorityInformationAccess([ + x509.AccessDescription( + AuthorityInformationAccessOID.OCSP, + x509.UniformResourceIdentifier(b"http://ocsp.other.com") + ), + x509.AccessDescription( + AuthorityInformationAccessOID.CA_ISSUERS, + x509.UniformResourceIdentifier(b"http://domain.com/ca.crt") + ) + ]) + assert hash(aia) == hash(aia2) + assert hash(aia) != hash(aia3) + @pytest.mark.requires_backend_interface(interface=RSABackend) @pytest.mark.requires_backend_interface(interface=X509Backend) |