summaryrefslogtreecommitdiff
path: root/src/_cffi_src
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2021-10-31 19:17:53 -0400
committerGitHub <noreply@github.com>2021-10-31 23:17:53 +0000
commit8b3affcca796f1a49c9a655e9cd030d387d79627 (patch)
treecd255114f94d0bc2591f92c2e94bff00a0a3ee46 /src/_cffi_src
parent4346ea28cc2846f5429ae93b66462fcc6a0128b4 (diff)
downloadcryptography-8b3affcca796f1a49c9a655e9cd030d387d79627.tar.gz
Check for BoringSSL in the engine bindings (#6509)
Diffstat (limited to 'src/_cffi_src')
-rw-r--r--src/_cffi_src/openssl/engine.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/_cffi_src/openssl/engine.py b/src/_cffi_src/openssl/engine.py
index 9b3ccf1a3..9931639b4 100644
--- a/src/_cffi_src/openssl/engine.py
+++ b/src/_cffi_src/openssl/engine.py
@@ -37,6 +37,16 @@ CUSTOMIZATIONS = """
#ifdef OPENSSL_NO_ENGINE
static const long Cryptography_HAS_ENGINE = 0;
+#if CRYPTOGRAPHY_IS_BORINGSSL
+typedef void UI_METHOD;
+#endif
+
+/* Despite being OPENSSL_NO_ENGINE, BoringSSL defines these symbols. */
+#if !CRYPTOGRAPHY_IS_BORINGSSL
+int (*ENGINE_free)(ENGINE *) = NULL;
+void (*ENGINE_load_builtin_engines)(void) = NULL;
+#endif
+
ENGINE *(*ENGINE_by_id)(const char *) = NULL;
int (*ENGINE_init)(ENGINE *) = NULL;
int (*ENGINE_finish)(ENGINE *) = NULL;
@@ -46,13 +56,11 @@ void (*ENGINE_unregister_RAND)(ENGINE *) = NULL;
int (*ENGINE_ctrl_cmd)(ENGINE *, const char *, long, void *,
void (*)(void), int) = NULL;
-int (*ENGINE_free)(ENGINE *) = NULL;
const char *(*ENGINE_get_id)(const ENGINE *) = NULL;
const char *(*ENGINE_get_name)(const ENGINE *) = NULL;
int (*ENGINE_ctrl_cmd_string)(ENGINE *, const char *, const char *,
int) = NULL;
-void (*ENGINE_load_builtin_engines)(void) = NULL;
EVP_PKEY *(*ENGINE_load_private_key)(ENGINE *, const char *, UI_METHOD *,
void *) = NULL;
EVP_PKEY *(*ENGINE_load_public_key)(ENGINE *, const char *,