summaryrefslogtreecommitdiff
path: root/vchat-ssl.h
diff options
context:
space:
mode:
Diffstat (limited to 'vchat-ssl.h')
-rwxr-xr-xvchat-ssl.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/vchat-ssl.h b/vchat-ssl.h
new file mode 100755
index 0000000..58e9dec
--- /dev/null
+++ b/vchat-ssl.h
@@ -0,0 +1,53 @@
1
2/* types */
3
4typedef int (*vc_x509verify_cb_t)(int, X509_STORE_CTX *);
5typedef int (*vc_askpass_cb_t)(char *, int, int, void *);
6typedef struct {
7 char *cafile;
8 char *capath;
9 char *crlfile;
10 vc_x509verify_cb_t callback;
11 vc_askpass_cb_t askpass_callback;
12 STACK_OF(X509) *certs;
13 STACK_OF(X509_CRL) *crls;
14 char *use_certfile;
15 STACK_OF(X509) *use_certs;
16 char *use_keyfile;
17 EVP_PKEY *use_key;
18 int flags;
19 int ignore_ssl;
20} vc_x509store_t;
21
22/* prototypes */
23
24BIO * vc_connect(char *, int , int, vc_x509store_t *, SSL_CTX **);
25BIO * vc_connect_ssl(char *, int, vc_x509store_t *, SSL_CTX **);
26SSL_CTX * vc_create_sslctx( vc_x509store_t *);
27void vc_init_x509store(vc_x509store_t *);
28void vc_cleanup_x509store(vc_x509store_t *);
29void vc_x509store_setcafile(vc_x509store_t *, char *);
30void vc_x509store_setcapath(vc_x509store_t *, char *);
31void vc_x509store_setcrlfile(vc_x509store_t *, char *);
32void vc_x509store_setkeyfile(vc_x509store_t *, char *);
33void vc_x509store_setcertfile(vc_x509store_t *, char *);
34void vc_x509store_addcert(vc_x509store_t *, X509 *);
35void vc_x509store_setcb(vc_x509store_t *, vc_x509verify_cb_t);
36void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t);
37void vc_x509store_setflags(vc_x509store_t *, int);
38void vc_x509store_setignssl(vc_x509store_t *, int);
39void vc_x509store_clearflags(vc_x509store_t *, int);
40int vc_verify_cert(X509 *, vc_x509store_t *);
41int vc_verify_cert_hostname(X509 *, char *);
42int vc_verify_callback(int, X509_STORE_CTX *);
43X509_STORE * vc_x509store_create(vc_x509store_t *);
44
45#define VC_X509S_NODEF_CAFILE 0x01
46#define VC_X509S_NODEF_CAPATH 0x02
47#define VC_X509S_USE_CERTIFICATE 0x04
48#define VC_X509S_SSL_VERIFY_NONE 0x10
49#define VC_X509S_SSL_VERIFY_PEER 0x20
50#define VC_X509S_SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x40
51#define VC_X509S_SSL_VERIFY_CLIENT_ONCE 0x80
52#define VC_X509S_SSL_VERIFY_MASK 0xF0
53