From 81233de59df126c8b21f359661f3204924c9d67b Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Sat, 4 May 2019 13:34:29 -0400 Subject: 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 --- tests/x509/test_x509_ext.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'tests') 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 -- cgit v1.2.3