tpm2-tss-engine icon indicating copy to clipboard operation
tpm2-tss-engine copied to clipboard

TPM engine couldn't load when loading the tpm engine more than once with 1.2.0 version of TPM2-TSS-ENGINE

Open shrikant1407 opened this issue 1 year ago • 1 comments

we are trying to load the TPM engine using OpenSSL API as follows:

ENGINE_load_dynamic();
engine = ENGINE_by_id("dynamic");
if (engine == NULL) {
	LOG(LOG_ERROR, "Could not find external engine.\n");
	goto error;
}

if (!ENGINE_ctrl_cmd_string(engine, "SO_PATH", TPM2_TSS_ENGINE_SO_PATH,
				    0)) {
	LOG(LOG_ERROR, "Could not set TPM Engine path.\n");
	goto error;
}

if (!ENGINE_ctrl_cmd_string(engine, "LOAD", NULL, 0)) {
	LOG(LOG_ERROR, "Could not load TPM engine.\n");
	goto error;
}

The flow for loading such an engine is triggered by ENGINE_ctrl_cmd_string(engine, "SO_PATH", TPM2_TSS_ENGINE_SO_PATH, 0), and when using a dynamic path it will dynamically load the engine's .sofile. Our application needs to load the TPM engine more than once but it's not able to load at the second instance. The same configuration was working with 1.1.0 version of TPM2-TSS-ENGINE

shrikant1407 avatar Mar 29 '23 11:03 shrikant1407

Could you provide me with a complete snippet that we can add to the tests ?

AndreasFuchsTPM avatar May 22 '23 13:05 AndreasFuchsTPM