Commit 8e61cbc4 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 0.8.2

parent e44e1ff6
Changelog
=========
0.8.2 - 2015-04-10
~~~~~~~~~~~~~~~~~~
* Fixed a race condition when initializing the OpenSSL or CommonCrypto backends
in a multi-threaded scenario.
0.8.1 - 2015-03-20
~~~~~~~~~~~~~~~~~~
* Updated Windows wheels to be compiled against OpenSSL 1.0.2a.
0.8 - 2015-03-08
~~~~~~~~~~~~~~~~
......
Metadata-Version: 1.1
Name: cryptography
Version: 0.8
Version: 0.8.2
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
......
Metadata-Version: 1.1
Name: cryptography
Version: 0.8
Version: 0.8.2
Summary: cryptography is a package which provides cryptographic recipes and primitives to Python developers.
Home-page: https://github.com/pyca/cryptography
Author: The cryptography developers
......
......@@ -14,7 +14,7 @@ __summary__ = ("cryptography is a package which provides cryptographic recipes"
" and primitives to Python developers.")
__uri__ = "https://github.com/pyca/cryptography"
__version__ = "0.8"
__version__ = "0.8.2"
__author__ = "The cryptography developers"
__email__ = "cryptography-dev@python.org"
......
......@@ -4,6 +4,8 @@
from __future__ import absolute_import, division, print_function
import threading
from cryptography.hazmat.bindings.utils import (
build_ffi_for_binding, load_library_for_binding,
)
......@@ -35,6 +37,7 @@ class Binding(object):
],
)
lib = None
_init_lock = threading.Lock()
def __init__(self):
self._ensure_ffi_initialized()
......@@ -44,8 +47,10 @@ class Binding(object):
if cls.lib is not None:
return
cls.lib = load_library_for_binding(
cls.ffi,
module_prefix=cls._module_prefix,
modules=cls._modules,
)
with cls._init_lock:
if cls.lib is None:
cls.lib = load_library_for_binding(
cls.ffi,
module_prefix=cls._module_prefix,
modules=cls._modules,
)
......@@ -98,6 +98,7 @@ class Binding(object):
_locks = None
_lock_cb_handle = None
_init_lock = threading.Lock()
_lock_init_lock = threading.Lock()
ffi = build_ffi_for_binding(
......@@ -117,14 +118,16 @@ class Binding(object):
if cls.lib is not None:
return
cls.lib = load_library_for_binding(
cls.ffi,
cls._module_prefix,
cls._modules,
)
with cls._init_lock:
if cls.lib is None:
cls.lib = load_library_for_binding(
cls.ffi,
cls._module_prefix,
cls._modules,
)
res = cls.lib.Cryptography_add_osrandom_engine()
assert res != 0
res = cls.lib.Cryptography_add_osrandom_engine()
assert res != 0
@classmethod
def init_static_locks(cls):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment