aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2014-12-18 13:46:51 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2014-12-18 13:46:51 -0600
commit60657bbd2907e5116fac176079a3da31b2c56d3c (patch)
treea8954344e2ede283fe6433e6b93b5773dfe2a09b /src
parent9cde70ae840685f2bae6173b6beb192ae3866dc3 (diff)
downloadcryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.tar.gz
cryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.tar.bz2
cryptography-60657bbd2907e5116fac176079a3da31b2c56d3c.zip
remove fully deprecated items from 0.6 deprecation cycle
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/backends/interfaces.py20
-rw-r--r--src/cryptography/hazmat/backends/multibackend.py63
-rw-r--r--src/cryptography/hazmat/backends/openssl/backend.py45
-rw-r--r--src/cryptography/hazmat/primitives/serialization.py26
-rw-r--r--src/cryptography/utils.py3
5 files changed, 5 insertions, 152 deletions
diff --git a/src/cryptography/hazmat/backends/interfaces.py b/src/cryptography/hazmat/backends/interfaces.py
index 8fc78309..4dc879ac 100644
--- a/src/cryptography/hazmat/backends/interfaces.py
+++ b/src/cryptography/hazmat/backends/interfaces.py
@@ -233,26 +233,6 @@ class PEMSerializationBackend(object):
@six.add_metaclass(abc.ABCMeta)
-class TraditionalOpenSSLSerializationBackend(object):
- @abc.abstractmethod
- def load_traditional_openssl_pem_private_key(self, data, password):
- """
- Load a private key from PEM encoded data, using password if the data
- is encrypted.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
-class PKCS8SerializationBackend(object):
- @abc.abstractmethod
- def load_pkcs8_pem_private_key(self, data, password):
- """
- Load a private key from PKCS8 encoded data, using password if the data
- is encrypted.
- """
-
-
-@six.add_metaclass(abc.ABCMeta)
class X509Backend(object):
@abc.abstractmethod
def load_pem_x509_certificate(self, data):
diff --git a/src/cryptography/hazmat/backends/multibackend.py b/src/cryptography/hazmat/backends/multibackend.py
index ffc569f4..27ee8e7f 100644
--- a/src/cryptography/hazmat/backends/multibackend.py
+++ b/src/cryptography/hazmat/backends/multibackend.py
@@ -4,15 +4,12 @@
from __future__ import absolute_import, division, print_function
-import warnings
-
from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm, _Reasons
from cryptography.hazmat.backends.interfaces import (
CMACBackend, CipherBackend, DSABackend, EllipticCurveBackend, HMACBackend,
HashBackend, PBKDF2HMACBackend, PEMSerializationBackend,
- PKCS8SerializationBackend, RSABackend,
- TraditionalOpenSSLSerializationBackend, X509Backend
+ RSABackend, X509Backend
)
@@ -21,9 +18,7 @@ from cryptography.hazmat.backends.interfaces import (
@utils.register_interface(HashBackend)
@utils.register_interface(HMACBackend)
@utils.register_interface(PBKDF2HMACBackend)
-@utils.register_interface(PKCS8SerializationBackend)
@utils.register_interface(RSABackend)
-@utils.register_interface(TraditionalOpenSSLSerializationBackend)
@utils.register_interface(DSABackend)
@utils.register_interface(EllipticCurveBackend)
@utils.register_interface(PEMSerializationBackend)
@@ -251,24 +246,6 @@ class MultiBackend(object):
_Reasons.UNSUPPORTED_ELLIPTIC_CURVE
)
- def elliptic_curve_private_key_from_numbers(self, numbers):
- warnings.warn(
- "elliptic_curve_private_key_from_numbers is deprecated and will "
- "be removed in a future version.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- for b in self._filtered_backends(EllipticCurveBackend):
- try:
- return b.elliptic_curve_private_key_from_numbers(numbers)
- except UnsupportedAlgorithm:
- continue
-
- raise UnsupportedAlgorithm(
- "This backend does not support this elliptic curve.",
- _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
- )
-
def load_elliptic_curve_private_numbers(self, numbers):
for b in self._filtered_backends(EllipticCurveBackend):
try:
@@ -281,24 +258,6 @@ class MultiBackend(object):
_Reasons.UNSUPPORTED_ELLIPTIC_CURVE
)
- def elliptic_curve_public_key_from_numbers(self, numbers):
- warnings.warn(
- "elliptic_curve_public_key_from_numbers is deprecated and will "
- "be removed in a future version.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- for b in self._filtered_backends(EllipticCurveBackend):
- try:
- return b.elliptic_curve_public_key_from_numbers(numbers)
- except UnsupportedAlgorithm:
- continue
-
- raise UnsupportedAlgorithm(
- "This backend does not support this elliptic curve.",
- _Reasons.UNSUPPORTED_ELLIPTIC_CURVE
- )
-
def load_elliptic_curve_public_numbers(self, numbers):
for b in self._filtered_backends(EllipticCurveBackend):
try:
@@ -329,26 +288,6 @@ class MultiBackend(object):
_Reasons.UNSUPPORTED_SERIALIZATION
)
- def load_pkcs8_pem_private_key(self, data, password):
- for b in self._filtered_backends(PKCS8SerializationBackend):
- return b.load_pkcs8_pem_private_key(data, password)
-
- raise UnsupportedAlgorithm(
- "This backend does not support this key serialization.",
- _Reasons.UNSUPPORTED_SERIALIZATION
- )
-
- def load_traditional_openssl_pem_private_key(self, data, password):
- for b in self._filtered_backends(
- TraditionalOpenSSLSerializationBackend
- ):
- return b.load_traditional_openssl_pem_private_key(data, password)
-
- raise UnsupportedAlgorithm(
- "This backend does not support this key serialization.",
- _Reasons.UNSUPPORTED_SERIALIZATION
- )
-
def load_pem_x509_certificate(self, data):
for b in self._filtered_backends(
X509Backend
diff --git a/src/cryptography/hazmat/backends/openssl/backend.py b/src/cryptography/hazmat/backends/openssl/backend.py
index daccf5ca..34efdce9 100644
--- a/src/cryptography/hazmat/backends/openssl/backend.py
+++ b/src/cryptography/hazmat/backends/openssl/backend.py
@@ -6,7 +6,6 @@ from __future__ import absolute_import, division, print_function
import collections
import itertools
-import warnings
from contextlib import contextmanager
import six
@@ -17,9 +16,8 @@ from cryptography.exceptions import (
)
from cryptography.hazmat.backends.interfaces import (
CMACBackend, CipherBackend, DSABackend, EllipticCurveBackend, HMACBackend,
- HashBackend, PBKDF2HMACBackend, PEMSerializationBackend,
- PKCS8SerializationBackend, RSABackend,
- TraditionalOpenSSLSerializationBackend, X509Backend
+ HashBackend, PBKDF2HMACBackend, PEMSerializationBackend, RSABackend,
+ X509Backend
)
from cryptography.hazmat.backends.openssl.ciphers import (
_AESCTRCipherContext, _CipherContext
@@ -63,9 +61,7 @@ _OpenSSLError = collections.namedtuple("_OpenSSLError",
@utils.register_interface(HashBackend)
@utils.register_interface(HMACBackend)
@utils.register_interface(PBKDF2HMACBackend)
-@utils.register_interface(PKCS8SerializationBackend)
@utils.register_interface(RSABackend)
-@utils.register_interface(TraditionalOpenSSLSerializationBackend)
@utils.register_interface(PEMSerializationBackend)
@utils.register_interface(X509Backend)
class Backend(object):
@@ -721,25 +717,6 @@ class Backend(object):
x509 = self._ffi.gc(x509, self._lib.X509_free)
return _Certificate(self, x509)
- def load_traditional_openssl_pem_private_key(self, data, password):
- warnings.warn(
- "load_traditional_openssl_pem_private_key is deprecated and will "
- "be removed in a future version, use load_pem_private_key "
- "instead.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- return self.load_pem_private_key(data, password)
-
- def load_pkcs8_pem_private_key(self, data, password):
- warnings.warn(
- "load_pkcs8_pem_private_key is deprecated and will be removed in a"
- " future version, use load_pem_private_key instead.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- return self.load_pem_private_key(data, password)
-
def _load_key(self, openssl_read_func, convert_func, data, password):
mem_bio = self._bytes_to_bio(data)
@@ -903,15 +880,6 @@ class Backend(object):
_Reasons.UNSUPPORTED_ELLIPTIC_CURVE
)
- def elliptic_curve_private_key_from_numbers(self, numbers):
- warnings.warn(
- "elliptic_curve_private_key_from_numbers is deprecated and will "
- "be removed in a future version.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- return self.load_elliptic_curve_private_numbers(numbers)
-
def load_elliptic_curve_private_numbers(self, numbers):
public = numbers.public_numbers
@@ -930,15 +898,6 @@ class Backend(object):
return _EllipticCurvePrivateKey(self, ec_cdata)
- def elliptic_curve_public_key_from_numbers(self, numbers):
- warnings.warn(
- "elliptic_curve_public_key_from_numbers is deprecated and will be "
- "removed in a future version.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
- return self.load_elliptic_curve_public_numbers(numbers)
-
def load_elliptic_curve_public_numbers(self, numbers):
curve_nid = self._elliptic_curve_to_nid(numbers.curve)
diff --git a/src/cryptography/hazmat/primitives/serialization.py b/src/cryptography/hazmat/primitives/serialization.py
index f080ea86..083f17e5 100644
--- a/src/cryptography/hazmat/primitives/serialization.py
+++ b/src/cryptography/hazmat/primitives/serialization.py
@@ -6,9 +6,7 @@ from __future__ import absolute_import, division, print_function
import base64
import struct
-import warnings
-from cryptography import utils
from cryptography.exceptions import UnsupportedAlgorithm
from cryptography.hazmat.primitives.asymmetric.dsa import (
DSAParameterNumbers, DSAPublicNumbers
@@ -16,30 +14,6 @@ from cryptography.hazmat.primitives.asymmetric.dsa import (
from cryptography.hazmat.primitives.asymmetric.rsa import RSAPublicNumbers
-def load_pem_traditional_openssl_private_key(data, password, backend):
- warnings.warn(
- "load_pem_traditional_openssl_private_key is deprecated and will be "
- "removed in a future version, use load_pem_private_key instead.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
-
- return backend.load_traditional_openssl_pem_private_key(
- data, password
- )
-
-
-def load_pem_pkcs8_private_key(data, password, backend):
- warnings.warn(
- "load_pem_pkcs8_private_key is deprecated and will be removed in a "
- "future version, use load_pem_private_key instead.",
- utils.DeprecatedIn06,
- stacklevel=2
- )
-
- return backend.load_pkcs8_pem_private_key(data, password)
-
-
def load_pem_private_key(data, password, backend):
return backend.load_pem_private_key(data, password)
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index 78f73464..ac2f787d 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -9,7 +9,8 @@ import inspect
import sys
-DeprecatedIn06 = DeprecationWarning
+# DeprecatedIn07 objects exist. This comment exists to remind developers to
+# look for them when it's time for the ninth release cycle deprecation dance.
def register_interface(iface):