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
|
||||
/* 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]";
|
||||
#else
|
||||
@@ -407,6 +410,7 @@ ENGINE *ENGINE_by_id(const char *id)
|
||||
!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);
|
||||
|
Reference in New Issue
Block a user