Skip to content

Commit 01f90a1

Browse files
alexhynek
authored andcommitted
Removed deprecated Type aliases (#814)
* Removed deprecated Type aliases * typo * typo * missed this somehow * Line wrap
1 parent 2d2ea9d commit 01f90a1

File tree

5 files changed

+35
-150
lines changed

5 files changed

+35
-150
lines changed

CHANGELOG.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@ The third digit is only for regressions.
1111
Backward-incompatible changes:
1212
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1313

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

1718
Deprecations:
1819
^^^^^^^^^^^^^

src/OpenSSL/SSL.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
from weakref import WeakValueDictionary
77
from errno import errorcode
88

9-
from cryptography.utils import deprecated
10-
119
from six import (
1210
binary_type as _binary_type, integer_types as integer_types, int2byte,
1311
indexbytes)
@@ -1528,12 +1526,6 @@ def set_ocsp_client_callback(self, callback, data=None):
15281526
self._set_ocsp_callback(helper, data)
15291527

15301528

1531-
ContextType = deprecated(
1532-
Context, __name__,
1533-
"ContextType has been deprecated, use Context instead", DeprecationWarning
1534-
)
1535-
1536-
15371529
class Connection(object):
15381530
"""
15391531
"""
@@ -2496,12 +2488,6 @@ def request_ocsp(self):
24962488
_openssl_assert(rc == 1)
24972489

24982490

2499-
ConnectionType = deprecated(
2500-
Connection, __name__,
2501-
"ConnectionType has been deprecated, use Connection instead",
2502-
DeprecationWarning
2503-
)
2504-
25052491
# This is similar to the initialization calls at the end of OpenSSL/crypto.py
25062492
# but is exercised mostly by the Context initializer.
25072493
_lib.SSL_library_init()

src/OpenSSL/crypto.py

Lines changed: 0 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
from cryptography import x509
1313
from cryptography.hazmat.primitives.asymmetric import dsa, rsa
14-
from cryptography.utils import deprecated
1514

1615
from OpenSSL._util import (
1716
ffi as _ffi,
@@ -367,13 +366,6 @@ def bits(self):
367366
return _lib.EVP_PKEY_bits(self._pkey)
368367

369368

370-
PKeyType = deprecated(
371-
PKey, __name__,
372-
"PKeyType has been deprecated, use PKey instead",
373-
DeprecationWarning
374-
)
375-
376-
377369
class _EllipticCurve(object):
378370
"""
379371
A representation of a supported elliptic curve.
@@ -706,13 +698,6 @@ def get_components(self):
706698
return result
707699

708700

709-
X509NameType = deprecated(
710-
X509Name, __name__,
711-
"X509NameType has been deprecated, use X509Name instead",
712-
DeprecationWarning
713-
)
714-
715-
716701
class X509Extension(object):
717702
"""
718703
An X.509 v3 certificate extension.
@@ -864,13 +849,6 @@ def get_data(self):
864849
return _ffi.buffer(char_result, result_length)[:]
865850

866851

867-
X509ExtensionType = deprecated(
868-
X509Extension, __name__,
869-
"X509ExtensionType has been deprecated, use X509Extension instead",
870-
DeprecationWarning
871-
)
872-
873-
874852
class X509Req(object):
875853
"""
876854
An X.509 certificate signing requests.
@@ -1070,13 +1048,6 @@ def verify(self, pkey):
10701048
return result
10711049

10721050

1073-
X509ReqType = deprecated(
1074-
X509Req, __name__,
1075-
"X509ReqType has been deprecated, use X509Req instead",
1076-
DeprecationWarning
1077-
)
1078-
1079-
10801051
class X509(object):
10811052
"""
10821053
An X.509 certificate.
@@ -1543,13 +1514,6 @@ def get_extension(self, index):
15431514
return ext
15441515

15451516

1546-
X509Type = deprecated(
1547-
X509, __name__,
1548-
"X509Type has been deprecated, use X509 instead",
1549-
DeprecationWarning
1550-
)
1551-
1552-
15531517
class X509StoreFlags(object):
15541518
"""
15551519
Flags for X509 verification, used to change the behavior of
@@ -1684,13 +1648,6 @@ def set_time(self, vfy_time):
16841648
_openssl_assert(_lib.X509_STORE_set1_param(self._store, param) != 0)
16851649

16861650

1687-
X509StoreType = deprecated(
1688-
X509Store, __name__,
1689-
"X509StoreType has been deprecated, use X509Store instead",
1690-
DeprecationWarning
1691-
)
1692-
1693-
16941651
class X509StoreContextError(Exception):
16951652
"""
16961653
An exception raised when an error occurred while verifying a certificate
@@ -2338,13 +2295,6 @@ def export(self, cert, key, type=FILETYPE_PEM, days=100,
23382295
return dump_crl(type, self)
23392296

23402297

2341-
CRLType = deprecated(
2342-
CRL, __name__,
2343-
"CRLType has been deprecated, use CRL instead",
2344-
DeprecationWarning
2345-
)
2346-
2347-
23482298
class PKCS7(object):
23492299
def type_is_signed(self):
23502300
"""
@@ -2389,13 +2339,6 @@ def get_type_name(self):
23892339
return _ffi.string(string_type)
23902340

23912341

2392-
PKCS7Type = deprecated(
2393-
PKCS7, __name__,
2394-
"PKCS7Type has been deprecated, use PKCS7 instead",
2395-
DeprecationWarning
2396-
)
2397-
2398-
23992342
class PKCS12(object):
24002343
"""
24012344
A PKCS #12 archive.
@@ -2570,13 +2513,6 @@ def export(self, passphrase=None, iter=2048, maciter=1):
25702513
return _bio_to_string(bio)
25712514

25722515

2573-
PKCS12Type = deprecated(
2574-
PKCS12, __name__,
2575-
"PKCS12Type has been deprecated, use PKCS12 instead",
2576-
DeprecationWarning
2577-
)
2578-
2579-
25802516
class NetscapeSPKI(object):
25812517
"""
25822518
A Netscape SPKI object.
@@ -2667,13 +2603,6 @@ def set_pubkey(self, pkey):
26672603
_openssl_assert(set_result == 1)
26682604

26692605

2670-
NetscapeSPKIType = deprecated(
2671-
NetscapeSPKI, __name__,
2672-
"NetscapeSPKIType has been deprecated, use NetscapeSPKI instead",
2673-
DeprecationWarning
2674-
)
2675-
2676-
26772606
class _PassphraseHelper(object):
26782607
def __init__(self, type, passphrase, more_args=False, truncate=False):
26792608
if type != FILETYPE_PEM and passphrase is not None:

0 commit comments

Comments
 (0)