Lines Matching defs:ctx
31 static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx);
142 dynamic_data_ctx *ctx = (dynamic_data_ctx *)ptr;
143 DSO_free(ctx->dynamic_dso);
144 OPENSSL_free(ctx->DYNAMIC_LIBNAME);
145 OPENSSL_free(ctx->engine_id);
146 sk_OPENSSL_STRING_pop_free(ctx->dirs, int_free_str);
147 OPENSSL_free(ctx);
157 static int dynamic_set_data_ctx(ENGINE *e, dynamic_data_ctx **ctx)
176 if ((*ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e,
182 *ctx = c;
189 * If we lost the race to set the context, c is non-NULL and *ctx is the
205 dynamic_data_ctx *ctx;
232 ctx = (dynamic_data_ctx *)ENGINE_get_ex_data(e, dynamic_ex_data_idx);
234 if ((ctx == NULL) && !dynamic_set_data_ctx(e, &ctx))
237 return ctx;
299 dynamic_data_ctx *ctx = dynamic_get_data_ctx(e);
302 if (!ctx) {
306 initialised = ((ctx->dynamic_dso == NULL) ? 0 : 1);
317 OPENSSL_free(ctx->DYNAMIC_LIBNAME);
319 ctx->DYNAMIC_LIBNAME = OPENSSL_strdup(p);
321 ctx->DYNAMIC_LIBNAME = NULL;
322 return (ctx->DYNAMIC_LIBNAME ? 1 : 0);
324 ctx->no_vcheck = ((i == 0) ? 0 : 1);
330 OPENSSL_free(ctx->engine_id);
332 ctx->engine_id = OPENSSL_strdup(p);
334 ctx->engine_id = NULL;
335 return (ctx->engine_id ? 1 : 0);
341 ctx->list_add_value = (int)i;
344 return dynamic_load(e, ctx);
350 ctx->dir_load = (int)i;
364 if (!sk_OPENSSL_STRING_push(ctx->dirs, tmp_str)) {
378 static int int_load(dynamic_data_ctx *ctx)
382 if ((ctx->dir_load != 2) && (DSO_load(ctx->dynamic_dso,
383 ctx->DYNAMIC_LIBNAME, NULL,
387 if (!ctx->dir_load || (num = sk_OPENSSL_STRING_num(ctx->dirs)) < 1)
390 const char *s = sk_OPENSSL_STRING_value(ctx->dirs, loop);
391 char *merge = DSO_merge(ctx->dynamic_dso, ctx->DYNAMIC_LIBNAME, s);
394 if (DSO_load(ctx->dynamic_dso, merge, NULL, 0)) {
413 static int using_libcrypto_11(dynamic_data_ctx *ctx)
418 ret = DSO_bind_func(ctx->dynamic_dso, "EVP_PKEY_base_id") != NULL;
424 static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx)
429 if (ctx->dynamic_dso == NULL)
430 ctx->dynamic_dso = DSO_new();
431 if (ctx->dynamic_dso == NULL)
433 if (!ctx->DYNAMIC_LIBNAME) {
434 if (!ctx->engine_id)
436 DSO_ctrl(ctx->dynamic_dso, DSO_CTRL_SET_FLAGS,
438 ctx->DYNAMIC_LIBNAME =
439 DSO_convert_filename(ctx->dynamic_dso, ctx->engine_id);
441 if (!int_load(ctx)) {
443 DSO_free(ctx->dynamic_dso);
444 ctx->dynamic_dso = NULL;
449 (ctx->bind_engine =
450 (dynamic_bind_engine) DSO_bind_func(ctx->dynamic_dso,
451 ctx->DYNAMIC_F2))) {
452 ctx->bind_engine = NULL;
453 DSO_free(ctx->dynamic_dso);
454 ctx->dynamic_dso = NULL;
459 if (!ctx->no_vcheck) {
465 ctx->v_check =
466 (dynamic_v_check_fn) DSO_bind_func(ctx->dynamic_dso,
467 ctx->DYNAMIC_F1);
468 if (ctx->v_check)
469 vcheck_res = ctx->v_check(OSSL_DYNAMIC_VERSION);
475 if (vcheck_res < OSSL_DYNAMIC_OLDEST || using_libcrypto_11(ctx)) {
477 ctx->bind_engine = NULL;
478 ctx->v_check = NULL;
479 DSO_free(ctx->dynamic_dso);
480 ctx->dynamic_dso = NULL;
507 if (!engine_add_dynamic_id(e, (ENGINE_DYNAMIC_ID)ctx->bind_engine, 1)
508 || !ctx->bind_engine(e, ctx->engine_id, &fns)) {
510 ctx->bind_engine = NULL;
511 ctx->v_check = NULL;
512 DSO_free(ctx->dynamic_dso);
513 ctx->dynamic_dso = NULL;
520 if (ctx->list_add_value > 0) {
523 if (ctx->list_add_value > 1) {