From e5327bef9c1dceaa6c4ac967c1d53fae2e85d456 Mon Sep 17 00:00:00 2001 From: Christian Heimes Date: Tue, 17 Jan 2017 20:36:46 +0100 Subject: [PATCH 1/2] Use static callbacks with Python 3.x again Static callbacks were disabled for Python 3.5+ to work around an issue with subinterpreters, locking callbacks and osrandom engine. Locking callback and osrandom engine were replaced with a C implementations in version 1.6 and 1.7. https://github.com/pyca/cryptography/issues/2970 Closes: #3348 Signed-off-by: Christian Heimes --- src/_cffi_src/openssl/callbacks.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/_cffi_src/openssl/callbacks.py b/src/_cffi_src/openssl/callbacks.py index 4a6b4d37a067..56edc513b557 100644 --- a/src/_cffi_src/openssl/callbacks.py +++ b/src/_cffi_src/openssl/callbacks.py @@ -50,9 +50,8 @@ static const long Cryptography_STATIC_CALLBACKS = 1; """ -if cffi.__version_info__ < (1, 4, 0) or sys.version_info >= (3, 5): +if cffi.__version_info__ < (1, 4, 0): # backwards compatibility for old cffi version on PyPy - # and Python >=3.5 (https://github.com/pyca/cryptography/issues/2970) TYPES = "static const long Cryptography_STATIC_CALLBACKS;" CUSTOMIZATIONS = """static const long Cryptography_STATIC_CALLBACKS = 0; """ From 3ac1dcf4a6b880ee70f645b9b99ddcecbb97dc80 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 18 Jan 2017 08:09:25 +0800 Subject: [PATCH 2/2] remove unused import --- src/_cffi_src/openssl/callbacks.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/_cffi_src/openssl/callbacks.py b/src/_cffi_src/openssl/callbacks.py index 56edc513b557..0194d2a5b02e 100644 --- a/src/_cffi_src/openssl/callbacks.py +++ b/src/_cffi_src/openssl/callbacks.py @@ -4,8 +4,6 @@ from __future__ import absolute_import, division, print_function -import sys - import cffi INCLUDES = """