From dcd87618ab9a76ef41141913f431aa4ad85a3840 Mon Sep 17 00:00:00 2001 From: Geoff Thorpe Date: Wed, 18 Apr 2001 03:03:16 +0000 Subject: [PATCH] Some more tweaks to ENGINE code. 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 | 3 +++ crypto/engine/engine_int.h | 4 ++-- crypto/engine/engine_list.c | 4 +--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/crypto/engine/engine.h b/crypto/engine/engine.h index ef144f9e01..2674bb1aa2 100644 --- a/crypto/engine/engine.h +++ b/crypto/engine/engine.h @@ -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 diff --git a/crypto/engine/engine_int.h b/crypto/engine/engine_int.h index 28bf3b1bf6..6e9c4ac61f 100644 --- a/crypto/engine/engine_int.h +++ b/crypto/engine/engine_int.h @@ -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. */ diff --git a/crypto/engine/engine_list.c b/crypto/engine/engine_list.c index a7432c3f68..6f184d8119 100644 --- a/crypto/engine/engine_list.c +++ b/crypto/engine/engine_list.c @@ -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; } -- 2.25.1