From 0d6aaf49c1890378ce7ecf741a3a40c859d3b9fb Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Thu, 20 Jul 2017 13:04:25 +0200 Subject: remove deprecated items (#3794) * remove deprecated items whirlpool, ripemd160, unsupportedextension, and the old interfaces * flake8 and remove a test generator we no longe use * make it clear we warned you about these things --- src/cryptography/hazmat/primitives/hashes.py | 30 ------------------------ src/cryptography/hazmat/primitives/interfaces.py | 17 -------------- src/cryptography/x509/__init__.py | 11 +-------- src/cryptography/x509/extensions.py | 4 ---- 4 files changed, 1 insertion(+), 61 deletions(-) delete mode 100644 src/cryptography/hazmat/primitives/interfaces.py (limited to 'src') diff --git a/src/cryptography/hazmat/primitives/hashes.py b/src/cryptography/hazmat/primitives/hashes.py index e1172d9d..1764e9ce 100644 --- a/src/cryptography/hazmat/primitives/hashes.py +++ b/src/cryptography/hazmat/primitives/hashes.py @@ -142,36 +142,6 @@ class SHA512(object): block_size = 128 -@utils.register_interface(HashAlgorithm) -class RIPEMD160(object): - name = "ripemd160" - digest_size = 20 - block_size = 64 - - -RIPEMD160 = utils.deprecated( - RIPEMD160, - __name__, - "The RIPEMD160 hash was deprecated in version 1.9.", - utils.DeprecatedIn19 -) - - -@utils.register_interface(HashAlgorithm) -class Whirlpool(object): - name = "whirlpool" - digest_size = 64 - block_size = 64 - - -Whirlpool = utils.deprecated( - Whirlpool, - __name__, - "The Whirlpool hash was deprecated in version 1.9.", - utils.DeprecatedIn19 -) - - @utils.register_interface(HashAlgorithm) class MD5(object): name = "md5" diff --git a/src/cryptography/hazmat/primitives/interfaces.py b/src/cryptography/hazmat/primitives/interfaces.py deleted file mode 100644 index c9fdb3bf..00000000 --- a/src/cryptography/hazmat/primitives/interfaces.py +++ /dev/null @@ -1,17 +0,0 @@ -# This file is dual licensed under the terms of the Apache License, Version -# 2.0, and the BSD License. See the LICENSE file in the root of this repository -# for complete details. - -from __future__ import absolute_import, division, print_function - -from cryptography import utils -from cryptography.hazmat.primitives.mac import MACContext as _MACContext - - -MACContext = utils.deprecated( - _MACContext, - __name__, - "MACContext was moved to cryptography.hazmat.primitives.mac.MACContext " - "in version 1.9.", - utils.DeprecatedIn19 -) diff --git a/src/cryptography/x509/__init__.py b/src/cryptography/x509/__init__.py index b1a32ef6..3b747302 100644 --- a/src/cryptography/x509/__init__.py +++ b/src/cryptography/x509/__init__.py @@ -4,7 +4,6 @@ from __future__ import absolute_import, division, print_function -from cryptography import utils from cryptography.x509 import certificate_transparency from cryptography.x509.base import ( Certificate, CertificateBuilder, CertificateRevocationList, @@ -25,7 +24,7 @@ from cryptography.x509.extensions import ( NameConstraints, NoticeReference, OCSPNoCheck, PolicyConstraints, PolicyInformation, PrecertificateSignedCertificateTimestamps, ReasonFlags, SubjectAlternativeName, SubjectKeyIdentifier, UnrecognizedExtension, - UnsupportedExtension, UserNotice + UserNotice ) from cryptography.x509.general_name import ( DNSName, DirectoryName, GeneralName, IPAddress, OtherName, RFC822Name, @@ -110,13 +109,6 @@ OID_INVALIDITY_DATE = CRLEntryExtensionOID.INVALIDITY_DATE OID_CA_ISSUERS = AuthorityInformationAccessOID.CA_ISSUERS OID_OCSP = AuthorityInformationAccessOID.OCSP -UnsupportedExtension = utils.deprecated( - UnsupportedExtension, - __name__, - "UnsupportedExtension is no longer necessary, it is never raised", - utils.DeprecatedIn19 -) - __all__ = [ "certificate_transparency", "load_pem_x509_certificate", @@ -128,7 +120,6 @@ __all__ = [ "random_serial_number", "InvalidVersion", "DuplicateExtension", - "UnsupportedExtension", "ExtensionNotFound", "UnsupportedGeneralNameType", "NameAttribute", diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 1b64f4a5..d90465b2 100644 --- a/src/cryptography/x509/extensions.py +++ b/src/cryptography/x509/extensions.py @@ -54,10 +54,6 @@ class DuplicateExtension(Exception): self.oid = oid -class UnsupportedExtension(Exception): - pass - - class ExtensionNotFound(Exception): def __init__(self, msg, oid): super(ExtensionNotFound, self).__init__(msg) -- cgit v1.2.3