summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine/eng_dyn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/engine/eng_dyn.c')
-rw-r--r--src/lib/libcrypto/engine/eng_dyn.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/engine/eng_dyn.c b/src/lib/libcrypto/engine/eng_dyn.c
index acb30c34d8..807da7a5eb 100644
--- a/src/lib/libcrypto/engine/eng_dyn.c
+++ b/src/lib/libcrypto/engine/eng_dyn.c
@@ -146,14 +146,14 @@ struct st_dynamic_data_ctx
146 * 'dirs' for loading. Default is to use 'dirs' as a fallback. */ 146 * 'dirs' for loading. Default is to use 'dirs' as a fallback. */
147 int dir_load; 147 int dir_load;
148 /* A stack of directories from which ENGINEs could be loaded */ 148 /* A stack of directories from which ENGINEs could be loaded */
149 STACK *dirs; 149 STACK_OF(OPENSSL_STRING) *dirs;
150 }; 150 };
151 151
152/* This is the "ex_data" index we obtain and reserve for use with our context 152/* This is the "ex_data" index we obtain and reserve for use with our context
153 * structure. */ 153 * structure. */
154static int dynamic_ex_data_idx = -1; 154static int dynamic_ex_data_idx = -1;
155 155
156static void int_free_str(void *s) { OPENSSL_free(s); } 156static void int_free_str(char *s) { OPENSSL_free(s); }
157/* Because our ex_data element may or may not get allocated depending on whether 157/* Because our ex_data element may or may not get allocated depending on whether
158 * a "first-use" occurs before the ENGINE is freed, we have a memory leak 158 * a "first-use" occurs before the ENGINE is freed, we have a memory leak
159 * problem to solve. We can't declare a "new" handler for the ex_data as we 159 * problem to solve. We can't declare a "new" handler for the ex_data as we
@@ -174,7 +174,7 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr,
174 if(ctx->engine_id) 174 if(ctx->engine_id)
175 OPENSSL_free((void*)ctx->engine_id); 175 OPENSSL_free((void*)ctx->engine_id);
176 if(ctx->dirs) 176 if(ctx->dirs)
177 sk_pop_free(ctx->dirs, int_free_str); 177 sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);
178 OPENSSL_free(ctx); 178 OPENSSL_free(ctx);
179 } 179 }
180 } 180 }
@@ -203,7 +203,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
203 c->DYNAMIC_F1 = "v_check"; 203 c->DYNAMIC_F1 = "v_check";
204 c->DYNAMIC_F2 = "bind_engine"; 204 c->DYNAMIC_F2 = "bind_engine";
205 c->dir_load = 1; 205 c->dir_load = 1;
206 c->dirs = sk_new_null(); 206 c->dirs = sk_OPENSSL_STRING_new_null();
207 if(!c->dirs) 207 if(!c->dirs)
208 { 208 {
209 ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE); 209 ENGINEerr(ENGINE_F_DYNAMIC_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
@@ -393,7 +393,7 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)(void))
393 ERR_R_MALLOC_FAILURE); 393 ERR_R_MALLOC_FAILURE);
394 return 0; 394 return 0;
395 } 395 }
396 sk_insert(ctx->dirs, tmp_str, -1); 396 sk_OPENSSL_STRING_insert(ctx->dirs, tmp_str, -1);
397 } 397 }
398 return 1; 398 return 1;
399 default: 399 default:
@@ -411,11 +411,11 @@ static int int_load(dynamic_data_ctx *ctx)
411 ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL) 411 ctx->DYNAMIC_LIBNAME, NULL, 0)) != NULL)
412 return 1; 412 return 1;
413 /* If we're not allowed to use 'dirs' or we have none, fail */ 413 /* If we're not allowed to use 'dirs' or we have none, fail */
414 if(!ctx->dir_load || ((num = sk_num(ctx->dirs)) < 1)) 414 if(!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1)
415 return 0; 415 return 0;
416 for(loop = 0; loop < num; loop++) 416 for(loop = 0; loop < num; loop++)
417 { 417 {
418 const char *s = sk_value(ctx->dirs, loop); 418 const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop);
419 char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s); 419 char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);
420 if(!merge) 420 if(!merge)
421 return 0; 421 return 0;