]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Add OpenSSL version check around ECDH
authorTravis Cross <tc@traviscross.com>
Thu, 6 Feb 2014 22:06:04 +0000 (22:06 +0000)
committerTravis Cross <tc@traviscross.com>
Sun, 9 Feb 2014 22:33:52 +0000 (22:33 +0000)
...we'll try to support ancient OpenSSL versions on v1.2 for awhile
longer.

libs/sofia-sip/libsofia-sip-ua/tport/tport_tls.c

index 33432283efc8a18b643c63441b23c0d8586f57fa..6da5f0a6bba41917121673c12b877a27a480ff76 100644 (file)
@@ -266,6 +266,8 @@ int tls_verify_cb(int ok, X509_STORE_CTX *store)
 static
 int tls_init_ecdh_curve(tls_t *tls)
 {
+#if OPENSSL_VERSION_NUMBER >= 0x0090800fL
+#ifndef OPENSSL_NO_ECDH
   int nid;
   EC_KEY *ecdh;
   if (!(nid = OBJ_sn2nid("prime256v1"))) {
@@ -282,6 +284,9 @@ int tls_init_ecdh_curve(tls_t *tls)
   SSL_CTX_set_tmp_ecdh(tls->ctx, ecdh);
   EC_KEY_free(ecdh);
   return 0;
+#endif
+#endif
+  return -1;
 }
 
 static