1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-04-27 22:32:31 +02:00

evmctl: Handle failure to initialize the openssl engine

Handle failure to initialize the openssl engine. For example,

$ ./src/evmctl --engine foo
engine foo isn't available
140322992015168:error:25066067:DSO support routines:dlfcn_load:could not load the shared library:crypto/dso/dso_dlfcn.c:118:filename(/usr/lib64/engines-1.1/foo.so): /usr/lib64/engines-1.1/foo.so: cannot open shared object file: No such file or directory
140322992015168:error:25070067:DSO support routines:DSO_load:could not load the shared library:crypto/dso/dso_lib.c:162:
140322992015168:error:260B6084:engine routines:dynamic_load:dso not found:crypto/engine/eng_dyn.c:414:
140322992015168:error:2606A074:engine routines:ENGINE_by_id:no such engine:crypto/engine/eng_list.c:334:id=foo
Segmentation fault (core dumped)

Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Stefan Berger 2021-09-13 18:18:06 -04:00 committed by Mimi Zohar
parent 6fbb2a305b
commit 47510a1050

View File

@ -2774,7 +2774,10 @@ int main(int argc, char *argv[])
ENGINE_free(eng);
eng = NULL;
}
ENGINE_set_default(eng, ENGINE_METHOD_ALL);
if (eng)
ENGINE_set_default(eng, ENGINE_METHOD_ALL);
else
goto error;
break;
case 140: /* --xattr-user */
xattr_ima = "user.ima";
@ -2848,6 +2851,7 @@ int main(int argc, char *argv[])
err = 125;
}
error:
if (eng) {
ENGINE_finish(eng);
ENGINE_free(eng);