summaryrefslogtreecommitdiff
path: root/libsylph/ssl.h
diff options
context:
space:
mode:
authorSimeon Simeonov2018-02-27 21:52:12 +0100
committerSimeon Simeonov2018-02-27 21:52:12 +0100
commit1bb2a9d33e8cd193c21f9995fb7852c7562cafcf (patch)
treebf54cba95a7b7afa68b33f8cb40b53d351b880ff /libsylph/ssl.h
parent3f7a3add4dc0814e01c3032d73a4cdd29372f8d4 (diff)
First prototype
Diffstat (limited to 'libsylph/ssl.h')
-rw-r--r--libsylph/ssl.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/libsylph/ssl.h b/libsylph/ssl.h
index a9f690d..94ab4b7 100644
--- a/libsylph/ssl.h
+++ b/libsylph/ssl.h
@@ -32,9 +32,15 @@
32#include <openssl/pem.h> 32#include <openssl/pem.h>
33#include <openssl/ssl.h> 33#include <openssl/ssl.h>
34#include <openssl/err.h> 34#include <openssl/err.h>
35#include <openssl/evp.h>
36#include <openssl/rand.h>
35 37
36#include "socket.h" 38#include "socket.h"
37 39
40#define RC_OK 0
41#define RC_ERROR -1
42#define RC_WRONG_HASH_OR_KEY 1
43
38typedef enum { 44typedef enum {
39 SSL_METHOD_SSLv23, 45 SSL_METHOD_SSLv23,
40 SSL_METHOD_TLSv1 46 SSL_METHOD_TLSv1
@@ -60,6 +66,20 @@ void ssl_done_socket (SockInfo *sockinfo);
60 66
61void ssl_set_verify_func (SSLVerifyFunc func); 67void ssl_set_verify_func (SSLVerifyFunc func);
62 68
69/* master password related code */
70gint encrypt_data(gchar **encrypted,
71 gint *length_encrypted,
72 const gchar *data,
73 const gchar *passphrase,
74 gint length_data,
75 guint min_data_length,
76 gboolean rnd_salt);
77
78gint decrypt_data(gchar **decrypted,
79 const gchar *data,
80 const gchar *passphrase,
81 gint length_data);
82/* ---------------------------- */
63#endif /* USE_SSL */ 83#endif /* USE_SSL */
64 84
65#endif /* __SSL_H__ */ 85#endif /* __SSL_H__ */