X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fengine%2Fengine_dyn.c;h=1e5eded1ee976d497fb28a3c7a63f077c42e5f96;hp=d4f00f7b6a57f29867d12b1a78a6a284194a1796;hb=e5e6a94fbf9fbf2dcc3f3f6865b2e4b584b282fa;hpb=d9ff8890736369d0f549e52fa6adcd4d24ace588 diff --git a/crypto/engine/engine_dyn.c b/crypto/engine/engine_dyn.c index d4f00f7b6a..1e5eded1ee 100644 --- a/crypto/engine/engine_dyn.c +++ b/crypto/engine/engine_dyn.c @@ -375,13 +375,21 @@ static int dynamic_load(ENGINE *e, dynamic_data_ctx *ctx) /* First binary copy the ENGINE structure so that we can roll back if * the hand-over fails */ memcpy(&cpy, e, sizeof(ENGINE)); - /* Provide the ERR, "ex_data", and memory callbacks so the loaded - * library uses our own state (and locking) rather than its own. */ + /* Provide the ERR, "ex_data", memory, and locking callbacks so the + * loaded library uses our state rather than its own. FIXME: As noted in + * engine.h, much of this would be simplified if each area of code + * provided its own "summary" structure of all related callbacks. It + * would also increase opaqueness. */ fns.err_fns = ERR_get_implementation(); fns.ex_data_fns = CRYPTO_get_ex_data_implementation(); CRYPTO_get_mem_functions(&fns.mem_fns.malloc_cb, &fns.mem_fns.realloc_cb, &fns.mem_fns.free_cb); + fns.lock_fns.lock_locking_cb = CRYPTO_get_locking_callback(); + fns.lock_fns.lock_add_lock_cb = CRYPTO_get_add_lock_callback(); + fns.lock_fns.dynlock_create_cb = CRYPTO_get_dynlock_create_callback(); + fns.lock_fns.dynlock_lock_cb = CRYPTO_get_dynlock_lock_callback(); + fns.lock_fns.dynlock_destroy_cb = CRYPTO_get_dynlock_destroy_callback(); /* Try to bind the ENGINE onto our own ENGINE structure */ if(!ctx->bind_engine(e, ctx->engine_id, &fns)) {