diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libtls/tls.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/libtls/tls.h b/src/lib/libtls/tls.h index 107614c759..e4dd31775a 100644 --- a/src/lib/libtls/tls.h +++ b/src/lib/libtls/tls.h | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls.h,v 1.35 2016/08/22 14:58:26 jsing Exp $ */ | 1 | /* $OpenBSD: tls.h,v 1.36 2016/09/04 12:26:43 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2014 Joel Sing <jsing@openbsd.org> |
| 4 | * | 4 | * |
| @@ -44,6 +44,11 @@ extern "C" { | |||
| 44 | struct tls; | 44 | struct tls; |
| 45 | struct tls_config; | 45 | struct tls_config; |
| 46 | 46 | ||
| 47 | typedef ssize_t (*tls_read_cb)(void *_ctx, void *_buf, size_t _buflen, | ||
| 48 | void *_cb_arg); | ||
| 49 | typedef ssize_t (*tls_write_cb)(void *_ctx, const void *_buf, | ||
| 50 | size_t _buflen, void *_cb_arg); | ||
| 51 | |||
| 47 | int tls_init(void); | 52 | int tls_init(void); |
| 48 | 53 | ||
| 49 | const char *tls_config_error(struct tls_config *_config); | 54 | const char *tls_config_error(struct tls_config *_config); |
| @@ -102,12 +107,16 @@ void tls_free(struct tls *_ctx); | |||
| 102 | int tls_accept_fds(struct tls *_ctx, struct tls **_cctx, int _fd_read, | 107 | int tls_accept_fds(struct tls *_ctx, struct tls **_cctx, int _fd_read, |
| 103 | int _fd_write); | 108 | int _fd_write); |
| 104 | int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket); | 109 | int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket); |
| 110 | int tls_accept_cbs(struct tls *_ctx, struct tls **_cctx, | ||
| 111 | tls_read_cb _read_cb, tls_write_cb _write_cb, void *_cb_arg); | ||
| 105 | int tls_connect(struct tls *_ctx, const char *_host, const char *_port); | 112 | int tls_connect(struct tls *_ctx, const char *_host, const char *_port); |
| 106 | int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write, | 113 | int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write, |
| 107 | const char *_servername); | 114 | const char *_servername); |
| 108 | int tls_connect_servername(struct tls *_ctx, const char *_host, | 115 | int tls_connect_servername(struct tls *_ctx, const char *_host, |
| 109 | const char *_port, const char *_servername); | 116 | const char *_port, const char *_servername); |
| 110 | int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername); | 117 | int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername); |
| 118 | int tls_connect_cbs(struct tls *_ctx, tls_read_cb _read_cb, | ||
| 119 | tls_write_cb _write_cb, void *_cb_arg, const char *_servername); | ||
| 111 | int tls_handshake(struct tls *_ctx); | 120 | int tls_handshake(struct tls *_ctx); |
| 112 | ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen); | 121 | ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen); |
| 113 | ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen); | 122 | ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen); |
