X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fengine%2Feng_lib.c;h=18a66646458a9aa033abfdde32ce936229f75f57;hp=a66d0f08af26d8293aa768897138fb0a2f2ff365;hb=59d2d48f6470b6ef5e8c385c34dea1f253bfed62;hpb=e4a6cf421a57cd59ad6944151fea07af51e5e0ed diff --git a/crypto/engine/eng_lib.c b/crypto/engine/eng_lib.c index a66d0f08af..18a6664645 100644 --- a/crypto/engine/eng_lib.c +++ b/crypto/engine/eng_lib.c @@ -56,11 +56,8 @@ * */ -#include -#include "cryptlib.h" #include "eng_int.h" -#include /* FIXME: This shouldn't be needed */ -#include +#include /* The "new"/"free" stuff first */ @@ -92,6 +89,7 @@ void engine_set_all_null(ENGINE *e) e->dsa_meth = NULL; e->dh_meth = NULL; e->rand_meth = NULL; + e->store_meth = NULL; e->ciphers = NULL; e->digests = NULL; e->destroy = NULL; @@ -110,7 +108,7 @@ int engine_free_util(ENGINE *e, int locked) if(e == NULL) { - ENGINEerr(ENGINE_F_ENGINE_FREE, + ENGINEerr(ENGINE_F_ENGINE_FREE_UTIL, ERR_R_PASSED_NULL_PARAMETER); return 0; } @@ -127,6 +125,9 @@ int engine_free_util(ENGINE *e, int locked) abort(); } #endif + /* Free up any dynamically allocated public key methods */ + engine_pkey_meths_free(e); + engine_pkey_asn1_meths_free(e); /* Give the ENGINE a chance to do any structural cleanup corresponding * to allocation it did in its constructor (eg. unload error strings) */ if(e->destroy) @@ -319,3 +320,13 @@ const ENGINE_CMD_DEFN *ENGINE_get_cmd_defns(const ENGINE *e) { return e->cmd_defns; } + +/* eng_lib.o is pretty much linked into anything that touches ENGINE already, so + * put the "static_state" hack here. */ + +static int internal_static_hack = 0; + +void *ENGINE_get_static_state(void) + { + return &internal_static_hack; + }