From 92c67507e7b9b94341b3453b01a124f642aa68fb Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Wed, 18 May 2022 00:03:41 +0200 Subject: Simplify tls code by removing all unused functions to allow for more generic helpers that can be used across lib wrappers --- vchat-tls.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'vchat-tls.h') 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 @@ /* prototypes */ -struct vc_x509store_t; -typedef struct vc_x509store_t vc_x509store_t; typedef int (*vc_askpass_cb_t)(char *, int, int, void *); +struct vc_x509store_t { + char *cafile; + char *capath; + char *crlfile; + vc_askpass_cb_t askpass_callback; + char *certfile; + char *keyfile; + int flags; +}; +typedef struct vc_x509store_t vc_x509store_t; -vc_x509store_t *vc_init_x509store(); +void vc_init_x509store(vc_x509store_t *); void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); void vc_x509store_setflags(vc_x509store_t *, int); void vc_x509store_setkeyfile(vc_x509store_t *, char *); void vc_x509store_setcertfile(vc_x509store_t *, char *); void vc_x509store_setcafile(vc_x509store_t *, char *); +void vc_x509store_clearflags(vc_x509store_t *, int); +void vc_x509store_setcapath(vc_x509store_t *, char *); +void vc_x509store_setcrlfile(vc_x509store_t *, char *); void vc_cleanup_x509store(vc_x509store_t *s); int vc_tls_connect(int serverfd, vc_x509store_t * ); @@ -19,8 +30,8 @@ ssize_t vc_tls_sendmessage(const void *buf, size_t size); ssize_t vc_tls_receivemessage(void *buf, size_t size); void vc_tls_cleanup(); -#define VC_X509S_NODEF_CAFILE 0x01 -#define VC_X509S_NODEF_CAPATH 0x02 +#define VC_X509S_USE_CAFILE 0x01 +#define VC_X509S_USE_CAPATH 0x02 #define VC_X509S_USE_CERTIFICATE 0x04 #define VC_X509S_SSL_VERIFY_NONE 0x10 #define VC_X509S_SSL_VERIFY_PEER 0x20 -- cgit v1.2.3