Skip to content

Commit d7eca42

Browse files
authored
LibreSSL 3.8.1 and later is OPENSSL_NO_ENGINE (#9456)
Unfortunately, some projects are not prepared to build without ENGINE symbols, so just like BoringSSL we needed to keep some stubs.
1 parent d5e436b commit d7eca42

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

src/_cffi_src/openssl/engine.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,20 @@
4242
typedef void UI_METHOD;
4343
#endif
4444
45-
/* Despite being OPENSSL_NO_ENGINE, BoringSSL defines these symbols. */
46-
#if !CRYPTOGRAPHY_IS_BORINGSSL
45+
/* Despite being OPENSSL_NO_ENGINE, BoringSSL/LibreSSL define these symbols. */
46+
#if !CRYPTOGRAPHY_IS_BORINGSSL && !CRYPTOGRAPHY_IS_LIBRESSL
4747
int (*ENGINE_free)(ENGINE *) = NULL;
4848
void (*ENGINE_load_builtin_engines)(void) = NULL;
4949
#endif
5050
51-
ENGINE *(*ENGINE_by_id)(const char *) = NULL;
52-
int (*ENGINE_init)(ENGINE *) = NULL;
53-
int (*ENGINE_finish)(ENGINE *) = NULL;
5451
ENGINE *(*ENGINE_get_default_RAND)(void) = NULL;
5552
int (*ENGINE_set_default_RAND)(ENGINE *) = NULL;
5653
void (*ENGINE_unregister_RAND)(ENGINE *) = NULL;
54+
55+
#if !CRYPTOGRAPHY_IS_LIBRESSL
56+
ENGINE *(*ENGINE_by_id)(const char *) = NULL;
57+
int (*ENGINE_init)(ENGINE *) = NULL;
58+
int (*ENGINE_finish)(ENGINE *) = NULL;
5759
int (*ENGINE_ctrl_cmd)(ENGINE *, const char *, long, void *,
5860
void (*)(void), int) = NULL;
5961
@@ -66,6 +68,7 @@
6668
void *) = NULL;
6769
EVP_PKEY *(*ENGINE_load_public_key)(ENGINE *, const char *,
6870
UI_METHOD *, void *) = NULL;
71+
#endif
6972
7073
#else
7174
static const long Cryptography_HAS_ENGINE = 1;

0 commit comments

Comments
 (0)