diff options
author | erdgeist <> | 2007-06-27 21:59:32 +0000 |
---|---|---|
committer | erdgeist <> | 2007-06-27 21:59:32 +0000 |
commit | 3c11bea99886b006ca499e1be6a3a17d225cedc7 (patch) | |
tree | 687a3e0e762669af85c5858420856b49686795cd /vchat-ssl.h | |
parent | d4861ca31f0406f5c49023bc2c3bc4cfa54e3693 (diff) |
Introducing new ssl code
Diffstat (limited to 'vchat-ssl.h')
-rwxr-xr-x | vchat-ssl.h | 53 |
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 | |||
4 | typedef int (*vc_x509verify_cb_t)(int, X509_STORE_CTX *); | ||
5 | typedef int (*vc_askpass_cb_t)(char *, int, int, void *); | ||
6 | typedef 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 | |||
24 | BIO * vc_connect(char *, int , int, vc_x509store_t *, SSL_CTX **); | ||
25 | BIO * vc_connect_ssl(char *, int, vc_x509store_t *, SSL_CTX **); | ||
26 | SSL_CTX * vc_create_sslctx( vc_x509store_t *); | ||
27 | void vc_init_x509store(vc_x509store_t *); | ||
28 | void vc_cleanup_x509store(vc_x509store_t *); | ||
29 | void vc_x509store_setcafile(vc_x509store_t *, char *); | ||
30 | void vc_x509store_setcapath(vc_x509store_t *, char *); | ||
31 | void vc_x509store_setcrlfile(vc_x509store_t *, char *); | ||
32 | void vc_x509store_setkeyfile(vc_x509store_t *, char *); | ||
33 | void vc_x509store_setcertfile(vc_x509store_t *, char *); | ||
34 | void vc_x509store_addcert(vc_x509store_t *, X509 *); | ||
35 | void vc_x509store_setcb(vc_x509store_t *, vc_x509verify_cb_t); | ||
36 | void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); | ||
37 | void vc_x509store_setflags(vc_x509store_t *, int); | ||
38 | void vc_x509store_setignssl(vc_x509store_t *, int); | ||
39 | void vc_x509store_clearflags(vc_x509store_t *, int); | ||
40 | int vc_verify_cert(X509 *, vc_x509store_t *); | ||
41 | int vc_verify_cert_hostname(X509 *, char *); | ||
42 | int vc_verify_callback(int, X509_STORE_CTX *); | ||
43 | X509_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 | |||