fix the hardcoded "pkcs11" engine id

Use the `-pkcs11engine` value if available for the engine id
instead of the hardcoded `pkcs11` string.
This should address #152.
This commit is contained in:
Michał Trojnara 2022-08-04 11:56:57 +02:00
parent abf5aa68f8
commit b8d83bb15e

View File

@ -5163,7 +5163,8 @@ static ENGINE *dynamic_engine(GLOBAL_OPTIONS *options)
return NULL; /* FAILED */
}
if (!ENGINE_ctrl_cmd_string(engine, "SO_PATH", options->p11engine, 0)
|| !ENGINE_ctrl_cmd_string(engine, "ID", "pkcs11", 0)
|| !ENGINE_ctrl_cmd_string(engine, "ID",
options->p11engine ? options->p11engine : "pkcs11", 0)
|| !ENGINE_ctrl_cmd_string(engine, "LIST_ADD", "1", 0)
|| !ENGINE_ctrl_cmd_string(engine, "LOAD", NULL, 0)) {
printf("Failed to set 'dynamic' engine\n");