aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNick Bastin <nick.bastin@gmail.com>2015-12-12 18:32:59 -0800
committerNick Bastin <nick.bastin@gmail.com>2015-12-20 08:15:56 -0800
commitd06763d9258115b2e1199296a18d7ec773d47ac3 (patch)
treee8ccd2edc5a226919c10f2738ef8d53d44ab0624 /src
parent4594773bdc8145aa599e18a2119948d061b50b13 (diff)
downloadcryptography-d06763d9258115b2e1199296a18d7ec773d47ac3.tar.gz
cryptography-d06763d9258115b2e1199296a18d7ec773d47ac3.tar.bz2
cryptography-d06763d9258115b2e1199296a18d7ec773d47ac3.zip
Allow any OID for access_method, validate OIDs at creation time, fix tests.
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/x509/extensions.py7
1 files changed, 2 insertions, 5 deletions
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")