summaryrefslogtreecommitdiff
path: root/vchat-tls.h
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2022-05-16 15:53:39 +0200
committerDirk Engling <erdgeist@erdgeist.org>2022-05-16 15:53:39 +0200
commitd1ac67f6d73f24a165ccc008440bb8b208ae140f (patch)
tree0da0184ec2273ffa6f642ab06e776fcdda9f4ac3 /vchat-tls.h
parent43b74147212ddc5e619ac17dd1b5967b6b293d8a (diff)
Decouple IO openssl's BIO abstraction and split connection and tls handling to allow for other TLS libs
Diffstat (limited to 'vchat-tls.h')
-rwxr-xr-xvchat-tls.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/vchat-tls.h b/vchat-tls.h
new file mode 100755
index 0000000..8d33ebd
--- /dev/null
+++ b/vchat-tls.h
@@ -0,0 +1,30 @@
1#pragma once
2
3/* prototypes */
4
5struct vc_x509store_t;
6typedef struct vc_x509store_t vc_x509store_t;
7typedef int (*vc_askpass_cb_t)(char *, int, int, void *);
8
9vc_x509store_t *vc_init_x509store();
10void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t);
11void vc_x509store_setflags(vc_x509store_t *, int);
12void vc_x509store_setkeyfile(vc_x509store_t *, char *);
13void vc_x509store_setcertfile(vc_x509store_t *, char *);
14void vc_x509store_setcafile(vc_x509store_t *, char *);
15void vc_cleanup_x509store(vc_x509store_t *s);
16
17int vc_tls_connect(int serverfd, vc_x509store_t * );
18ssize_t vc_tls_sendmessage(const void *buf, size_t size);
19ssize_t vc_tls_receivemessage(void *buf, size_t size);
20void vc_tls_cleanup();
21
22#define VC_X509S_NODEF_CAFILE 0x01
23#define VC_X509S_NODEF_CAPATH 0x02
24#define VC_X509S_USE_CERTIFICATE 0x04
25#define VC_X509S_SSL_VERIFY_NONE 0x10
26#define VC_X509S_SSL_VERIFY_PEER 0x20
27#define VC_X509S_SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x40
28#define VC_X509S_SSL_VERIFY_CLIENT_ONCE 0x80
29#define VC_X509S_SSL_VERIFY_MASK 0xF0
30