diff options
Diffstat (limited to 'vchat-tls.h')
| -rwxr-xr-x | vchat-tls.h | 21 |
1 files changed, 16 insertions, 5 deletions
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 @@ | |||
| 2 | 2 | ||
| 3 | /* prototypes */ | 3 | /* prototypes */ |
| 4 | 4 | ||
| 5 | struct vc_x509store_t; | ||
| 6 | typedef struct vc_x509store_t vc_x509store_t; | ||
| 7 | typedef int (*vc_askpass_cb_t)(char *, int, int, void *); | 5 | typedef int (*vc_askpass_cb_t)(char *, int, int, void *); |
| 6 | struct vc_x509store_t { | ||
| 7 | char *cafile; | ||
| 8 | char *capath; | ||
| 9 | char *crlfile; | ||
| 10 | vc_askpass_cb_t askpass_callback; | ||
| 11 | char *certfile; | ||
| 12 | char *keyfile; | ||
| 13 | int flags; | ||
| 14 | }; | ||
| 15 | typedef struct vc_x509store_t vc_x509store_t; | ||
| 8 | 16 | ||
| 9 | vc_x509store_t *vc_init_x509store(); | 17 | void vc_init_x509store(vc_x509store_t *); |
| 10 | void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); | 18 | void vc_x509store_set_pkeycb(vc_x509store_t *, vc_askpass_cb_t); |
| 11 | void vc_x509store_setflags(vc_x509store_t *, int); | 19 | void vc_x509store_setflags(vc_x509store_t *, int); |
| 12 | void vc_x509store_setkeyfile(vc_x509store_t *, char *); | 20 | void vc_x509store_setkeyfile(vc_x509store_t *, char *); |
| 13 | void vc_x509store_setcertfile(vc_x509store_t *, char *); | 21 | void vc_x509store_setcertfile(vc_x509store_t *, char *); |
| 14 | void vc_x509store_setcafile(vc_x509store_t *, char *); | 22 | void vc_x509store_setcafile(vc_x509store_t *, char *); |
| 23 | void vc_x509store_clearflags(vc_x509store_t *, int); | ||
| 24 | void vc_x509store_setcapath(vc_x509store_t *, char *); | ||
| 25 | void vc_x509store_setcrlfile(vc_x509store_t *, char *); | ||
| 15 | void vc_cleanup_x509store(vc_x509store_t *s); | 26 | void vc_cleanup_x509store(vc_x509store_t *s); |
| 16 | 27 | ||
| 17 | int vc_tls_connect(int serverfd, vc_x509store_t * ); | 28 | int vc_tls_connect(int serverfd, vc_x509store_t * ); |
| @@ -19,8 +30,8 @@ ssize_t vc_tls_sendmessage(const void *buf, size_t size); | |||
| 19 | ssize_t vc_tls_receivemessage(void *buf, size_t size); | 30 | ssize_t vc_tls_receivemessage(void *buf, size_t size); |
| 20 | void vc_tls_cleanup(); | 31 | void vc_tls_cleanup(); |
| 21 | 32 | ||
| 22 | #define VC_X509S_NODEF_CAFILE 0x01 | 33 | #define VC_X509S_USE_CAFILE 0x01 |
| 23 | #define VC_X509S_NODEF_CAPATH 0x02 | 34 | #define VC_X509S_USE_CAPATH 0x02 |
| 24 | #define VC_X509S_USE_CERTIFICATE 0x04 | 35 | #define VC_X509S_USE_CERTIFICATE 0x04 |
| 25 | #define VC_X509S_SSL_VERIFY_NONE 0x10 | 36 | #define VC_X509S_SSL_VERIFY_NONE 0x10 |
| 26 | #define VC_X509S_SSL_VERIFY_PEER 0x20 | 37 | #define VC_X509S_SSL_VERIFY_PEER 0x20 |
