summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/engine')
-rw-r--r--src/lib/libcrypto/engine/eng_cnf.c2
-rw-r--r--src/lib/libcrypto/engine/eng_dyn.c24
-rw-r--r--src/lib/libcrypto/engine/eng_fat.c2
3 files changed, 21 insertions, 7 deletions
diff --git a/src/lib/libcrypto/engine/eng_cnf.c b/src/lib/libcrypto/engine/eng_cnf.c
index 8c0ae8a1ad..cdf670901a 100644
--- a/src/lib/libcrypto/engine/eng_cnf.c
+++ b/src/lib/libcrypto/engine/eng_cnf.c
@@ -92,7 +92,7 @@ static int int_engine_init(ENGINE *e)
92 } 92 }
93 93
94 94
95int int_engine_configure(char *name, char *value, const CONF *cnf) 95static int int_engine_configure(char *name, char *value, const CONF *cnf)
96 { 96 {
97 int i; 97 int i;
98 int ret = 0; 98 int ret = 0;
diff --git a/src/lib/libcrypto/engine/eng_dyn.c b/src/lib/libcrypto/engine/eng_dyn.c
index 4fefcc0cae..4139a16e76 100644
--- a/src/lib/libcrypto/engine/eng_dyn.c
+++ b/src/lib/libcrypto/engine/eng_dyn.c
@@ -157,6 +157,10 @@ static void dynamic_data_ctx_free_func(void *parent, void *ptr,
157 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr; 157 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
158 if(ctx->dynamic_dso) 158 if(ctx->dynamic_dso)
159 DSO_free(ctx->dynamic_dso); 159 DSO_free(ctx->dynamic_dso);
160 if(ctx->DYNAMIC_LIBNAME)
161 OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);
162 if(ctx->engine_id)
163 OPENSSL_free((void*)ctx->engine_id);
160 OPENSSL_free(ctx); 164 OPENSSL_free(ctx);
161 } 165 }
162 } 166 }
@@ -169,7 +173,7 @@ static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
169 { 173 {
170 dynamic_data_ctx *c; 174 dynamic_data_ctx *c;
171 c = OPENSSL_malloc(sizeof(dynamic_data_ctx)); 175 c = OPENSSL_malloc(sizeof(dynamic_data_ctx));
172 if(!ctx) 176 if(!c)
173 { 177 {
174 ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE); 178 ENGINEerr(ENGINE_F_SET_DATA_CTX,ERR_R_MALLOC_FAILURE);
175 return 0; 179 return 0;
@@ -310,8 +314,13 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
310 /* a NULL 'p' or a string of zero-length is the same thing */ 314 /* a NULL 'p' or a string of zero-length is the same thing */
311 if(p && (strlen((const char *)p) < 1)) 315 if(p && (strlen((const char *)p) < 1))
312 p = NULL; 316 p = NULL;
313 ctx->DYNAMIC_LIBNAME = (const char *)p; 317 if(ctx->DYNAMIC_LIBNAME)
314 return 1; 318 OPENSSL_free((void*)ctx->DYNAMIC_LIBNAME);
319 if(p)
320 ctx->DYNAMIC_LIBNAME = BUF_strdup(p);
321 else
322 ctx->DYNAMIC_LIBNAME = NULL;
323 return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
315 case DYNAMIC_CMD_NO_VCHECK: 324 case DYNAMIC_CMD_NO_VCHECK:
316 ctx->no_vcheck = ((i == 0) ? 0 : 1); 325 ctx->no_vcheck = ((i == 0) ? 0 : 1);
317 return 1; 326 return 1;
@@ -319,8 +328,13 @@ static int dynamic_ctrl(ENGINE *e, int cmd, long i, void *p, void (*f)())
319 /* a NULL 'p' or a string of zero-length is the same thing */ 328 /* a NULL 'p' or a string of zero-length is the same thing */
320 if(p && (strlen((const char *)p) < 1)) 329 if(p && (strlen((const char *)p) < 1))
321 p = NULL; 330 p = NULL;
322 ctx->engine_id = (const char *)p; 331 if(ctx->engine_id)
323 return 1; 332 OPENSSL_free((void*)ctx->engine_id);
333 if(p)
334 ctx->engine_id = BUF_strdup(p);
335 else
336 ctx->engine_id = NULL;
337 return (ctx->engine_id ? 1 : 0);
324 case DYNAMIC_CMD_LIST_ADD: 338 case DYNAMIC_CMD_LIST_ADD:
325 if((i < 0) || (i > 2)) 339 if((i < 0) || (i > 2))
326 { 340 {
diff --git a/src/lib/libcrypto/engine/eng_fat.c b/src/lib/libcrypto/engine/eng_fat.c
index d49aa7ed40..f7edb5ad32 100644
--- a/src/lib/libcrypto/engine/eng_fat.c
+++ b/src/lib/libcrypto/engine/eng_fat.c
@@ -84,7 +84,7 @@ int ENGINE_set_default(ENGINE *e, unsigned int flags)
84 84
85/* Set default algorithms using a string */ 85/* Set default algorithms using a string */
86 86
87int int_def_cb(const char *alg, int len, void *arg) 87static int int_def_cb(const char *alg, int len, void *arg)
88 { 88 {
89 unsigned int *pflags = arg; 89 unsigned int *pflags = arg;
90 if (!strncmp(alg, "ALL", len)) 90 if (!strncmp(alg, "ALL", len))