From: Hosang Kim Date: Tue, 7 Feb 2017 21:41:34 +0000 (-0800) Subject: emile: don't use APIs deprecated in openssl-1.1 X-Git-Tag: upstream/1.20.0~2154 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6f9df2bb3d5579bd6de8b8493c3a6770de46464e;p=platform%2Fupstream%2Fefl.git emile: don't use APIs deprecated in openssl-1.1 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 --- diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c index 9e0cc04..0d63b6f 100644 --- a/src/lib/emile/emile_cipher_openssl.c +++ b/src/lib/emile/emile_cipher_openssl.c @@ -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); diff --git a/src/lib/emile/emile_main.c b/src/lib/emile/emile_main.c index c466776..de96269 100644 --- a/src/lib/emile/emile_main.c +++ b/src/lib/emile/emile_main.c @@ -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);