patched to fix no _available_backends problem (see http://stackoverflow.com/questions/38277915/python-cryptography-multibackend-cannot-be-innitialized#38285941) [release 1.5.2-2mamba;Mon Oct 17 2016]

This commit is contained in:
Silvan Calarco 2024-01-06 10:59:56 +01:00
parent 1842f30d40
commit e1fd40f77f
2 changed files with 32 additions and 1 deletions

View File

@ -0,0 +1,26 @@
--- 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

View File

@ -1,6 +1,6 @@
Name: python-cryptography Name: python-cryptography
Version: 1.5.2 Version: 1.5.2
Release: 1mamba Release: 2mamba
Summary: Cryptographic recipes and primitives to Python developers Summary: Cryptographic recipes and primitives to Python developers
Group: System/Libraries Group: System/Libraries
Vendor: openmamba Vendor: openmamba
@ -8,6 +8,7 @@ Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it> Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: https://github.com/pyca/cryptography URL: https://github.com/pyca/cryptography
Source: https://pypi.debian.net/cryptography/cryptography-%{version}.tar.gz Source: https://pypi.debian.net/cryptography/cryptography-%{version}.tar.gz
Patch0: python-cryptography-1.5.2-fix_available_backends.patch
License: BSD License: BSD
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel BuildRequires: glibc-devel
@ -27,6 +28,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-root
%prep %prep
%setup -q -n cryptography-%{version} %setup -q -n cryptography-%{version}
%patch0 -p1
%build %build
CFLAGS="%{optflags}" %{__python} setup.py build CFLAGS="%{optflags}" %{__python} setup.py build
@ -47,6 +49,9 @@ CFLAGS="%{optflags}" %{__python} setup.py build
%doc LICENSE %doc LICENSE
%changelog %changelog
* Mon Oct 17 2016 Silvan Calarco <silvan.calarco@mambasoft.it> 1.5.2-2mamba
- patched to fix no _available_backends problem (see http://stackoverflow.com/questions/38277915/python-cryptography-multibackend-cannot-be-innitialized#38285941)
* Tue Sep 27 2016 Automatic Build System <autodist@mambasoft.it> 1.5.2-1mamba * Tue Sep 27 2016 Automatic Build System <autodist@mambasoft.it> 1.5.2-1mamba
- automatic version update by autodist - automatic version update by autodist