aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-13 23:38:51 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-05-13 23:38:51 -0500
commit290cd601538c1b5b73ee25b9218abe71b94d2c99 (patch)
tree44ac4c35758c9bd3fc9e1ce9e656ac178510705e
parentd9bb53472c4e49a85e2db03da1eb64bf66b50b28 (diff)
downloadcryptography-290cd601538c1b5b73ee25b9218abe71b94d2c99.tar.gz
cryptography-290cd601538c1b5b73ee25b9218abe71b94d2c99.tar.bz2
cryptography-290cd601538c1b5b73ee25b9218abe71b94d2c99.zip
deprecation dance.
fixes #1950
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/dsa.py22
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/ec.py22
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/rsa.py22
-rw-r--r--src/cryptography/hazmat/primitives/interfaces/__init__.py351
-rw-r--r--src/cryptography/utils.py3
5 files changed, 1 insertions, 419 deletions
diff --git a/src/cryptography/hazmat/primitives/asymmetric/dsa.py b/src/cryptography/hazmat/primitives/asymmetric/dsa.py
index 4d332f2a..733a967c 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/dsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/dsa.py
@@ -71,17 +71,6 @@ class DSAPrivateKeyWithSerialization(DSAPrivateKey):
"""
-DSAPrivateKeyWithNumbers = utils.deprecated(
- DSAPrivateKeyWithSerialization,
- __name__,
- (
- "The DSAPrivateKeyWithNumbers interface has been renamed to "
- "DSAPrivateKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
@six.add_metaclass(abc.ABCMeta)
class DSAPublicKey(object):
@abc.abstractproperty
@@ -118,17 +107,6 @@ class DSAPublicKeyWithSerialization(DSAPublicKey):
"""
-DSAPublicKeyWithNumbers = utils.deprecated(
- DSAPublicKeyWithSerialization,
- __name__,
- (
- "The DSAPublicKeyWithNumbers interface has been renamed to "
- "DSAPublicKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
def generate_parameters(key_size, backend):
return backend.generate_dsa_parameters(key_size)
diff --git a/src/cryptography/hazmat/primitives/asymmetric/ec.py b/src/cryptography/hazmat/primitives/asymmetric/ec.py
index 96809c10..631fcbf7 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/ec.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/ec.py
@@ -71,17 +71,6 @@ class EllipticCurvePrivateKeyWithSerialization(EllipticCurvePrivateKey):
"""
-EllipticCurvePrivateKeyWithNumbers = utils.deprecated(
- EllipticCurvePrivateKeyWithSerialization,
- __name__,
- (
- "The EllipticCurvePrivateKeyWithNumbers interface has been renamed to "
- "EllipticCurvePrivateKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
@six.add_metaclass(abc.ABCMeta)
class EllipticCurvePublicKey(object):
@abc.abstractmethod
@@ -112,17 +101,6 @@ class EllipticCurvePublicKeyWithSerialization(EllipticCurvePublicKey):
"""
-EllipticCurvePublicKeyWithNumbers = utils.deprecated(
- EllipticCurvePublicKeyWithSerialization,
- __name__,
- (
- "The EllipticCurvePublicKeyWithNumbers interface has been renamed to "
- "EllipticCurvePublicKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
@utils.register_interface(EllipticCurve)
class SECT571R1(object):
name = "sect571r1"
diff --git a/src/cryptography/hazmat/primitives/asymmetric/rsa.py b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
index ae00184f..772473fd 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/rsa.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/rsa.py
@@ -56,17 +56,6 @@ class RSAPrivateKeyWithSerialization(RSAPrivateKey):
"""
-RSAPrivateKeyWithNumbers = utils.deprecated(
- RSAPrivateKeyWithSerialization,
- __name__,
- (
- "The RSAPrivateKeyWithNumbers interface has been renamed to "
- "RSAPrivateKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
@six.add_metaclass(abc.ABCMeta)
class RSAPublicKey(object):
@abc.abstractmethod
@@ -103,17 +92,6 @@ class RSAPublicKeyWithSerialization(RSAPublicKey):
"""
-RSAPublicKeyWithNumbers = utils.deprecated(
- RSAPublicKeyWithSerialization,
- __name__,
- (
- "The RSAPublicKeyWithNumbers interface has been renamed to "
- "RSAPublicKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-
def generate_private_key(public_exponent, key_size, backend):
if not isinstance(backend, RSABackend):
raise UnsupportedAlgorithm(
diff --git a/src/cryptography/hazmat/primitives/interfaces/__init__.py b/src/cryptography/hazmat/primitives/interfaces/__init__.py
index c980e5a5..4c95190b 100644
--- a/src/cryptography/hazmat/primitives/interfaces/__init__.py
+++ b/src/cryptography/hazmat/primitives/interfaces/__init__.py
@@ -8,357 +8,6 @@ import abc
import six
-from cryptography import utils
-from cryptography.hazmat.primitives import ciphers, hashes
-from cryptography.hazmat.primitives.asymmetric import (
- AsymmetricSignatureContext, AsymmetricVerificationContext, dsa, ec,
- padding, rsa
-)
-from cryptography.hazmat.primitives.ciphers import modes
-from cryptography.hazmat.primitives.kdf import KeyDerivationFunction
-from cryptography.hazmat.primitives.padding import PaddingContext
-
-
-BlockCipherAlgorithm = utils.deprecated(
- ciphers.BlockCipherAlgorithm,
- __name__,
- (
- "The BlockCipherAlgorithm interface has moved to the "
- "cryptography.hazmat.primitives.ciphers module"
- ),
- utils.DeprecatedIn08
-)
-
-
-CipherAlgorithm = utils.deprecated(
- ciphers.CipherAlgorithm,
- __name__,
- (
- "The CipherAlgorithm interface has moved to the "
- "cryptography.hazmat.primitives.ciphers module"
- ),
- utils.DeprecatedIn08
-)
-
-
-Mode = utils.deprecated(
- modes.Mode,
- __name__,
- (
- "The Mode interface has moved to the "
- "cryptography.hazmat.primitives.ciphers.modes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-ModeWithAuthenticationTag = utils.deprecated(
- modes.ModeWithAuthenticationTag,
- __name__,
- (
- "The ModeWithAuthenticationTag interface has moved to the "
- "cryptography.hazmat.primitives.ciphers.modes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-ModeWithInitializationVector = utils.deprecated(
- modes.ModeWithInitializationVector,
- __name__,
- (
- "The ModeWithInitializationVector interface has moved to the "
- "cryptography.hazmat.primitives.ciphers.modes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-ModeWithNonce = utils.deprecated(
- modes.ModeWithNonce,
- __name__,
- (
- "The ModeWithNonce interface has moved to the "
- "cryptography.hazmat.primitives.ciphers.modes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-CipherContext = utils.deprecated(
- ciphers.CipherContext,
- __name__,
- (
- "The CipherContext interface has moved to the "
- "cryptography.hazmat.primitives.ciphers module"
- ),
- utils.DeprecatedIn08
-)
-
-
-AEADCipherContext = utils.deprecated(
- ciphers.AEADCipherContext,
- __name__,
- (
- "The AEADCipherContext interface has moved to the "
- "cryptography.hazmat.primitives.ciphers module"
- ),
- utils.DeprecatedIn08
-)
-
-
-AEADEncryptionContext = utils.deprecated(
- ciphers.AEADEncryptionContext,
- __name__,
- (
- "The AEADEncryptionContext interface has moved to the "
- "cryptography.hazmat.primitives.ciphers module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurve = utils.deprecated(
- ec.EllipticCurve,
- __name__,
- (
- "The EllipticCurve interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurvePrivateKey = utils.deprecated(
- ec.EllipticCurvePrivateKey,
- __name__,
- (
- "The EllipticCurvePrivateKey interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurvePrivateKeyWithNumbers = utils.deprecated(
- ec.EllipticCurvePrivateKeyWithSerialization,
- __name__,
- (
- "The EllipticCurvePrivateKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurvePublicKey = utils.deprecated(
- ec.EllipticCurvePublicKey,
- __name__,
- (
- "The EllipticCurvePublicKey interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurvePublicKeyWithNumbers = utils.deprecated(
- ec.EllipticCurvePublicKeyWithSerialization,
- __name__,
- (
- "The EllipticCurvePublicKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-EllipticCurveSignatureAlgorithm = utils.deprecated(
- ec.EllipticCurveSignatureAlgorithm,
- __name__,
- (
- "The EllipticCurveSignatureAlgorithm interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.ec module"
- ),
- utils.DeprecatedIn08
-)
-
-
-DSAParameters = utils.deprecated(
- dsa.DSAParameters,
- __name__,
- (
- "The DSAParameters interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-DSAParametersWithNumbers = utils.deprecated(
- dsa.DSAParametersWithNumbers,
- __name__,
- (
- "The DSAParametersWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-DSAPrivateKey = utils.deprecated(
- dsa.DSAPrivateKey,
- __name__,
- (
- "The DSAPrivateKey interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-DSAPrivateKeyWithNumbers = utils.deprecated(
- dsa.DSAPrivateKeyWithSerialization,
- __name__,
- (
- "The DSAPrivateKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-DSAPublicKey = utils.deprecated(
- dsa.DSAPublicKey,
- __name__,
- (
- "The DSAPublicKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-DSAPublicKeyWithNumbers = utils.deprecated(
- dsa.DSAPublicKeyWithSerialization,
- __name__,
- (
- "The DSAPublicKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.dsa.module"
- ),
- utils.DeprecatedIn08
-)
-
-
-PaddingContext = utils.deprecated(
- PaddingContext,
- __name__,
- (
- "The PaddingContext interface has moved to the "
- "cryptography.hazmat.primitives.padding module"
- ),
- utils.DeprecatedIn08
-)
-
-
-HashContext = utils.deprecated(
- hashes.HashContext,
- __name__,
- (
- "The HashContext interface has moved to the "
- "cryptography.hazmat.primitives.hashes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-HashAlgorithm = utils.deprecated(
- hashes.HashAlgorithm,
- __name__,
- (
- "The HashAlgorithm interface has moved to the "
- "cryptography.hazmat.primitives.hashes module"
- ),
- utils.DeprecatedIn08
-)
-
-
-RSAPrivateKey = utils.deprecated(
- rsa.RSAPrivateKey,
- __name__,
- (
- "The RSAPrivateKey interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.rsa module"
- ),
- utils.DeprecatedIn08
-)
-
-RSAPrivateKeyWithNumbers = utils.deprecated(
- rsa.RSAPrivateKeyWithSerialization,
- __name__,
- (
- "The RSAPrivateKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.rsa module and has been "
- "renamed RSAPrivateKeyWithSerialization"
- ),
- utils.DeprecatedIn08
-)
-
-RSAPublicKey = utils.deprecated(
- rsa.RSAPublicKey,
- __name__,
- (
- "The RSAPublicKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.rsa module"
- ),
- utils.DeprecatedIn08
-)
-
-RSAPublicKeyWithNumbers = utils.deprecated(
- rsa.RSAPublicKeyWithSerialization,
- __name__,
- (
- "The RSAPublicKeyWithNumbers interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.rsa module"
- ),
- utils.DeprecatedIn08
-)
-
-AsymmetricPadding = utils.deprecated(
- padding.AsymmetricPadding,
- __name__,
- (
- "The AsymmetricPadding interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric.padding module"
- ),
- utils.DeprecatedIn08
-)
-
-AsymmetricSignatureContext = utils.deprecated(
- AsymmetricSignatureContext,
- __name__,
- (
- "The AsymmetricPadding interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric module"
- ),
- utils.DeprecatedIn08
-)
-
-AsymmetricVerificationContext = utils.deprecated(
- AsymmetricVerificationContext,
- __name__,
- (
- "The AsymmetricVerificationContext interface has moved to the "
- "cryptography.hazmat.primitives.asymmetric module"
- ),
- utils.DeprecatedIn08
-)
-
-KeyDerivationFunction = utils.deprecated(
- KeyDerivationFunction,
- __name__,
- (
- "The KeyDerivationFunction interface has moved to the "
- "cryptography.hazmat.primitives.kdf module"
- ),
- utils.DeprecatedIn08
-)
-
@six.add_metaclass(abc.ABCMeta)
class MACContext(object):
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 445554ec..0bf8c0ea 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -10,8 +10,7 @@ import sys
import warnings
-DeprecatedIn08 = DeprecationWarning
-DeprecatedIn09 = PendingDeprecationWarning
+DeprecatedIn09 = DeprecationWarning
def read_only_property(name):