summaryrefslogtreecommitdiff
path: root/vchat-tls.h
diff options
context:
space:
mode:
authorDirk Engling <erdgeist@erdgeist.org>2022-05-25 00:23:08 +0200
committerDirk Engling <erdgeist@erdgeist.org>2022-05-25 00:23:08 +0200
commit0bd0d4e6db2093186e91aa023865f16c793854e2 (patch)
tree18ad198b26f0be89c3a385cd09b7bcfe3a5063ac /vchat-tls.h
parentacc107e1a89cc599d9c00b3e899e39af3159e950 (diff)
Make tls engine runtime configurable
Diffstat (limited to 'vchat-tls.h')
-rwxr-xr-xvchat-tls.h27
1 files changed, 22 insertions, 5 deletions
diff --git a/vchat-tls.h b/vchat-tls.h
index 17d2687..5399820 100755
--- a/vchat-tls.h
+++ b/vchat-tls.h
@@ -14,7 +14,6 @@ struct vc_x509store_t {
14}; 14};
15typedef struct vc_x509store_t vc_x509store_t; 15typedef struct vc_x509store_t vc_x509store_t;
16 16
17void vc_init_x509store(vc_x509store_t *);
18void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); 17void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t);
19void vc_x509store_setflags(vc_x509store_t *, int); 18void vc_x509store_setflags(vc_x509store_t *, int);
20void vc_x509store_setkeyfile(vc_x509store_t *, char *); 19void vc_x509store_setkeyfile(vc_x509store_t *, char *);
@@ -25,10 +24,28 @@ void vc_x509store_setcapath(vc_x509store_t *, char *);
25void vc_x509store_setcrlfile(vc_x509store_t *, char *); 24void vc_x509store_setcrlfile(vc_x509store_t *, char *);
26void vc_cleanup_x509store(vc_x509store_t *s); 25void vc_cleanup_x509store(vc_x509store_t *s);
27 26
28int vc_tls_connect(int serverfd, vc_x509store_t *); 27#if !defined(TLS_LIB_OPENSSL) && !defined(TLS_LIB_MBEDTLS)
29ssize_t vc_tls_sendmessage(const void *buf, size_t size); 28#error \
30ssize_t vc_tls_receivemessage(void *buf, size_t size); 29 "Neither TLS_LIB_OPENSSL nor TLS_LIB_MBEDTLS are defined. Please select exactly one."
31void vc_tls_cleanup(); 30#endif
31
32#ifdef TLS_LIB_OPENSSL
33void vc_openssl_init_x509store(vc_x509store_t *);
34int vc_openssl_connect(int serverfd, vc_x509store_t *);
35ssize_t vc_openssl_sendmessage(const void *buf, size_t size);
36ssize_t vc_openssl_receivemessage(void *buf, size_t size);
37void vc_openssl_cleanup();
38char *vc_openssl_version();
39#endif
40
41#ifdef TLS_LIB_MBEDTLS
42void vc_mbedtls_init_x509store(vc_x509store_t *);
43int vc_mbedtls_connect(int serverfd, vc_x509store_t *);
44ssize_t vc_mbedtls_sendmessage(const void *buf, size_t size);
45ssize_t vc_mbedtls_receivemessage(void *buf, size_t size);
46void vc_mbedtls_cleanup();
47char *vc_mbedtls_version();
48#endif
32 49
33#define VC_X509S_USE_CAFILE 0x01 50#define VC_X509S_USE_CAFILE 0x01
34#define VC_X509S_USE_CAPATH 0x02 51#define VC_X509S_USE_CAPATH 0x02