diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-25 20:02:59 -0500 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2015-12-25 20:02:59 -0500 |
commit | 4f76921ad87d71067158625aa0afedbba8ae1314 (patch) | |
tree | 294cb29dc365c5a70dbf15768549d45ea98a3027 /src | |
parent | baacf1a8ca88a3873d7c4cc3055b1e4564c879c4 (diff) | |
parent | fd4028e73ac508c94148cf803170ec792a94a66f (diff) | |
download | cryptography-4f76921ad87d71067158625aa0afedbba8ae1314.tar.gz cryptography-4f76921ad87d71067158625aa0afedbba8ae1314.tar.bz2 cryptography-4f76921ad87d71067158625aa0afedbba8ae1314.zip |
Merge pull request #2574 from reaperhulk/rename-crlextension
rename CRLExtensionOID to CRLEntryExtensionOID
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/backends/openssl/x509.py | 12 | ||||
-rw-r--r-- | src/cryptography/utils.py | 3 | ||||
-rw-r--r-- | src/cryptography/x509/__init__.py | 13 | ||||
-rw-r--r-- | src/cryptography/x509/oid.py | 16 |
4 files changed, 28 insertions, 16 deletions
diff --git a/src/cryptography/hazmat/backends/openssl/x509.py b/src/cryptography/hazmat/backends/openssl/x509.py index a470adbd..f3286b05 100644 --- a/src/cryptography/hazmat/backends/openssl/x509.py +++ b/src/cryptography/hazmat/backends/openssl/x509.py @@ -20,7 +20,7 @@ from cryptography import utils, x509 from cryptography.exceptions import UnsupportedAlgorithm from cryptography.hazmat.primitives import hashes, serialization from cryptography.x509.oid import ( - CRLExtensionOID, CertificatePoliciesOID, ExtensionOID + CRLEntryExtensionOID, CertificatePoliciesOID, ExtensionOID ) @@ -740,7 +740,7 @@ def _decode_cert_issuer(backend, ext): backend._consume_errors() raise ValueError( "The {0} extension is corrupted and can't be parsed".format( - CRLExtensionOID.CERTIFICATE_ISSUER)) + CRLEntryExtensionOID.CERTIFICATE_ISSUER)) gns = backend._ffi.gc(gns, backend._lib.GENERAL_NAMES_free) return x509.GeneralNames(_decode_general_names(backend, gns)) @@ -992,13 +992,13 @@ _EXTENSION_HANDLERS = { } _REVOKED_EXTENSION_HANDLERS = { - CRLExtensionOID.CRL_REASON: _decode_crl_reason, - CRLExtensionOID.INVALIDITY_DATE: _decode_invalidity_date, - CRLExtensionOID.CERTIFICATE_ISSUER: _decode_cert_issuer, + CRLEntryExtensionOID.CRL_REASON: _decode_crl_reason, + CRLEntryExtensionOID.INVALIDITY_DATE: _decode_invalidity_date, + CRLEntryExtensionOID.CERTIFICATE_ISSUER: _decode_cert_issuer, } _REVOKED_UNSUPPORTED_EXTENSIONS = set([ - CRLExtensionOID.CERTIFICATE_ISSUER, + CRLEntryExtensionOID.CERTIFICATE_ISSUER, ]) _CRL_EXTENSION_HANDLERS = { diff --git a/src/cryptography/utils.py b/src/cryptography/utils.py index 4449e85a..b85d50d3 100644 --- a/src/cryptography/utils.py +++ b/src/cryptography/utils.py @@ -12,7 +12,10 @@ import sys import warnings +# the functions deprecated in 1.0 are on an arbitrarily extended deprecation +# cycle and should not be removed until we agree on when that cycle ends. DeprecatedIn10 = DeprecationWarning +DeprecatedIn12 = PendingDeprecationWarning def read_only_property(name): diff --git a/src/cryptography/x509/__init__.py b/src/cryptography/x509/__init__.py index 5653144c..32543e67 100644 --- a/src/cryptography/x509/__init__.py +++ b/src/cryptography/x509/__init__.py @@ -29,9 +29,9 @@ from cryptography.x509.general_name import ( ) from cryptography.x509.name import Name, NameAttribute from cryptography.x509.oid import ( - AuthorityInformationAccessOID, CRLExtensionOID, CertificatePoliciesOID, - ExtendedKeyUsageOID, ExtensionOID, NameOID, ObjectIdentifier, - SignatureAlgorithmOID, _SIG_OIDS_TO_HASH + AuthorityInformationAccessOID, CRLEntryExtensionOID, CRLExtensionOID, + CertificatePoliciesOID, ExtendedKeyUsageOID, ExtensionOID, NameOID, + ObjectIdentifier, SignatureAlgorithmOID, _SIG_OIDS_TO_HASH ) @@ -96,9 +96,9 @@ OID_ANY_POLICY = CertificatePoliciesOID.ANY_POLICY OID_CPS_QUALIFIER = CertificatePoliciesOID.CPS_QUALIFIER OID_CPS_USER_NOTICE = CertificatePoliciesOID.CPS_USER_NOTICE -OID_CERTIFICATE_ISSUER = CRLExtensionOID.CERTIFICATE_ISSUER -OID_CRL_REASON = CRLExtensionOID.CRL_REASON -OID_INVALIDITY_DATE = CRLExtensionOID.INVALIDITY_DATE +OID_CERTIFICATE_ISSUER = CRLEntryExtensionOID.CERTIFICATE_ISSUER +OID_CRL_REASON = CRLEntryExtensionOID.CRL_REASON +OID_INVALIDITY_DATE = CRLEntryExtensionOID.INVALIDITY_DATE OID_CA_ISSUERS = AuthorityInformationAccessOID.CA_ISSUERS OID_OCSP = AuthorityInformationAccessOID.OCSP @@ -164,4 +164,5 @@ __all__ = [ "OID_CA_ISSUERS", "OID_OCSP", "_GENERAL_NAMES", + "CRLExtensionOID", ] diff --git a/src/cryptography/x509/oid.py b/src/cryptography/x509/oid.py index 94295d66..ced15103 100644 --- a/src/cryptography/x509/oid.py +++ b/src/cryptography/x509/oid.py @@ -88,12 +88,20 @@ class ExtensionOID(object): CRL_NUMBER = ObjectIdentifier("2.5.29.20") -class CRLExtensionOID(object): +class CRLEntryExtensionOID(object): CERTIFICATE_ISSUER = ObjectIdentifier("2.5.29.29") CRL_REASON = ObjectIdentifier("2.5.29.21") INVALIDITY_DATE = ObjectIdentifier("2.5.29.24") +CRLExtensionOID = utils.deprecated( + CRLEntryExtensionOID, + __name__, + "CRLExtensionOID has been renamed to CRLEntryExtensionOID", + utils.DeprecatedIn12 +) + + class NameOID(object): COMMON_NAME = ObjectIdentifier("2.5.4.3") COUNTRY_NAME = ObjectIdentifier("2.5.4.6") @@ -220,9 +228,9 @@ _OID_NAMES = { ExtensionOID.SUBJECT_ALTERNATIVE_NAME: "subjectAltName", ExtensionOID.ISSUER_ALTERNATIVE_NAME: "issuerAltName", ExtensionOID.BASIC_CONSTRAINTS: "basicConstraints", - CRLExtensionOID.CRL_REASON: "cRLReason", - CRLExtensionOID.INVALIDITY_DATE: "invalidityDate", - CRLExtensionOID.CERTIFICATE_ISSUER: "certificateIssuer", + CRLEntryExtensionOID.CRL_REASON: "cRLReason", + CRLEntryExtensionOID.INVALIDITY_DATE: "invalidityDate", + CRLEntryExtensionOID.CERTIFICATE_ISSUER: "certificateIssuer", ExtensionOID.NAME_CONSTRAINTS: "nameConstraints", ExtensionOID.CRL_DISTRIBUTION_POINTS: "cRLDistributionPoints", ExtensionOID.CERTIFICATE_POLICIES: "certificatePolicies", |