Skip to content

Commit

Permalink
LibreSSL 3.8.1 and later is OPENSSL_NO_ENGINE (#9456)
Browse files Browse the repository at this point in the history
Unfortunately, some projects are not prepared to build without
ENGINE symbols, so just like BoringSSL we needed to keep some stubs.
  • Loading branch information
botovq authored Aug 18, 2023
1 parent d5e436b commit d7eca42
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/_cffi_src/openssl/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,18 +42,20 @@
typedef void UI_METHOD;
#endif
/* Despite being OPENSSL_NO_ENGINE, BoringSSL defines these symbols. */
#if !CRYPTOGRAPHY_IS_BORINGSSL
/* Despite being OPENSSL_NO_ENGINE, BoringSSL/LibreSSL define these symbols. */
#if !CRYPTOGRAPHY_IS_BORINGSSL && !CRYPTOGRAPHY_IS_LIBRESSL
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;
ENGINE *(*ENGINE_get_default_RAND)(void) = NULL;
int (*ENGINE_set_default_RAND)(ENGINE *) = NULL;
void (*ENGINE_unregister_RAND)(ENGINE *) = NULL;
#if !CRYPTOGRAPHY_IS_LIBRESSL
ENGINE *(*ENGINE_by_id)(const char *) = NULL;
int (*ENGINE_init)(ENGINE *) = NULL;
int (*ENGINE_finish)(ENGINE *) = NULL;
int (*ENGINE_ctrl_cmd)(ENGINE *, const char *, long, void *,
void (*)(void), int) = NULL;
Expand All @@ -66,6 +68,7 @@
void *) = NULL;
EVP_PKEY *(*ENGINE_load_public_key)(ENGINE *, const char *,
UI_METHOD *, void *) = NULL;
#endif
#else
static const long Cryptography_HAS_ENGINE = 1;
Expand Down

0 comments on commit d7eca42

Please sign in to comment.