new flag to stop ENGINE methods being registered
authorDr. Stephen Henson <steve@openssl.org>
Sun, 15 May 2011 15:56:49 +0000 (15:56 +0000)
committerDr. Stephen Henson <steve@openssl.org>
Sun, 15 May 2011 15:56:49 +0000 (15:56 +0000)
crypto/engine/eng_fat.c
crypto/engine/engine.h
engines/e_capi.c

index db66e623508f838ba585d4c909f18509710bb30c..789b8d57e58bbccd019ec24ebb3e55f676d5499d 100644 (file)
@@ -176,6 +176,7 @@ int ENGINE_register_all_complete(void)
        ENGINE *e;
 
        for(e=ENGINE_get_first() ; e ; e=ENGINE_get_next(e))
        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;
        }
        return 1;
        }
index bfc453fa96a1f3d0d985642693ce5f7a2326cdf1..98b4921e4dd6acadef1480d91ee88086f73a262f 100644 (file)
@@ -141,6 +141,13 @@ extern "C" {
  * the existing ENGINE's structural reference count. */
 #define ENGINE_FLAGS_BY_ID_COPY                (int)0x0004
 
  * 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
 /* 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
index ce1bec906a68218095993c1ff58d27843514672b..fdf173652ae1cd53ec2370a982b334afb2dfd695 100644 (file)
@@ -527,6 +527,7 @@ static int bind_capi(ENGINE *e)
        {
        if (!ENGINE_set_id(e, engine_capi_id)
                || !ENGINE_set_name(e, engine_capi_name)
        {
        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)
                || !ENGINE_set_init_function(e, capi_init)
                || !ENGINE_set_finish_function(e, capi_finish)
                || !ENGINE_set_destroy_function(e, capi_destroy)