python-cryptography/python-cryptography-1.5.2-fix_available_backends.patch

27 lines
921 B
Diff
Raw Permalink Normal View History

--- cryptography-1.5.2/src/cryptography/hazmat/backends/__init__.py.orig 2016-10-17 12:23:32.705257213 +0200
+++ cryptography-1.5.2/src/cryptography/hazmat/backends/__init__.py 2016-10-17 12:23:48.238260931 +0200
@@ -29,6 +29,23 @@
)
]
+ if _available_backends_list is None or len(_available_backends_list) == 0:
+ # backend 1
+ try:
+ from cryptography.hazmat.backends.commoncrypto.backend import backend as be_cc
+ except ImportError:
+ be_cc = None
+ # backend 2
+ try:
+ from cryptography.hazmat.backends.openssl.backend import backend as be_ossl
+ except ImportError:
+ be_ossl = None
+ # add any backends of your own
+
+ _available_backends_list = [
+ be for be in (be_cc, be_ossl) if be is not None
+ ]
+
return _available_backends_list
_default_backend = None