Some more tweaks to ENGINE code.
authorGeoff Thorpe <geoff@openssl.org>
Wed, 18 Apr 2001 03:03:16 +0000 (03:03 +0000)
committerGeoff Thorpe <geoff@openssl.org>
Wed, 18 Apr 2001 03:03:16 +0000 (03:03 +0000)
Previous changes permanently removed the commented-out old code for where
it was possible to create and use an ENGINE statically, and this code gets
rid of the ENGINE_FLAGS_MALLOCED flag that supported the distinction with
dynamically allocated ENGINEs. It also moves the area for ENGINE_FLAGS_***
values from engine_int.h to engine.h - because it should be possible to
declare ENGINEs just from declarations in exported headers.

crypto/engine/engine.h
crypto/engine/engine_int.h
crypto/engine/engine_list.c

index ef144f9e018b2b913dbb360e7e18c7b4cd091b64..2674bb1aa25070dac8d83a5f2d17182e3f610700 100644 (file)
@@ -83,6 +83,9 @@ extern "C" {
 #define ENGINE_METHOD_ALL              (unsigned int)0xFFFF
 #define ENGINE_METHOD_NONE             (unsigned int)0x0000
 
+/* ENGINE flags that can be set by ENGINE_set_flags(). */
+/* #define ENGINE_FLAGS_MALLOCED       0x0001 */ /* Not used */
+
 /* These flags are used to tell the ctrl function what should be done.
  * All command numbers are shared between all engines, even if some don't
  * make sense to some engines.  In such a case, they do nothing but return
index 28bf3b1bf61ae623169834870c830f7284adab31..6e9c4ac61f3fc4efcc118d710bd5ff5d85c1d28e 100644 (file)
@@ -73,8 +73,8 @@
 extern "C" {
 #endif
 
-/* Bitwise OR-able values for the "flags" variable in ENGINE. */
-#define ENGINE_FLAGS_MALLOCED  0x0001
+/* NB: Bitwise OR-able values for the "flags" variable in ENGINE are now exposed
+ * in engine.h. */
 
 /* This is a structure for storing implementations of various crypto
  * algorithms and functions. */
index a7432c3f6865c03edf05d75447cc5bb440c82837..6f184d8119e132e91f270558010ad545d5647a7e 100644 (file)
@@ -346,7 +346,6 @@ ENGINE *ENGINE_new(void)
                return NULL;
                }
        memset(ret, 0, sizeof(ENGINE));
-       ret->flags = ENGINE_FLAGS_MALLOCED;
        ret->struct_ref = 1;
        return ret;
        }
@@ -373,8 +372,7 @@ int ENGINE_free(ENGINE *e)
                abort();
                }
 #endif
-       if(e->flags & ENGINE_FLAGS_MALLOCED)
-               OPENSSL_free(e);
+       OPENSSL_free(e);
        return 1;
        }