diff options
| author | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-25 00:23:08 +0200 |
|---|---|---|
| committer | Dirk Engling <erdgeist@erdgeist.org> | 2022-05-25 00:23:08 +0200 |
| commit | 0bd0d4e6db2093186e91aa023865f16c793854e2 (patch) | |
| tree | 18ad198b26f0be89c3a385cd09b7bcfe3a5063ac /vchat-tls.h | |
| parent | acc107e1a89cc599d9c00b3e899e39af3159e950 (diff) | |
Make tls engine runtime configurable
Diffstat (limited to 'vchat-tls.h')
| -rwxr-xr-x | vchat-tls.h | 27 |
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 | }; |
| 15 | typedef struct vc_x509store_t vc_x509store_t; | 15 | typedef struct vc_x509store_t vc_x509store_t; |
| 16 | 16 | ||
| 17 | void vc_init_x509store(vc_x509store_t *); | ||
| 18 | void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); | 17 | void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); |
| 19 | void vc_x509store_setflags(vc_x509store_t *, int); | 18 | void vc_x509store_setflags(vc_x509store_t *, int); |
| 20 | void vc_x509store_setkeyfile(vc_x509store_t *, char *); | 19 | void vc_x509store_setkeyfile(vc_x509store_t *, char *); |
| @@ -25,10 +24,28 @@ void vc_x509store_setcapath(vc_x509store_t *, char *); | |||
| 25 | void vc_x509store_setcrlfile(vc_x509store_t *, char *); | 24 | void vc_x509store_setcrlfile(vc_x509store_t *, char *); |
| 26 | void vc_cleanup_x509store(vc_x509store_t *s); | 25 | void vc_cleanup_x509store(vc_x509store_t *s); |
| 27 | 26 | ||
| 28 | int vc_tls_connect(int serverfd, vc_x509store_t *); | 27 | #if !defined(TLS_LIB_OPENSSL) && !defined(TLS_LIB_MBEDTLS) |
| 29 | ssize_t vc_tls_sendmessage(const void *buf, size_t size); | 28 | #error \ |
| 30 | ssize_t vc_tls_receivemessage(void *buf, size_t size); | 29 | "Neither TLS_LIB_OPENSSL nor TLS_LIB_MBEDTLS are defined. Please select exactly one." |
| 31 | void vc_tls_cleanup(); | 30 | #endif |
| 31 | |||
| 32 | #ifdef TLS_LIB_OPENSSL | ||
| 33 | void vc_openssl_init_x509store(vc_x509store_t *); | ||
| 34 | int vc_openssl_connect(int serverfd, vc_x509store_t *); | ||
| 35 | ssize_t vc_openssl_sendmessage(const void *buf, size_t size); | ||
| 36 | ssize_t vc_openssl_receivemessage(void *buf, size_t size); | ||
| 37 | void vc_openssl_cleanup(); | ||
| 38 | char *vc_openssl_version(); | ||
| 39 | #endif | ||
| 40 | |||
| 41 | #ifdef TLS_LIB_MBEDTLS | ||
| 42 | void vc_mbedtls_init_x509store(vc_x509store_t *); | ||
| 43 | int vc_mbedtls_connect(int serverfd, vc_x509store_t *); | ||
| 44 | ssize_t vc_mbedtls_sendmessage(const void *buf, size_t size); | ||
| 45 | ssize_t vc_mbedtls_receivemessage(void *buf, size_t size); | ||
| 46 | void vc_mbedtls_cleanup(); | ||
| 47 | char *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 |
