summaryrefslogtreecommitdiff
path: root/src/lib/emile/Emile.h
diff options
context:
space:
mode:
authorCedric BAIL <cedric.bail@samsung.com>2015-03-17 08:50:13 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-03-17 09:58:18 +0100
commita089d8cd7bd1386a7aa64774e17925a17e8e00bc (patch)
tree10032de8d8a8d29f41635eb9525b8bd617cca702 /src/lib/emile/Emile.h
parent0f5184bbe4d40dc0c6793d46ab1906b692c76a9b (diff)
emile: Add SSL support.
Diffstat (limited to 'src/lib/emile/Emile.h')
-rw-r--r--src/lib/emile/Emile.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/lib/emile/Emile.h b/src/lib/emile/Emile.h
index b97c30eafe..47a9186d3b 100644
--- a/src/lib/emile/Emile.h
+++ b/src/lib/emile/Emile.h
@@ -106,7 +106,24 @@ EAPI int emile_shutdown(void);
106 * @} 106 * @}
107 */ 107 */
108 108
109typedef struct _Emile_SSL Emile_SSL;
110
111typedef enum
112{
113 EMILE_SSLv23,
114 EMILE_SSLv3,
115 EMILE_TLSv1
116} Emile_Cipher_Type;
117
118typedef enum
119{
120 EMILE_WANT_NOTHING = 0,
121 EMILE_WANT_READ = 1,
122 EMILE_WANT_WRITE = 3
123} Emile_Want_Type;
124
109EAPI Eina_Bool emile_cipher_init(void); 125EAPI Eina_Bool emile_cipher_init(void);
126EAPI const char *emile_cipher_module_get(void);
110 127
111EAPI Eina_Binbuf *emile_binbuf_cipher(const Eina_Binbuf *in, 128EAPI Eina_Binbuf *emile_binbuf_cipher(const Eina_Binbuf *in,
112 const char *key, unsigned int length); 129 const char *key, unsigned int length);
@@ -114,6 +131,25 @@ EAPI Eina_Binbuf *emile_binbuf_cipher(const Eina_Binbuf *in,
114EAPI Eina_Binbuf *emile_binbuf_decipher(const Eina_Binbuf *in, 131EAPI Eina_Binbuf *emile_binbuf_decipher(const Eina_Binbuf *in,
115 const char *key, unsigned int length); 132 const char *key, unsigned int length);
116 133
134EAPI Emile_SSL *emile_cipher_server_listen(Emile_Cipher_Type t);
135EAPI Emile_SSL *emile_cipher_client_connect(Emile_SSL *server, int fd);
136EAPI Emile_SSL *emile_cipher_server_connect(Emile_Cipher_Type t);
137EAPI Eina_Bool emile_cipher_free(Emile_SSL *emile);
138
139EAPI Eina_Bool emile_cipher_cafile_add(Emile_SSL *emile, const char *file);
140EAPI Eina_Bool emile_cipher_cert_add(Emile_SSL *emile, const char *file);
141EAPI Eina_Bool emile_cipher_privkey_add(Emile_SSL *emile, const char *file);
142EAPI Eina_Bool emile_cipher_crl_add(Emile_SSL *emile, const char *file);
143EAPI int emile_cipher_read(Emile_SSL *emile, Eina_Binbuf *buffer);
144EAPI int emile_cipher_write(Emile_SSL *emile, const Eina_Binbuf *buffer);
145EAPI const char *emile_cipher_error_get(const Emile_SSL *emile);
146EAPI Eina_Bool emile_cipher_verify_name_set(Emile_SSL *emile, const char *name);
147EAPI const char *emile_cipher_verify_name_get(const Emile_SSL *emile);
148EAPI void emile_cipher_verify_set(Emile_SSL *emile, Eina_Bool verify);
149EAPI void emile_cipher_verify_basic_set(Emile_SSL *emile, Eina_Bool verify_basic);
150EAPI Eina_Bool emile_cipher_verify_get(const Emile_SSL *emile);
151EAPI Eina_Bool emile_cipher_verify_basic_get(const Emile_SSL *emile);
152
117typedef enum 153typedef enum
118{ 154{
119 EMILE_ZLIB, 155 EMILE_ZLIB,