Remove fallback dynamic engine loading support.
authorbcook <bcook@openbsd.org>
Fri, 19 Jun 2015 07:18:58 +0000 (07:18 +0000)
committerbcook <bcook@openbsd.org>
Fri, 19 Jun 2015 07:18:58 +0000 (07:18 +0000)
Since we no longer have dynamic engines, don't bother falling back to them
if a builtin engine is not found first.

Before:

$ openssl dgst -engine unknown
invalid engine "unknown"
27256010481532:error:2606A074:engine routines:ENGINE_by_id:no such
engine:/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/engine/eng_list.c:384:id=unknown
27256010481532:error:2606A074:engine routines:ENGINE_by_id:no such
engine:/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/engine/eng_list.c:384:id=dynamic

After:

$ openssl dgst -engine unknown
invalid engine "unknown"
27256010481532:error:2606A074:engine routines:ENGINE_by_id:no such
engine:/usr/src/lib/libcrypto/crypto/../../libssl/src/crypto/engine/eng_list.c:384:id=unknown

ok doug@

usr.bin/openssl/apps.c

index 54a3fee..2b2c0a9 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: apps.c,v 1.26 2015/06/16 02:27:24 doug Exp $ */
+/* $OpenBSD: apps.c,v 1.27 2015/06/19 07:18:58 bcook Exp $ */
 /*
  * Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
  *
@@ -1251,21 +1251,6 @@ end:
 }
 
 #ifndef OPENSSL_NO_ENGINE
-/* Try to load an engine in a shareable library */
-static ENGINE *
-try_load_engine(BIO *err, const char *engine, int debug)
-{
-       ENGINE *e = ENGINE_by_id("dynamic");
-
-       if (e) {
-               if (!ENGINE_ctrl_cmd_string(e, "SO_PATH", engine, 0) ||
-                   !ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 0)) {
-                       ENGINE_free(e);
-                       e = NULL;
-               }
-       }
-       return e;
-}
 
 ENGINE *
 setup_engine(BIO *err, const char *engine, int debug)
@@ -1278,8 +1263,7 @@ setup_engine(BIO *err, const char *engine, int debug)
                        ENGINE_register_all_complete();
                        return NULL;
                }
-               if ((e = ENGINE_by_id(engine)) == NULL &&
-                   (e = try_load_engine(err, engine, debug)) == NULL) {
+               if ((e = ENGINE_by_id(engine)) == NULL) {
                        BIO_printf(err, "invalid engine \"%s\"\n", engine);
                        ERR_print_errors(err);
                        return NULL;