aboutsummaryrefslogtreecommitdiffstats
path: root/src/cryptography/hazmat/bindings/openssl/binding.py
diff options
context:
space:
mode:
authorPaul Kehrer <paul.l.kehrer@gmail.com>2017-02-13 20:01:23 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2017-02-13 18:01:23 -0800
commit4a90c254278231d7defeac304a3cfd752e96e786 (patch)
tree7133b8188ad38f12b44c40064c6021566e070595 /src/cryptography/hazmat/bindings/openssl/binding.py
parentbd7cd2d43f75bd34830dfbeaf0ac4f8be2fce9a7 (diff)
downloadcryptography-4a90c254278231d7defeac304a3cfd752e96e786.tar.gz
cryptography-4a90c254278231d7defeac304a3cfd752e96e786.tar.bz2
cryptography-4a90c254278231d7defeac304a3cfd752e96e786.zip
switch the PEM password callback to a C implementation (#3382)
* switch the PEM password callback to a C implementation Calling from C to Python is fraught with edge cases, especially in subinterpreter land. This commit moves the PEM password callback logic into a small C function and then removes all the infrastructure for the cffi callbacks (as we no longer have any) * review feedback and update tests * rename the struct * aaand one more fix
Diffstat (limited to 'src/cryptography/hazmat/bindings/openssl/binding.py')
-rw-r--r--src/cryptography/hazmat/bindings/openssl/binding.py19
1 files changed, 0 insertions, 19 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/binding.py b/src/cryptography/hazmat/bindings/openssl/binding.py
index b6617543..6f9359c7 100644
--- a/src/cryptography/hazmat/bindings/openssl/binding.py
+++ b/src/cryptography/hazmat/bindings/openssl/binding.py
@@ -61,25 +61,6 @@ def _openssl_assert(lib, ok):
)
-def ffi_callback(signature, name, **kwargs):
- """Callback dispatcher
-
- The ffi_callback() dispatcher keeps callbacks compatible between dynamic
- and static callbacks.
- """
- def wrapper(func):
- if lib.Cryptography_STATIC_CALLBACKS:
- # def_extern() returns a decorator that sets the internal
- # function pointer and returns the original function unmodified.
- ffi.def_extern(name=name, **kwargs)(func)
- callback = getattr(lib, name)
- else:
- # callback() wraps the function in a cdata function.
- callback = ffi.callback(signature, **kwargs)(func)
- return callback
- return wrapper
-
-
def build_conditional_library(lib, conditional_names):
conditional_lib = types.ModuleType("lib")
excluded_names = set()