From: Dr. Stephen Henson Date: Sun, 15 May 2011 15:58:38 +0000 (+0000) Subject: new flag to stop ENGINE methods being registered X-Git-Tag: OpenSSL_1_0_1-beta1~315 X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=commitdiff_plain;h=676cd3a2832a59cb12d973632202fcbfc18c8887 new flag to stop ENGINE methods being registered --- diff --git a/crypto/engine/eng_fat.c b/crypto/engine/eng_fat.c index db66e62350..789b8d57e5 100644 --- a/crypto/engine/eng_fat.c +++ b/crypto/engine/eng_fat.c @@ -176,6 +176,7 @@ int ENGINE_register_all_complete(void) ENGINE *e; for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e)) - ENGINE_register_complete(e); + if (!(e->flags & ENGINE_FLAGS_NO_REGISTER_ALL)) + ENGINE_register_complete(e); return 1; } diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h index 943aeae215..84db1b5017 100644 --- a/crypto/engine/engine.h +++ b/crypto/engine/engine.h @@ -141,6 +141,13 @@ extern "C" { * the existing ENGINE's structural reference count. */ #define ENGINE_FLAGS_BY_ID_COPY (int)0x0004 +/* This flag if for an ENGINE that does not want its methods registered as + * part of ENGINE_register_all_complete() for example if the methods are + * not usable as default methods. + */ + +#define ENGINE_FLAGS_NO_REGISTER_ALL (int)0x0008 + /* ENGINEs can support their own command types, and these flags are used in * ENGINE_CTRL_GET_CMD_FLAGS to indicate to the caller what kind of input each * command expects. Currently only numeric and string input is supported. If a diff --git a/engines/e_capi.c b/engines/e_capi.c index 24b620fc07..ea626c9975 100644 --- a/engines/e_capi.c +++ b/engines/e_capi.c @@ -522,6 +522,7 @@ static int bind_capi(ENGINE *e) { if (!ENGINE_set_id(e, engine_capi_id) || !ENGINE_set_name(e, engine_capi_name) + || !ENGINE_set_flags(e, ENGINE_FLAGS_NO_REGISTER_ALL) || !ENGINE_set_init_function(e, capi_init) || !ENGINE_set_finish_function(e, capi_finish) || !ENGINE_set_destroy_function(e, capi_destroy)