@@ -4125,7 +4125,7 @@ static int read_pkcs7_certfile(GLOBAL_OPTIONS *options)
41254125 * [in] options: structure holds the input data
41264126 * [returns] pointer to ENGINE
41274127 */
4128- static ENGINE * engine_dynamic (GLOBAL_OPTIONS * options )
4128+ static ENGINE * engine_dynamic (const char * path )
41294129{
41304130 ENGINE * engine ;
41314131 char * id ;
@@ -4135,26 +4135,26 @@ static ENGINE *engine_dynamic(GLOBAL_OPTIONS *options)
41354135 fprintf (stderr , "Failed to load 'dynamic' engine\n" );
41364136 return NULL ; /* FAILED */
41374137 }
4138- if (options -> p11engine ) { /* strip directory and extension */
4138+ if (path ) { /* strip directory and extension */
41394139 char * ptr ;
41404140
4141- ptr = strrchr (options -> p11engine , '/' );
4141+ ptr = strrchr (path , '/' );
41424142 if (!ptr ) /* no slash -> try backslash */
4143- ptr = strrchr (options -> p11engine , '\\' );
4143+ ptr = strrchr (path , '\\' );
41444144 if (ptr ) { /* directory separator found */
41454145 ptr ++ ; /* skip it */
41464146 if (!strncmp (ptr , "lib" , 3 ))
41474147 ptr += 3 ; /* skip the "lib" prefix */
41484148 } else /* directory separator not found */
4149- ptr = options -> p11engine ;
4149+ ptr = ( char * ) path ;
41504150 id = OPENSSL_strdup (ptr );
41514151 ptr = strchr (id , '.' );
41524152 if (ptr ) /* file extensions found */
41534153 * ptr = '\0' ; /* remove them */
41544154 } else {
41554155 id = OPENSSL_strdup ("pkcs11" );
41564156 }
4157- if (!ENGINE_ctrl_cmd_string (engine , "SO_PATH" , options -> p11engine , 0 )
4157+ if (!ENGINE_ctrl_cmd_string (engine , "SO_PATH" , path , 0 )
41584158 || !ENGINE_ctrl_cmd_string (engine , "ID" , id , 0 )
41594159 || !ENGINE_ctrl_cmd_string (engine , "LIST_ADD" , "1" , 0 )
41604160 || !ENGINE_ctrl_cmd_string (engine , "LOAD" , NULL , 0 )) {
@@ -4250,7 +4250,7 @@ static int engine_load(GLOBAL_OPTIONS *options)
42504250
42514251 if (strchr (id , '.' )) {
42524252 /* Treat strings with a dot as paths to dynamic engine modules */
4253- engine = engine_dynamic (options );
4253+ engine = engine_dynamic (id );
42544254 } else {
42554255 /* Treat strings without a dot as engine IDs */
42564256 engine = ENGINE_by_id (id );
0 commit comments