summaryrefslogtreecommitdiff
path: root/src/lib/emile
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2015-03-17 08:50:10 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 09:58:18 +0100
commitee57de59c2be5fc6151abab0d98d241153ba2d11 (patch)
treecd5dae164a85d849f037da6be924493461a7dae0 /src/lib/emile
parente649992bffb7c76ef0290ecba1dac15d45a8169f (diff)
emile: remove left over #ifdef
Diffstat (limited to 'src/lib/emile')
-rw-r--r--src/lib/emile/emile_cipher_gnutls.c16
-rw-r--r--src/lib/emile/emile_cipher_openssl.c12
2 files changed, 7 insertions, 21 deletions
diff --git a/src/lib/emile/emile_cipher_gnutls.c b/src/lib/emile/emile_cipher_gnutls.c
index 92823fa75f..f69d25d346 100644
--- a/src/lib/emile/emile_cipher_gnutls.c
+++ b/src/lib/emile/emile_cipher_gnutls.c
@@ -6,11 +6,9 @@
6# include <netinet/in.h> 6# include <netinet/in.h>
7#endif 7#endif
8 8
9#ifdef HAVE_GNUTLS 9#include <gnutls/abstract.h>
10# include <gnutls/abstract.h> 10#include <gnutls/x509.h>
11# include <gnutls/x509.h> 11#include <gcrypt.h>
12# include <gcrypt.h>
13#endif /* ifdef HAVE_CIPHER */
14 12
15#include <Eina.h> 13#include <Eina.h>
16 14
@@ -21,7 +19,6 @@
21#define MAX_KEY_LEN 32 19#define MAX_KEY_LEN 32
22#define MAX_IV_LEN 16 20#define MAX_IV_LEN 16
23 21
24#ifdef HAVE_GNUTLS
25static int 22static int
26_emile_thread_mutex_init(void **priv) 23_emile_thread_mutex_init(void **priv)
27{ 24{
@@ -70,12 +67,10 @@ static struct gcry_thread_cbs _emile_threads = {
70 _emile_thread_mutex_lock, _emile_thread_mutex_unlock, 67 _emile_thread_mutex_lock, _emile_thread_mutex_unlock,
71 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL 68 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
72}; 69};
73#endif /* ifdef HAVE_GNUTLS */
74 70
75Eina_Bool 71Eina_Bool
76_emile_cipher_init(void) 72_emile_cipher_init(void)
77{ 73{
78#ifdef HAVE_GNUTLS
79 if (gcry_control(GCRYCTL_SET_THREAD_CBS, &_emile_threads)) 74 if (gcry_control(GCRYCTL_SET_THREAD_CBS, &_emile_threads))
80 WRN( 75 WRN(
81 "YOU ARE USING PTHREADS, BUT I CANNOT INITIALIZE THREADSAFE GCRYPT OPERATIONS!"); 76 "YOU ARE USING PTHREADS, BUT I CANNOT INITIALIZE THREADSAFE GCRYPT OPERATIONS!");
@@ -101,12 +96,10 @@ _emile_cipher_init(void)
101 96
102 if (gnutls_global_init()) 97 if (gnutls_global_init())
103 return EINA_FALSE; 98 return EINA_FALSE;
104#endif /* ifdef HAVE_GNUTLS */
105 99
106 return EINA_TRUE; 100 return EINA_TRUE;
107} 101}
108 102
109# ifdef HAVE_GNUTLS
110static inline Eina_Bool 103static inline Eina_Bool
111emile_hmac_sha1(const void *key, 104emile_hmac_sha1(const void *key,
112 size_t key_len, 105 size_t key_len,
@@ -145,8 +138,6 @@ emile_hmac_sha1(const void *key,
145 138
146 return EINA_TRUE; 139 return EINA_TRUE;
147} 140}
148# endif /* ifdef HAVE_GNUTLS */
149
150 141
151static Eina_Bool 142static Eina_Bool
152emile_pbkdf2_sha1(const char *key, 143emile_pbkdf2_sha1(const char *key,
@@ -200,7 +191,6 @@ emile_pbkdf2_sha1(const char *key,
200 return EINA_TRUE; 191 return EINA_TRUE;
201} 192}
202 193
203
204EAPI Eina_Binbuf * 194EAPI Eina_Binbuf *
205emile_binbuf_cipher(const Eina_Binbuf *data, 195emile_binbuf_cipher(const Eina_Binbuf *data,
206 const char *key, 196 const char *key,
diff --git a/src/lib/emile/emile_cipher_openssl.c b/src/lib/emile/emile_cipher_openssl.c
index 9229e776f1..fdb36a5f8e 100644
--- a/src/lib/emile/emile_cipher_openssl.c
+++ b/src/lib/emile/emile_cipher_openssl.c
@@ -6,12 +6,10 @@
6# include <netinet/in.h> 6# include <netinet/in.h>
7#endif 7#endif
8 8
9#ifdef HAVE_OPENSSL 9#include <openssl/sha.h>
10# include <openssl/sha.h> 10#include <openssl/evp.h>
11# include <openssl/evp.h> 11#include <openssl/hmac.h>
12# include <openssl/hmac.h> 12#include <openssl/rand.h>
13# include <openssl/rand.h>
14#endif /* ifdef HAVE_GNUTLS */
15 13
16#include <Eina.h> 14#include <Eina.h>
17 15
@@ -25,12 +23,10 @@
25Eina_Bool 23Eina_Bool
26_emile_cipher_init(void) 24_emile_cipher_init(void)
27{ 25{
28#ifdef HAVE_OPENSSL
29 ERR_load_crypto_strings(); 26 ERR_load_crypto_strings();
30 SSL_library_init(); 27 SSL_library_init();
31 SSL_load_error_strings(); 28 SSL_load_error_strings();
32 OpenSSL_add_all_algorithms(); 29 OpenSSL_add_all_algorithms();
33#endif /* ifdef HAVE_OPENSSL */
34 30
35 return EINA_TRUE; 31 return EINA_TRUE;
36} 32}