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.
This commit is contained in:
Geoff Thorpe 2001-04-18 03:03:16 +00:00
parent d54bf14559
commit dcd87618ab
3 changed files with 6 additions and 5 deletions

View 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

View 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. */

View 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;
}