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:
parent
d54bf14559
commit
dcd87618ab
@ -83,6 +83,9 @@ extern "C" {
|
|||||||
#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
|
#define ENGINE_METHOD_ALL (unsigned int)0xFFFF
|
||||||
#define ENGINE_METHOD_NONE (unsigned int)0x0000
|
#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.
|
/* 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
|
* 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
|
* make sense to some engines. In such a case, they do nothing but return
|
||||||
|
@ -73,8 +73,8 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Bitwise OR-able values for the "flags" variable in ENGINE. */
|
/* NB: Bitwise OR-able values for the "flags" variable in ENGINE are now exposed
|
||||||
#define ENGINE_FLAGS_MALLOCED 0x0001
|
* in engine.h. */
|
||||||
|
|
||||||
/* This is a structure for storing implementations of various crypto
|
/* This is a structure for storing implementations of various crypto
|
||||||
* algorithms and functions. */
|
* algorithms and functions. */
|
||||||
|
@ -346,7 +346,6 @@ ENGINE *ENGINE_new(void)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
memset(ret, 0, sizeof(ENGINE));
|
memset(ret, 0, sizeof(ENGINE));
|
||||||
ret->flags = ENGINE_FLAGS_MALLOCED;
|
|
||||||
ret->struct_ref = 1;
|
ret->struct_ref = 1;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -373,7 +372,6 @@ int ENGINE_free(ENGINE *e)
|
|||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(e->flags & ENGINE_FLAGS_MALLOCED)
|
|
||||||
OPENSSL_free(e);
|
OPENSSL_free(e);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user