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 <cedric@osg.samsung.com>
This commit is contained in:
Hosang Kim 2017-02-07 13:41:34 -08:00 committed by Cedric BAIL
parent 15d46a419f
commit 6f9df2bb3d
2 changed files with 6 additions and 2 deletions

View File

@ -49,10 +49,12 @@ struct _Emile_SSL
Eina_Bool Eina_Bool
_emile_cipher_init(void) _emile_cipher_init(void)
{ {
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
ERR_load_crypto_strings(); ERR_load_crypto_strings();
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
OpenSSL_add_all_algorithms(); OpenSSL_add_all_algorithms();
#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
return EINA_TRUE; return EINA_TRUE;
} }
@ -192,8 +194,10 @@ on_error:
memset(ik, 0, sizeof (ik)); memset(ik, 0, sizeof (ik));
/* Openssl error */ /* Openssl error */
#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
if (ctx) if (ctx)
EVP_CIPHER_CTX_cleanup(ctx); EVP_CIPHER_CTX_cleanup(ctx);
#endif /* if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) */
free(buffer); free(buffer);

View File

@ -103,10 +103,10 @@ emile_shutdown(void)
*/ */
gnutls_global_deinit(); gnutls_global_deinit();
#endif /* ifdef HAVE_GNUTLS */ #endif /* ifdef HAVE_GNUTLS */
#ifdef HAVE_OPENSSL #if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER))
EVP_cleanup(); EVP_cleanup();
ERR_free_strings(); 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); eina_log_domain_unregister(_emile_log_dom_global);