emile: don't use APIs deprecated in openssl-1.1
authorHosang Kim <hosang12.kim@samsung.com>
Tue, 7 Feb 2017 21:41:34 +0000 (13:41 -0800)
committerCedric BAIL <cedric@osg.samsung.com>
Tue, 7 Feb 2017 22:17:47 +0000 (14:17 -0800)
Summary:
When openssl-1.1.0 is built with `--api=1.1 disable-deprecated`, use of
deprecated APIs leads to build failures.

X-Gentoo-Bug: 606628
X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=606628

Subscribers: cedric, jpeg

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D4616

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
src/lib/emile/emile_cipher_openssl.c
src/lib/emile/emile_main.c

index 9e0cc04..0d63b6f 100644 (file)
@@ -49,10 +49,12 @@ struct _Emile_SSL
 Eina_Bool
 _emile_cipher_init(void)
 {
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
    ERR_load_crypto_strings();
    SSL_library_init();
    SSL_load_error_strings();
    OpenSSL_add_all_algorithms();
+#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
 
    return EINA_TRUE;
 }
@@ -192,8 +194,10 @@ on_error:
    memset(ik, 0, sizeof (ik));
 
    /* Openssl error */
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
    if (ctx)
      EVP_CIPHER_CTX_cleanup(ctx);
+#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
 
    free(buffer);
 
index c466776..de96269 100644 (file)
@@ -103,10 +103,10 @@ emile_shutdown(void)
          */
         gnutls_global_deinit();
 #endif /* ifdef HAVE_GNUTLS */
-#ifdef HAVE_OPENSSL
+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
         EVP_cleanup();
         ERR_free_strings();
-#endif /* ifdef HAVE_OPENSSL */
+#endif /* if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)) */
      }
 
    eina_log_domain_unregister(_emile_log_dom_global);