summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-04 17:44:13 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2017-01-04 17:47:38 +0900
commit2842165415a637939d24aa3e4a40fec0bba84f42 (patch)
treea86fa7f744ca914f7df35e565a28fffb4caa5b95 /src/lib/emile
parent0ac95c40bcac812d1249b53814b94ccda3603cf9 (diff)
openssl 1.1 build break fixes
this fixes building against openssl 1.1 since it broke api in various ways by hiding structs and deprecating api's (this causes warnings not breaks unlike the struct hiding). this adapts to these changes and makes efl build again. @fix
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_cipher_openssl.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c
index efd9324a5c..9e0cc04422 100644
--- a/src/lib/emile/emile_cipher_openssl.c
+++ b/src/lib/emile/emile_cipher_openssl.c
@@ -75,6 +75,16 @@ emile_binbuf_sha1(const Eina_Binbuf * data, unsigned char digest[20])
75{ 75{
76 const EVP_MD *md = EVP_sha1(); 76 const EVP_MD *md = EVP_sha1();
77 Eina_Slice slice = eina_binbuf_slice_get(data); 77 Eina_Slice slice = eina_binbuf_slice_get(data);
78#if OPENSSL_VERSION_NUMBER >= 0x10100000L && !defined(LIBRESSL_VERSION_NUMBER)
79 EVP_MD_CTX *ctx = EVP_MD_CTX_new();
80
81 EVP_DigestInit_ex(ctx, md, NULL);
82
83 EVP_DigestUpdate(ctx, slice.mem, slice.len);
84 EVP_DigestFinal_ex(ctx, digest, NULL);
85
86 EVP_MD_CTX_free(ctx);
87#else
78 EVP_MD_CTX ctx; 88 EVP_MD_CTX ctx;
79 89
80 EVP_MD_CTX_init(&ctx); 90 EVP_MD_CTX_init(&ctx);
@@ -84,6 +94,7 @@ emile_binbuf_sha1(const Eina_Binbuf * data, unsigned char digest[20])
84 EVP_DigestFinal_ex(&ctx, digest, NULL); 94 EVP_DigestFinal_ex(&ctx, digest, NULL);
85 95
86 EVP_MD_CTX_cleanup(&ctx); 96 EVP_MD_CTX_cleanup(&ctx);
97#endif
87 return EINA_TRUE; 98 return EINA_TRUE;
88} 99}
89 100
@@ -308,9 +319,11 @@ emile_cipher_server_listen(Emile_Cipher_Type t)
308 SSL_CTX_set_options(r->ssl_ctx, 319 SSL_CTX_set_options(r->ssl_ctx,
309 options | SSL_OP_NO_SSLv2 | SSL_OP_SINGLE_DH_USE); 320 options | SSL_OP_NO_SSLv2 | SSL_OP_SINGLE_DH_USE);
310 break; 321 break;
322#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
311 case EMILE_TLSv1: 323 case EMILE_TLSv1:
312 r->ssl_ctx = SSL_CTX_new(TLSv1_server_method()); 324 r->ssl_ctx = SSL_CTX_new(TLSv1_server_method());
313 break; 325 break;
326#endif
314 default: 327 default:
315 free(r); 328 free(r);
316 return NULL; 329 return NULL;
@@ -754,8 +767,10 @@ emile_cipher_server_connect(Emile_Cipher_Type t)
754 options | SSL_OP_NO_SSLv2 | SSL_OP_SINGLE_DH_USE); 767 options | SSL_OP_NO_SSLv2 | SSL_OP_SINGLE_DH_USE);
755 break; 768 break;
756 case EMILE_TLSv1: 769 case EMILE_TLSv1:
770#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
757 r->ssl_ctx = SSL_CTX_new(TLSv1_client_method()); 771 r->ssl_ctx = SSL_CTX_new(TLSv1_client_method());
758 break; 772 break;
773#endif
759 default: 774 default:
760 free(r); 775 free(r);
761 return NULL; 776 return NULL;