Merge branch 'vendor/OPENSSL'
[dragonfly.git] / crypto / openssl / crypto / evp / pmeth_lib.c
index 19b4cc3..27e0c8d 100644 (file)
@@ -134,6 +134,8 @@ static EVP_PKEY_CTX *int_ctx_new(EVP_PKEY *pkey, ENGINE *e, int id)
                id = pkey->ameth->pkey_id;
                }
 #ifndef OPENSSL_NO_ENGINE
+       if (pkey && pkey->engine)
+               e = pkey->engine;
        /* Try to find an ENGINE which implements this method */
        if (e)
                {