summaryrefslogtreecommitdiff
path: root/src/lib/libtls/tls.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libtls/tls.h')
-rw-r--r--src/lib/libtls/tls.h11
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" {
44struct tls; 44struct tls;
45struct tls_config; 45struct tls_config;
46 46
47typedef ssize_t (*tls_read_cb)(void *_ctx, void *_buf, size_t _buflen,
48 void *_cb_arg);
49typedef ssize_t (*tls_write_cb)(void *_ctx, const void *_buf,
50 size_t _buflen, void *_cb_arg);
51
47int tls_init(void); 52int tls_init(void);
48 53
49const char *tls_config_error(struct tls_config *_config); 54const char *tls_config_error(struct tls_config *_config);
@@ -102,12 +107,16 @@ void tls_free(struct tls *_ctx);
102int tls_accept_fds(struct tls *_ctx, struct tls **_cctx, int _fd_read, 107int tls_accept_fds(struct tls *_ctx, struct tls **_cctx, int _fd_read,
103 int _fd_write); 108 int _fd_write);
104int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket); 109int tls_accept_socket(struct tls *_ctx, struct tls **_cctx, int _socket);
110int tls_accept_cbs(struct tls *_ctx, struct tls **_cctx,
111 tls_read_cb _read_cb, tls_write_cb _write_cb, void *_cb_arg);
105int tls_connect(struct tls *_ctx, const char *_host, const char *_port); 112int tls_connect(struct tls *_ctx, const char *_host, const char *_port);
106int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write, 113int tls_connect_fds(struct tls *_ctx, int _fd_read, int _fd_write,
107 const char *_servername); 114 const char *_servername);
108int tls_connect_servername(struct tls *_ctx, const char *_host, 115int tls_connect_servername(struct tls *_ctx, const char *_host,
109 const char *_port, const char *_servername); 116 const char *_port, const char *_servername);
110int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername); 117int tls_connect_socket(struct tls *_ctx, int _s, const char *_servername);
118int tls_connect_cbs(struct tls *_ctx, tls_read_cb _read_cb,
119 tls_write_cb _write_cb, void *_cb_arg, const char *_servername);
111int tls_handshake(struct tls *_ctx); 120int tls_handshake(struct tls *_ctx);
112ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen); 121ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen);
113ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen); 122ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen);