diff options
Diffstat (limited to 'libsylph/ssl.h')
| -rw-r--r-- | libsylph/ssl.h | 20 |
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 | |||
| 38 | typedef enum { | 44 | typedef 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 | ||
| 61 | void ssl_set_verify_func (SSLVerifyFunc func); | 67 | void ssl_set_verify_func (SSLVerifyFunc func); |
| 62 | 68 | ||
| 69 | /* master password related code */ | ||
| 70 | gint 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 | |||
| 78 | gint 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__ */ |
