avoid infinite recursion if dynamic engine isn't loaded
Submitted by: Jonathon Green <jonathon_au@yahoo.com>
This commit is contained in:
@@ -394,6 +394,9 @@ ENGINE *ENGINE_by_id(const char *id)
|
|||||||
#else
|
#else
|
||||||
/* EEK! Experimental code starts */
|
/* EEK! Experimental code starts */
|
||||||
if(iterator) return iterator;
|
if(iterator) return iterator;
|
||||||
|
/* Prevent infinite recusrion if we're looking for the dynamic engine. */
|
||||||
|
if (strcmp(id, "dynamic"))
|
||||||
|
{
|
||||||
#ifdef OPENSSL_SYS_VMS
|
#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
|
#else
|
||||||
@@ -407,6 +410,7 @@ ENGINE *ENGINE_by_id(const char *id)
|
|||||||
!ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
|
!ENGINE_ctrl_cmd_string(iterator, "LOAD", NULL, 0))
|
||||||
goto notfound;
|
goto notfound;
|
||||||
return iterator;
|
return iterator;
|
||||||
|
}
|
||||||
notfound:
|
notfound:
|
||||||
ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
|
ENGINEerr(ENGINE_F_ENGINE_BY_ID,ENGINE_R_NO_SUCH_ENGINE);
|
||||||
ERR_add_error_data(2, "id=", id);
|
ERR_add_error_data(2, "id=", id);
|
||||||
|
Reference in New Issue
Block a user