[openssl-commits] [openssl] OpenSSL_1_0_2-stable update

Richard Levitte levitte at openssl.org
Wed Sep 28 20:00:56 UTC 2016


The branch OpenSSL_1_0_2-stable has been updated
       via  53a71b7429a4315f7761bea1be20a6d0b9c9a502 (commit)
      from  a269e5f09a6e8f5b7a1f5ab92a90a41e61631e74 (commit)


- Log -----------------------------------------------------------------
commit 53a71b7429a4315f7761bea1be20a6d0b9c9a502
Author: Richard Levitte <levitte at openssl.org>
Date:   Wed Sep 28 21:28:00 2016 +0200

    apps/apps.c: initialize and de-initialize engine around key loading
    
    Before loading a key from an engine, it may need to be initialized.
    When done loading the key, we must de-initialize the engine.
    (if the engine is already initialized somehow, only the reference
    counter will be incremented then decremented)
    
    Reviewed-by: Stephen Henson <steve at openssl.org>
    (cherry picked from commit 49e476a5382602d0bad1139d6f1f66ddbc7959d6)

-----------------------------------------------------------------------

Summary of changes:
 apps/apps.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/apps/apps.c b/apps/apps.c
index 9fdc3e0..ff17b35 100644
--- a/apps/apps.c
+++ b/apps/apps.c
@@ -972,7 +972,10 @@ EVP_PKEY *load_key(BIO *err, const char *file, int format, int maybe_stdin,
         if (!e)
             BIO_printf(err, "no engine specified\n");
         else {
-            pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
+            if (ENGINE_init(e)) {
+                pkey = ENGINE_load_private_key(e, file, ui_method, &cb_data);
+                ENGINE_finish(e);
+            }
             if (!pkey) {
                 BIO_printf(err, "cannot load %s from engine\n", key_descrip);
                 ERR_print_errors(err);


More information about the openssl-commits mailing list