aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2019-05-04 13:34:29 -0400
committerAlex Gaynor <alex.gaynor@gmail.com>2019-05-04 13:34:29 -0400
commit81233de59df126c8b21f359661f3204924c9d67b (patch)
treee4c8a0a801ecf2996aaee186eb5c12504208641c /tests
parentb5e34e499042a0dce3d60da89169b006fb5cae26 (diff)
downloadcryptography-81233de59df126c8b21f359661f3204924c9d67b.tar.gz
cryptography-81233de59df126c8b21f359661f3204924c9d67b.tar.bz2
cryptography-81233de59df126c8b21f359661f3204924c9d67b.zip
fix from_issuer_subject_key_identifier to take the right type (#4864)
* fix from_issuer_subject_key_identifier to take the right type deprecate passing the old Extension wrapper object * don't use a try:except: * hilarious contortions to satisfy doc8
Diffstat (limited to 'tests')
-rw-r--r--tests/x509/test_x509_ext.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/x509/test_x509_ext.py b/tests/x509/test_x509_ext.py
index ec618d9a..654bd13b 100644
--- a/tests/x509/test_x509_ext.py
+++ b/tests/x509/test_x509_ext.py
@@ -3196,11 +3196,18 @@ class TestAuthorityKeyIdentifierExtension(object):
ext = cert.extensions.get_extension_for_oid(
ExtensionOID.AUTHORITY_KEY_IDENTIFIER
)
- ski = issuer_cert.extensions.get_extension_for_class(
+ ski_ext = issuer_cert.extensions.get_extension_for_class(
x509.SubjectKeyIdentifier
)
+ # This was the incorrect arg we want to deprecate and remove
+ with pytest.warns(utils.CryptographyDeprecationWarning):
+ aki = x509.AuthorityKeyIdentifier.\
+ from_issuer_subject_key_identifier(ski_ext)
+ assert ext.value == aki
+
+ # Here's what we actually documented and want to do
aki = x509.AuthorityKeyIdentifier.from_issuer_subject_key_identifier(
- ski
+ ski_ext.value
)
assert ext.value == aki