From d06763d9258115b2e1199296a18d7ec773d47ac3 Mon Sep 17 00:00:00 2001 From: Nick Bastin Date: Sat, 12 Dec 2015 18:32:59 -0800 Subject: Allow any OID for access_method, validate OIDs at creation time, fix tests. --- src/cryptography/x509/extensions.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 46ba5a28..017e0989 100644 --- a/src/cryptography/x509/extensions.py +++ b/src/cryptography/x509/extensions.py @@ -238,11 +238,8 @@ class AuthorityInformationAccess(object): class AccessDescription(object): def __init__(self, access_method, access_location): - if not (access_method == AuthorityInformationAccessOID.OCSP or - access_method == AuthorityInformationAccessOID.CA_ISSUERS): - raise ValueError( - "access_method must be OID_OCSP or OID_CA_ISSUERS" - ) + if not isinstance(access_method, ObjectIdentifier): + raise TypeError("access_method must be an ObjectIdentifier") if not isinstance(access_location, GeneralName): raise TypeError("access_location must be a GeneralName") -- cgit v1.2.3 From bd079ae1ebf54d9224ec5662c14b0814301cbd02 Mon Sep 17 00:00:00 2001 From: Nick Bastin Date: Sun, 13 Dec 2015 05:15:44 -0800 Subject: 4-space indent for this repo --- src/cryptography/x509/extensions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 017e0989..97d78266 100644 --- a/src/cryptography/x509/extensions.py +++ b/src/cryptography/x509/extensions.py @@ -239,7 +239,7 @@ class AuthorityInformationAccess(object): class AccessDescription(object): def __init__(self, access_method, access_location): if not isinstance(access_method, ObjectIdentifier): - raise TypeError("access_method must be an ObjectIdentifier") + raise TypeError("access_method must be an ObjectIdentifier") if not isinstance(access_location, GeneralName): raise TypeError("access_location must be a GeneralName") -- cgit v1.2.3 From 99de318242fffabdb46ea5713436a0b8ad63521f Mon Sep 17 00:00:00 2001 From: Nick Bastin Date: Sun, 13 Dec 2015 05:37:04 -0800 Subject: PEP8 fixes --- src/cryptography/x509/extensions.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src') diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 97d78266..71ce8a15 100644 --- a/src/cryptography/x509/extensions.py +++ b/src/cryptography/x509/extensions.py @@ -18,9 +18,7 @@ from cryptography import utils from cryptography.hazmat.primitives import constant_time, serialization from cryptography.x509.general_name import GeneralName, IPAddress, OtherName from cryptography.x509.name import Name -from cryptography.x509.oid import ( - AuthorityInformationAccessOID, ExtensionOID, ObjectIdentifier -) +from cryptography.x509.oid import ExtensionOID, ObjectIdentifier class _SubjectPublicKeyInfo(univ.Sequence): -- cgit v1.2.3