summaryrefslogtreecommitdiff
path: root/vchat-tls.h
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-tls.h')
-rwxr-xr-xvchat-tls.h21
1 files changed, 16 insertions, 5 deletions
diff --git a/vchat-tls.h b/vchat-tls.h
index 8d33ebd..440d08e 100755
--- a/vchat-tls.h
+++ b/vchat-tls.h
@@ -2,16 +2,27 @@
2 2
3/* prototypes */ 3/* prototypes */
4 4
5struct vc_x509store_t;
6typedef struct vc_x509store_t vc_x509store_t;
7typedef int (*vc_askpass_cb_t)(char *, int, int, void *); 5typedef int (*vc_askpass_cb_t)(char *, int, int, void *);
6struct vc_x509store_t {
7 char *cafile;
8 char *capath;
9 char *crlfile;
10 vc_askpass_cb_t askpass_callback;
11 char *certfile;
12 char *keyfile;
13 int flags;
14};
15typedef struct vc_x509store_t vc_x509store_t;
8 16
9vc_x509store_t *vc_init_x509store(); 17void vc_init_x509store(vc_x509store_t *);
10void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); 18void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t);
11void vc_x509store_setflags(vc_x509store_t *, int); 19void vc_x509store_setflags(vc_x509store_t *, int);
12void vc_x509store_setkeyfile(vc_x509store_t *, char *); 20void vc_x509store_setkeyfile(vc_x509store_t *, char *);
13void vc_x509store_setcertfile(vc_x509store_t *, char *); 21void vc_x509store_setcertfile(vc_x509store_t *, char *);
14void vc_x509store_setcafile(vc_x509store_t *, char *); 22void vc_x509store_setcafile(vc_x509store_t *, char *);
23void vc_x509store_clearflags(vc_x509store_t *, int);
24void vc_x509store_setcapath(vc_x509store_t *, char *);
25void vc_x509store_setcrlfile(vc_x509store_t *, char *);
15void vc_cleanup_x509store(vc_x509store_t *s); 26void vc_cleanup_x509store(vc_x509store_t *s);
16 27
17int vc_tls_connect(int serverfd, vc_x509store_t * ); 28int vc_tls_connect(int serverfd, vc_x509store_t * );
@@ -19,8 +30,8 @@ ssize_t vc_tls_sendmessage(const void *buf, size_t size);
19ssize_t vc_tls_receivemessage(void *buf, size_t size); 30ssize_t vc_tls_receivemessage(void *buf, size_t size);
20void vc_tls_cleanup(); 31void vc_tls_cleanup();
21 32
22#define VC_X509S_NODEF_CAFILE 0x01 33#define VC_X509S_USE_CAFILE 0x01
23#define VC_X509S_NODEF_CAPATH 0x02 34#define VC_X509S_USE_CAPATH 0x02
24#define VC_X509S_USE_CERTIFICATE 0x04 35#define VC_X509S_USE_CERTIFICATE 0x04
25#define VC_X509S_SSL_VERIFY_NONE 0x10 36#define VC_X509S_SSL_VERIFY_NONE 0x10
26#define VC_X509S_SSL_VERIFY_PEER 0x20 37#define VC_X509S_SSL_VERIFY_PEER 0x20