From 13a2dacacccbdd3393421667b8292b9ab972cf85 Mon Sep 17 00:00:00 2001 From: bcook Date: Fri, 19 Jun 2015 07:18:58 +0000 Subject: [PATCH] Remove fallback dynamic engine loading support. 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 | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 54a3fee3446..2b2c0a9c1c5 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -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 * @@ -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; -- 2.20.1