openssl: OpenSSL 1.1.0 is thread-safe so we don't have to setup callbacks
authorTobias Brunner <tobias@strongswan.org>
Mon, 27 Jun 2016 09:01:43 +0000 (11:01 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 29 Jun 2016 09:09:36 +0000 (11:09 +0200)
src/libstrongswan/plugins/openssl/openssl_plugin.c

index e5c1dc0..ef02676 100644 (file)
@@ -66,6 +66,11 @@ struct private_openssl_plugin_t {
 };
 
 /**
+ * OpenSSL is thread-safe since 1.1.0
+ */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+
+/**
  * Array of static mutexs, with CRYPTO_num_locks() mutex
  */
 static mutex_t **mutex = NULL;
@@ -227,6 +232,14 @@ static void threading_cleanup()
        cleanup->destroy(cleanup);
 }
 
+#else /* OPENSSL_VERSION_NUMBER */
+
+#define threading_init()
+
+#define threading_cleanup()
+
+#endif
+
 /**
  * Seed the OpenSSL RNG, if required
  */