aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-25 16:36:46 -0600
committerPaul Kehrer <paul.l.kehrer@gmail.com>2015-12-25 17:02:41 -0600
commitc6242dcaa972b0dd53af1ed8eedfd9b797dbaf2f (patch)
tree163822ce55fb46e8133dfbcf2fa779da363c3ba3
parentcad8ae268c5009c989b765021404ff8c86df1d8b (diff)
downloadcryptography-c6242dcaa972b0dd53af1ed8eedfd9b797dbaf2f.tar.gz
cryptography-c6242dcaa972b0dd53af1ed8eedfd9b797dbaf2f.tar.bz2
cryptography-c6242dcaa972b0dd53af1ed8eedfd9b797dbaf2f.zip
rename CRLExtensionOID to CRLEntryExtensionOID
-rw-r--r--docs/x509/reference.rst16
-rw-r--r--src/cryptography/hazmat/backends/openssl/x509.py12
-rw-r--r--src/cryptography/utils.py3
-rw-r--r--src/cryptography/x509/__init__.py12
-rw-r--r--src/cryptography/x509/oid.py16
5 files changed, 43 insertions, 16 deletions
diff --git a/docs/x509/reference.rst b/docs/x509/reference.rst
index 8d8bda4b..3d993649 100644
--- a/docs/x509/reference.rst
+++ b/docs/x509/reference.rst
@@ -2263,6 +2263,22 @@ instances. The following common OIDs are available as constants.
the ``CRLNumber`` extension type. This extension only has meaning
for certificate revocation lists.
+.. class:: CRLEntryExtensionOID
+
+ .. versionadded:: 1.2
+
+ .. attribute:: CERTIFICATE_ISSUER
+
+ Corresponds to the dotted string ``"2.5.29.29"``.
+
+ .. attribute:: CRL_REASON
+
+ Corresponds to the dotted string ``"2.5.29.21"``.
+
+ .. attribute:: INVALIDITY_DATE
+
+ Corresponds to the dotted string ``"2.5.29.24"``.
+
Exceptions
~~~~~~~~~~
.. currentmodule:: cryptography.x509
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..8698c089 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,
+ 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
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",