ENGINE fixes
authorDr. Stephen Henson <steve@openssl.org>
Fri, 23 Oct 2015 17:46:58 +0000 (18:46 +0100)
committerDr. Stephen Henson <steve@openssl.org>
Wed, 9 Dec 2015 22:09:18 +0000 (22:09 +0000)
Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/ec/ec_key.c
crypto/ec/ec_kmeth.c

index 477d4a26ba9606c3fba9534608e13c05164ae7d1..cb6bcdcbf266f2f410862eb8ab8442c06af45bbb 100644 (file)
@@ -65,6 +65,9 @@
 #include <string.h>
 #include "ec_lcl.h"
 #include <openssl/err.h>
+#ifndef OPENSSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
 
 EC_KEY *EC_KEY_new(void)
 {
@@ -104,6 +107,11 @@ void EC_KEY_free(EC_KEY *r)
     }
 #endif
 
+#ifndef OPENSSL_NO_ENGINE
+    if (r->engine)
+        ENGINE_finish(r->engine);
+#endif
+
     EC_GROUP_free(r->group);
     EC_POINT_free(r->pub_key);
     BN_clear_free(r->priv_key);
index 6be99c2265304155c6be3e6a5e06a8d0916b851c..4904989d63f784497e5b7ee53fe9e39efa160043 100644 (file)
@@ -53,7 +53,9 @@
  */
 
 #include <openssl/ec.h>
-#include <openssl/engine.h>
+#ifndef OPENSSL_NO_ENGINE
+# include <openssl/engine.h>
+#endif
 #include <openssl/err.h>
 #include "ec_lcl.h"