diff options
author | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-19 09:16:45 -0600 |
---|---|---|
committer | Paul Kehrer <paul.l.kehrer@gmail.com> | 2015-02-19 09:16:45 -0600 |
commit | 1165473f748ed8c1d661f9587963e99ad11fa51d (patch) | |
tree | bec0c4a2b9a4d55b596f83a9f674c1b86d7b7b87 /src | |
parent | 16a95ead463cea2bc36391394bec226633ef20ca (diff) | |
download | cryptography-1165473f748ed8c1d661f9587963e99ad11fa51d.tar.gz cryptography-1165473f748ed8c1d661f9587963e99ad11fa51d.tar.bz2 cryptography-1165473f748ed8c1d661f9587963e99ad11fa51d.zip |
conditionally bind cryptodev engine for LibreSSL
Diffstat (limited to 'src')
-rw-r--r-- | src/cryptography/hazmat/bindings/openssl/engine.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/cryptography/hazmat/bindings/openssl/engine.py b/src/cryptography/hazmat/bindings/openssl/engine.py index 33c79982..3ebfa6c1 100644 --- a/src/cryptography/hazmat/bindings/openssl/engine.py +++ b/src/cryptography/hazmat/bindings/openssl/engine.py @@ -9,6 +9,8 @@ INCLUDES = """ """ TYPES = """ +static const long Cryptography_HAS_ENGINE_CRYPTODEV; + typedef ... ENGINE; typedef ... RSA_METHOD; typedef ... DSA_METHOD; @@ -49,7 +51,6 @@ int ENGINE_init(ENGINE *); int ENGINE_finish(ENGINE *); void ENGINE_load_openssl(void); void ENGINE_load_dynamic(void); -void ENGINE_load_cryptodev(void); void ENGINE_load_builtin_engines(void); void ENGINE_cleanup(void); ENGINE *ENGINE_get_default_RSA(void); @@ -148,9 +149,20 @@ void ENGINE_add_conf_module(void); """ MACROS = """ +void ENGINE_load_cryptodev(void); """ CUSTOMIZATIONS = """ +#if defined(LIBRESSL_VERSION_NUMBER) +static const long Cryptography_HAS_ENGINE_CRYPTODEV = 0; +void (*ENGINE_load_cryptodev)(void) = NULL; +#else +static const long Cryptography_HAS_ENGINE_CRYPTODEV = 1; +#endif """ -CONDITIONAL_NAMES = {} +CONDITIONAL_NAMES = { + "Cryptography_HAS_ENGINE_CRYPTODEV": [ + "ENGINE_load_cryptodev" + ] +} |