aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2019-01-23 22:00:14 -0500
committerPaul Kehrer <paul.l.kehrer@gmail.com>2019-01-23 21:00:14 -0600
commit5c07d7a87c54a8532b49ba41febe8d526e5734d8 (patch)
treef7b8e6ac665e960d141bc6e836eac47a6bcb1018 /src/cryptography
parent908121176f037c618b1f774ab969ad7f67ea3020 (diff)
downloadcryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.tar.gz
cryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.tar.bz2
cryptography-5c07d7a87c54a8532b49ba41febe8d526e5734d8.zip
Fixes #4734 -- Deal with deprecated things (#4736)
* Fixes #4734 -- Deal with deprecated things - Make year based aliases of PersistentlyDeprecated so we can easily assess age - Removed encode/decode rfc6979 signature - Removed Certificate.serial * Unused import
Diffstat (limited to 'src/cryptography')
-rw-r--r--src/cryptography/hazmat/backends/openssl/utils.py2
-rw-r--r--src/cryptography/hazmat/backends/openssl/x509.py10
-rw-r--r--src/cryptography/hazmat/primitives/asymmetric/utils.py22
-rw-r--r--src/cryptography/hazmat/primitives/constant_time.py2
-rw-r--r--src/cryptography/utils.py5
-rw-r--r--src/cryptography/x509/general_name.py6
6 files changed, 7 insertions, 40 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/utils.py b/src/cryptography/hazmat/backends/openssl/utils.py
index 363f3d2c..ee472c0e 100644
--- a/src/cryptography/hazmat/backends/openssl/utils.py
+++ b/src/cryptography/hazmat/backends/openssl/utils.py
@@ -64,6 +64,6 @@ def _warn_sign_verify_deprecated():
warnings.warn(
"signer and verifier have been deprecated. Please use sign "
"and verify instead.",
- utils.PersistentlyDeprecated,
+ utils.PersistentlyDeprecated2017,
stacklevel=3
)
diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py
index ac1838c6..b3eb797d 100644
--- a/src/cryptography/hazmat/backends/openssl/x509.py
+++ b/src/cryptography/hazmat/backends/openssl/x509.py
@@ -6,7 +6,6 @@ from __future__ import absolute_import, division, print_function
import datetime
import operator
-import warnings
from cryptography import utils, x509
from cryptography.exceptions import UnsupportedAlgorithm
@@ -63,15 +62,6 @@ class _Certificate(object):
)
@property
- def serial(self):
- warnings.warn(
- "Certificate serial is deprecated, use serial_number instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return self.serial_number
-
- @property
def serial_number(self):
asn1_int = self._backend._lib.X509_get_serialNumber(self._x509)
self._backend.openssl_assert(asn1_int != self._backend._ffi.NULL)
diff --git a/src/cryptography/hazmat/primitives/asymmetric/utils.py b/src/cryptography/hazmat/primitives/asymmetric/utils.py
index ef1e7eb9..274c1f41 100644
--- a/src/cryptography/hazmat/primitives/asymmetric/utils.py
+++ b/src/cryptography/hazmat/primitives/asymmetric/utils.py
@@ -4,8 +4,6 @@
from __future__ import absolute_import, division, print_function
-import warnings
-
from asn1crypto.algos import DSASignature
import six
@@ -14,31 +12,11 @@ from cryptography import utils
from cryptography.hazmat.primitives import hashes
-def decode_rfc6979_signature(signature):
- warnings.warn(
- "decode_rfc6979_signature is deprecated and will "
- "be removed in a future version, use decode_dss_signature instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return decode_dss_signature(signature)
-
-
def decode_dss_signature(signature):
data = DSASignature.load(signature, strict=True).native
return data['r'], data['s']
-def encode_rfc6979_signature(r, s):
- warnings.warn(
- "encode_rfc6979_signature is deprecated and will "
- "be removed in a future version, use encode_dss_signature instead.",
- utils.PersistentlyDeprecated,
- stacklevel=2
- )
- return encode_dss_signature(r, s)
-
-
def encode_dss_signature(r, s):
if (
not isinstance(r, six.integer_types) or
diff --git a/src/cryptography/hazmat/primitives/constant_time.py b/src/cryptography/hazmat/primitives/constant_time.py
index 0e987ea7..99a114e2 100644
--- a/src/cryptography/hazmat/primitives/constant_time.py
+++ b/src/cryptography/hazmat/primitives/constant_time.py
@@ -23,7 +23,7 @@ else:
"Support for your Python version is deprecated. The next version of "
"cryptography will remove support. Please upgrade to a 2.7.x "
"release that supports hmac.compare_digest as soon as possible.",
- utils.DeprecatedIn23,
+ utils.PersistentlyDeprecated2018,
)
def bytes_eq(a, b):
diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py
index cbbae3a7..567600fb 100644
--- a/src/cryptography/utils.py
+++ b/src/cryptography/utils.py
@@ -20,9 +20,8 @@ class CryptographyDeprecationWarning(UserWarning):
# Several APIs were deprecated with no specific end-of-life date because of the
# ubiquity of their use. They should not be removed until we agree on when that
# cycle ends.
-PersistentlyDeprecated = CryptographyDeprecationWarning
-DeprecatedIn21 = CryptographyDeprecationWarning
-DeprecatedIn23 = CryptographyDeprecationWarning
+PersistentlyDeprecated2017 = CryptographyDeprecationWarning
+PersistentlyDeprecated2018 = CryptographyDeprecationWarning
DeprecatedIn25 = CryptographyDeprecationWarning
diff --git a/src/cryptography/x509/general_name.py b/src/cryptography/x509/general_name.py
index 1b0f8c8f..fef29c8c 100644
--- a/src/cryptography/x509/general_name.py
+++ b/src/cryptography/x509/general_name.py
@@ -72,7 +72,7 @@ class RFC822Name(object):
"This means unicode characters should be encoded via "
"idna. Support for passing unicode strings (aka U-label) "
"will be removed in a future version.",
- utils.DeprecatedIn21,
+ utils.PersistentlyDeprecated2017,
stacklevel=2,
)
else:
@@ -139,7 +139,7 @@ class DNSName(object):
"This means unicode characters should be encoded via "
"idna. Support for passing unicode strings (aka U-label) "
"will be removed in a future version.",
- utils.DeprecatedIn21,
+ utils.PersistentlyDeprecated2017,
stacklevel=2,
)
else:
@@ -184,7 +184,7 @@ class UniformResourceIdentifier(object):
"This means unicode characters should be encoded via "
"idna. Support for passing unicode strings (aka U-label) "
" will be removed in a future version.",
- utils.DeprecatedIn21,
+ utils.PersistentlyDeprecated2017,
stacklevel=2,
)
else: