Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable use of CRL (and more) in verify context. #483

Merged
merged 18 commits into from
Jun 5, 2016
Prev Previous commit
Next Next commit
Remove Enum subclassing.
  • Loading branch information
Dan Sully committed Jun 5, 2016
commit 55af14e4a32c4ee34f88f579eb5bddfdb34b10c9
4 changes: 2 additions & 2 deletions doc/api/crypto.rst
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,8 @@ X509StoreContext objects

.. _openssl-pkey:

X509StoreFlags enums
--------------------
X509StoreFlags constants
------------------------

.. autoclass:: X509StoreFlags

Expand Down
3 changes: 1 addition & 2 deletions src/OpenSSL/crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
integer_types as _integer_types,
text_type as _text_type,
PY3 as _PY3)
from enum import Enum

from OpenSSL._util import (
ffi as _ffi,
Expand Down Expand Up @@ -1426,7 +1425,7 @@ def get_extension(self, index):
X509Type = X509


class X509StoreFlags(Enum):
class X509StoreFlags(object):
"""
Flags for X509 verification, used to change the behavior of
:class:`X509Store`.
Expand Down
6 changes: 2 additions & 4 deletions tests/test_crypto.py
Original file line number Diff line number Diff line change
Expand Up @@ -3458,8 +3458,7 @@ def test_verify_with_revoked(self):
store.add_crl(root_crl)
store.add_crl(intermediate_crl)
store.set_flags(
X509StoreFlags.CRL_CHECK.value |
X509StoreFlags.CRL_CHECK_ALL.value)
X509StoreFlags.CRL_CHECK | X509StoreFlags.CRL_CHECK_ALL)
store_ctx = X509StoreContext(store, self.intermediate_server_cert)
e = self.assertRaises(
X509StoreContextError, store_ctx.verify_certificate)
Expand All @@ -3477,8 +3476,7 @@ def test_verify_with_missing_crl(self):
self.root_cert, self.root_key, certs=[self.intermediate_cert])
store.add_crl(root_crl)
store.set_flags(
X509StoreFlags.CRL_CHECK.value |
X509StoreFlags.CRL_CHECK_ALL.value)
X509StoreFlags.CRL_CHECK | X509StoreFlags.CRL_CHECK_ALL)
store_ctx = X509StoreContext(store, self.intermediate_server_cert)
e = self.assertRaises(
X509StoreContextError, store_ctx.verify_certificate)
Expand Down