X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fengine%2Feng_list.c;h=66a52b89e0c174d5acf1dfbdcfc66faf86b29631;hb=49436b59b505d9e49ac06e4d544d748f78689036;hp=55b646da2400ba254868039f6481209e04c7df71;hpb=314c667050065bac7d1b0b1a767af6ff9585a596;p=oweals%2Fopenssl.git diff --git a/crypto/engine/eng_list.c b/crypto/engine/eng_list.c index 55b646da24..66a52b89e0 100644 --- a/crypto/engine/eng_list.c +++ b/crypto/engine/eng_list.c @@ -61,10 +61,7 @@ * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project. */ -#include -#include "cryptlib.h" #include "eng_int.h" -#include /* The linked-list of pointers to engine types. engine_list_head * incorporates an implicit structural reference but engine_list_tail @@ -336,8 +333,10 @@ static void engine_cpy(ENGINE *dest, const ENGINE *src) dest->ecdsa_meth = src->ecdsa_meth; #endif dest->rand_meth = src->rand_meth; + dest->store_meth = src->store_meth; dest->ciphers = src->ciphers; dest->digests = src->digests; + dest->pkey_meths = src->pkey_meths; dest->destroy = src->destroy; dest->init = src->init; dest->finish = src->finish; @@ -396,19 +395,23 @@ ENGINE *ENGINE_by_id(const char *id) #else /* EEK! Experimental code starts */ if(iterator) return iterator; + /* Prevent infinite recusrion if we're looking for the dynamic engine. */ + if (strcmp(id, "dynamic")) + { #ifdef OPENSSL_SYS_VMS - if((load_dir = getenv("OPENSSL_ENGINES")) == 0) load_dir = "SSLROOT:[ENGINES]"; + if((load_dir = getenv("OPENSSL_ENGINES")) == 0) load_dir = "SSLROOT:[ENGINES]"; #else - if((load_dir = getenv("OPENSSL_ENGINES")) == 0) load_dir = OPENSSLDIR "/engines"; + if((load_dir = getenv("OPENSSL_ENGINES")) == 0) load_dir = ENGINESDIR; #endif - iterator = ENGINE_by_id("dynamic"); - if(!iterator || !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || - !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || - !ENGINE_ctrl_cmd_string(iterator, "DIR_ADD", - load_dir, 0) || - !ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0)) - goto notfound; - return iterator; + iterator = ENGINE_by_id("dynamic"); + if(!iterator || !ENGINE_ctrl_cmd_string(iterator, "ID", id, 0) || + !ENGINE_ctrl_cmd_string(iterator, "DIR_LOAD", "2", 0) || + !ENGINE_ctrl_cmd_string(iterator, "DIR_ADD", + load_dir, 0) || + !ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0)) + goto notfound; + return iterator; + } notfound: ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE); ERR_add_error_data(2, "id=", id);