]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
apps/cmp.c: check and exit on engine load error
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>
Fri, 27 Nov 2020 19:45:21 +0000 (20:45 +0100)
committerDr. David von Oheimb <dev@ddvo.net>
Thu, 4 Feb 2021 06:25:14 +0000 (07:25 +0100)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13551)

apps/cmp.c

index 66c4b702d61296446fa95b93cbff39174f1cb5fb..1dbd1f73399c68fcdb07a4eeeb62974067a01f76 100644 (file)
@@ -2716,8 +2716,13 @@ int cmp_main(int argc, char **argv)
     if (opt_batch)
         set_base_ui_method(UI_null());
 
-    if (opt_engine != NULL)
+    if (opt_engine != NULL) {
         engine = setup_engine_methods(opt_engine, 0 /* not: ENGINE_METHOD_ALL */, 0);
+        if (engine == NULL) {
+            CMP_err1("cannot load engine %s", opt_engine);
+            goto err;
+        }
+    }
 
     if (opt_port != NULL) {
         if (opt_use_mock_srv) {