Commit dcd87618 authored by Geoff Thorpe's avatar Geoff Thorpe
Browse files

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.
parent d54bf145
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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. */
+1 −3
Original line number Diff line number Diff line
@@ -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,7 +372,6 @@ int ENGINE_free(ENGINE *e)
		abort();
		}
#endif
	if(e->flags & ENGINE_FLAGS_MALLOCED)
	OPENSSL_free(e);
	return 1;
	}