Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed deprecated Type aliases #814

Merged
merged 5 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ The third digit is only for regressions.
Backward-incompatible changes:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

*none*

- Removed deprecated ``ContextType``, ``ConnectionType``, ``PKeyType``, ``X509NameType``, ``X509ReqType``, ``X509Type``, ``X509StoreType``, ``CRLType``, ``PKCS7Type``, ``PKCS12Type``, and ``NetscapeSPKIType`` aliases.
Use the classes without the ``Type`` suffix instead.
`#814 <https://github.com/pyca/pyopenssl/pull/814>`_

Deprecations:
^^^^^^^^^^^^^
Expand Down
14 changes: 0 additions & 14 deletions src/OpenSSL/SSL.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from weakref import WeakValueDictionary
from errno import errorcode

from cryptography.utils import deprecated

from six import (
binary_type as _binary_type, integer_types as integer_types, int2byte,
indexbytes)
Expand Down Expand Up @@ -1528,12 +1526,6 @@ def set_ocsp_client_callback(self, callback, data=None):
self._set_ocsp_callback(helper, data)


ContextType = deprecated(
Context, __name__,
"ContextType has been deprecated, use Context instead", DeprecationWarning
)


class Connection(object):
"""
"""
Expand Down Expand Up @@ -2496,12 +2488,6 @@ def request_ocsp(self):
_openssl_assert(rc == 1)


ConnectionType = deprecated(
Connection, __name__,
"ConnectionType has been deprecated, use Connection instead",
DeprecationWarning
)

# This is similar to the initialization calls at the end of OpenSSL/crypto.py
# but is exercised mostly by the Context initializer.
_lib.SSL_library_init()
71 changes: 0 additions & 71 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

from cryptography import x509
from cryptography.hazmat.primitives.asymmetric import dsa, rsa
from cryptography.utils import deprecated

from OpenSSL._util import (
ffi as _ffi,
Expand Down Expand Up @@ -367,13 +366,6 @@ def bits(self):
return _lib.EVP_PKEY_bits(self._pkey)


PKeyType = deprecated(
PKey, __name__,
"PKeyType has been deprecated, use PKey instead",
DeprecationWarning
)


class _EllipticCurve(object):
"""
A representation of a supported elliptic curve.
Expand Down Expand Up @@ -706,13 +698,6 @@ def get_components(self):
return result


X509NameType = deprecated(
X509Name, __name__,
"X509NameType has been deprecated, use X509Name instead",
DeprecationWarning
)


class X509Extension(object):
"""
An X.509 v3 certificate extension.
Expand Down Expand Up @@ -864,13 +849,6 @@ def get_data(self):
return _ffi.buffer(char_result, result_length)[:]


X509ExtensionType = deprecated(
X509Extension, __name__,
"X509ExtensionType has been deprecated, use X509Extension instead",
DeprecationWarning
)


class X509Req(object):
"""
An X.509 certificate signing requests.
Expand Down Expand Up @@ -1070,13 +1048,6 @@ def verify(self, pkey):
return result


X509ReqType = deprecated(
X509Req, __name__,
"X509ReqType has been deprecated, use X509Req instead",
DeprecationWarning
)


class X509(object):
"""
An X.509 certificate.
Expand Down Expand Up @@ -1543,13 +1514,6 @@ def get_extension(self, index):
return ext


X509Type = deprecated(
X509, __name__,
"X509Type has been deprecated, use X509 instead",
DeprecationWarning
)


class X509StoreFlags(object):
"""
Flags for X509 verification, used to change the behavior of
Expand Down Expand Up @@ -1684,13 +1648,6 @@ def set_time(self, vfy_time):
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)


X509StoreType = deprecated(
X509Store, __name__,
"X509StoreType has been deprecated, use X509Store instead",
DeprecationWarning
)


class X509StoreContextError(Exception):
"""
An exception raised when an error occurred while verifying a certificate
Expand Down Expand Up @@ -2338,13 +2295,6 @@ def export(self, cert, key, type=FILETYPE_PEM, days=100,
return dump_crl(type, self)


CRLType = deprecated(
CRL, __name__,
"CRLType has been deprecated, use CRL instead",
DeprecationWarning
)


class PKCS7(object):
def type_is_signed(self):
"""
Expand Down Expand Up @@ -2389,13 +2339,6 @@ def get_type_name(self):
return _ffi.string(string_type)


PKCS7Type = deprecated(
PKCS7, __name__,
"PKCS7Type has been deprecated, use PKCS7 instead",
DeprecationWarning
)


class PKCS12(object):
"""
A PKCS #12 archive.
Expand Down Expand Up @@ -2570,13 +2513,6 @@ def export(self, passphrase=None, iter=2048, maciter=1):
return _bio_to_string(bio)


PKCS12Type = deprecated(
PKCS12, __name__,
"PKCS12Type has been deprecated, use PKCS12 instead",
DeprecationWarning
)


class NetscapeSPKI(object):
"""
A Netscape SPKI object.
Expand Down Expand Up @@ -2667,13 +2603,6 @@ def set_pubkey(self, pkey):
_openssl_assert(set_result == 1)


NetscapeSPKIType = deprecated(
NetscapeSPKI, __name__,
"NetscapeSPKIType has been deprecated, use NetscapeSPKI instead",
DeprecationWarning
)


class _PassphraseHelper(object):
def __init__(self, type, passphrase, more_args=False, truncate=False):
if type != FILETYPE_PEM and passphrase is not None:
Expand Down
Loading