From 4c635b85709b33f5161674fcea273d5739d484fe Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 16 Nov 2014 00:31:32 +0100 Subject: Keep pulling openssl's tentacles out of protocol code --- vchat-ssl.h | 42 ++++++++---------------------------------- 1 file changed, 8 insertions(+), 34 deletions(-) (limited to 'vchat-ssl.h') diff --git a/vchat-ssl.h b/vchat-ssl.h index 12d5fdb..8dc1bfc 100755 --- a/vchat-ssl.h +++ b/vchat-ssl.h @@ -1,42 +1,16 @@ -/* types */ +/* prototypes */ -typedef int (*vc_x509verify_cb_t)(int, X509_STORE_CTX *); +struct vc_x509store_t; +typedef struct vc_x509store_t vc_x509store_t; typedef int (*vc_askpass_cb_t)(char *, int, int, void *); -typedef struct { - char *cafile; - char *capath; - char *crlfile; - vc_x509verify_cb_t callback; - vc_askpass_cb_t askpass_callback; - STACK_OF(X509) *certs; - STACK_OF(X509_CRL) *crls; - char *use_certfile; - STACK_OF(X509) *use_certs; - char *use_keyfile; - EVP_PKEY *use_key; - int flags; -} vc_x509store_t; - -/* prototypes */ -int vc_connect_ssl(BIO **conn, vc_x509store_t * ); -SSL_CTX * vc_create_sslctx( vc_x509store_t *); -void vc_init_x509store(vc_x509store_t *); -void vc_cleanup_x509store(vc_x509store_t *); -void vc_x509store_setcafile(vc_x509store_t *, char *); -void vc_x509store_setcapath(vc_x509store_t *, char *); -void vc_x509store_setcrlfile(vc_x509store_t *, char *); -void vc_x509store_setkeyfile(vc_x509store_t *, char *); -void vc_x509store_setcertfile(vc_x509store_t *, char *); -void vc_x509store_addcert(vc_x509store_t *, X509 *); -void vc_x509store_setcb(vc_x509store_t *, vc_x509verify_cb_t); -void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); +vc_x509store_t *vc_init_x509store(); +void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); void vc_x509store_setflags(vc_x509store_t *, int); -void vc_x509store_clearflags(vc_x509store_t *, int); -int vc_verify_callback(int, X509_STORE_CTX *); -X509_STORE * vc_x509store_create(vc_x509store_t *); -char *vc_ssl_version(char *, int); +void vc_x509store_setkeyfile(vc_x509store_t *, char *); +void vc_x509store_setcertfile(vc_x509store_t *, char *); +int vc_connect_ssl(BIO **conn, vc_x509store_t * ); #define VC_X509S_NODEF_CAFILE 0x01 #define VC_X509S_NODEF_CAPATH 0x02 -- cgit v1.2.3