diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-20 12:07:02 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-12-20 12:07:02 -0600 |
commit | 45b8752fd2e7c40dcdbe655461815206d3372baf (patch) | |
tree | 0cd97e7f01345cf128c1658bec3f8425c4f5d289 /src | |
parent | fc504fee938a5223e790e4c221c20177bca6aa14 (diff) | |
parent | 7b0c6940cf95c0444b192c3864f8b85f343b011e (diff) | |
download | cryptography-45b8752fd2e7c40dcdbe655461815206d3372baf.tar.gz cryptography-45b8752fd2e7c40dcdbe655461815206d3372baf.tar.bz2 cryptography-45b8752fd2e7c40dcdbe655461815206d3372baf.zip |
Merge pull request #2525 from nbastin/20151112-access-method
issue-2524
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/x509/extensions.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/cryptography/x509/extensions.py b/src/cryptography/x509/extensions.py index 46ba5a28..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): @@ -238,11 +236,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") |