diff options
author | Cedric BAIL <cedric@osg.samsung.com> | 2015-03-17 08:50:40 +0100 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-03-17 09:58:20 +0100 |
commit | df20c9ff8e84024e9b6e5d9c36404f5de8796df1 (patch) | |
tree | 0537e10b00e7c02678b4cc324d77760e3244fe06 /src/lib/emile | |
parent | f4c5b3fd701277e13fe5c08a758552203b4824fb (diff) |
emile: implement emile_cipher_module_get in a useful way.
Diffstat (limited to 'src/lib/emile')
-rw-r--r-- | src/lib/emile/emile_cipher.h | 16 | ||||
-rw-r--r-- | src/lib/emile/emile_main.c | 14 |
2 files changed, 29 insertions, 1 deletions
diff --git a/src/lib/emile/emile_cipher.h b/src/lib/emile/emile_cipher.h index 086c16f9b0..93dbc39e63 100644 --- a/src/lib/emile/emile_cipher.h +++ b/src/lib/emile/emile_cipher.h | |||
@@ -10,6 +10,20 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | /** | 12 | /** |
13 | * @typedef Emile_Cipher_Backend | ||
14 | * | ||
15 | * Flags describing the implemented backend. | ||
16 | * | ||
17 | * @since 1.14.0 | ||
18 | */ | ||
19 | typedef enum _Emile_Cipher_Backend | ||
20 | { | ||
21 | EMILE_NONE, | ||
22 | EMILE_OPENSSL, | ||
23 | EMILE_GNUTLS | ||
24 | } Emile_Cipher_Backend; | ||
25 | |||
26 | /** | ||
13 | * @typedef Emile_Cipher_Algorithm | 27 | * @typedef Emile_Cipher_Algorithm |
14 | * | 28 | * |
15 | * Flags describing known cipher algorithm. | 29 | * Flags describing known cipher algorithm. |
@@ -39,7 +53,7 @@ EAPI Eina_Bool emile_cipher_init(void); | |||
39 | * @return the name of the current cipher backend. | 53 | * @return the name of the current cipher backend. |
40 | * @since 1.14.0 | 54 | * @since 1.14.0 |
41 | */ | 55 | */ |
42 | EAPI const char *emile_cipher_module_get(void); | 56 | EAPI Emile_Cipher_Backend emile_cipher_module_get(void); |
43 | 57 | ||
44 | /** | 58 | /** |
45 | * Cipher a buffer with a defined algorithm and key. | 59 | * Cipher a buffer with a defined algorithm and key. |
diff --git a/src/lib/emile/emile_main.c b/src/lib/emile/emile_main.c index b8712fce45..cb3b12bb4a 100644 --- a/src/lib/emile/emile_main.c +++ b/src/lib/emile/emile_main.c | |||
@@ -35,6 +35,20 @@ emile_cipher_init(void) | |||
35 | return EINA_TRUE; | 35 | return EINA_TRUE; |
36 | } | 36 | } |
37 | 37 | ||
38 | EAPI Emile_Cipher_Backend | ||
39 | emile_cipher_module_get(void) | ||
40 | { | ||
41 | #ifdef HAVE_GNUTLS | ||
42 | return EMILE_GNUTLS; | ||
43 | #else | ||
44 | #ifdef HAVE_OPENSSL | ||
45 | return EMILE_OPENSSL; | ||
46 | #else | ||
47 | return EMILE_NONE; | ||
48 | #endif | ||
49 | #endif | ||
50 | } | ||
51 | |||
38 | EAPI int | 52 | EAPI int |
39 | emile_init(void) | 53 | emile_init(void) |
40 | { | 54 | { |