summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortedu <tedu@openbsd.org>2016-09-13 13:40:58 +0000
committertedu <tedu@openbsd.org>2016-09-13 13:40:58 +0000
commitf36cb7cfc29b56cd643d033b135dccbbf2a07e43 (patch)
tree5d13c776ded0902c5dfccb262b116da59f8a0e6b
parentDon't waste time zero'ing memory until there is some chance it might (diff)
downloadwireguard-openbsd-f36cb7cfc29b56cd643d033b135dccbbf2a07e43.tar.xz
wireguard-openbsd-f36cb7cfc29b56cd643d033b135dccbbf2a07e43.zip
add a little more typing to the first callback argument.
it's always a tls context.
-rw-r--r--lib/libtls/tls.h6
-rw-r--r--lib/libtls/tls_init.38
2 files changed, 7 insertions, 7 deletions
diff --git a/lib/libtls/tls.h b/lib/libtls/tls.h
index 0a9c163250c..6cc3d0d6f8b 100644
--- a/lib/libtls/tls.h
+++ b/lib/libtls/tls.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls.h,v 1.37 2016/09/04 14:15:44 jsing Exp $ */
+/* $OpenBSD: tls.h,v 1.38 2016/09/13 13:40:58 tedu Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -44,9 +44,9 @@ extern "C" {
struct tls;
struct tls_config;
-typedef ssize_t (*tls_read_cb)(void *_ctx, void *_buf, size_t _buflen,
+typedef ssize_t (*tls_read_cb)(struct tls *_ctx, void *_buf, size_t _buflen,
void *_cb_arg);
-typedef ssize_t (*tls_write_cb)(void *_ctx, const void *_buf,
+typedef ssize_t (*tls_write_cb)(struct tls *_ctx, const void *_buf,
size_t _buflen, void *_cb_arg);
int tls_init(void);
diff --git a/lib/libtls/tls_init.3 b/lib/libtls/tls_init.3
index 90133a20cea..6059c3f8a07 100644
--- a/lib/libtls/tls_init.3
+++ b/lib/libtls/tls_init.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tls_init.3,v 1.71 2016/09/04 16:37:18 jmc Exp $
+.\" $OpenBSD: tls_init.3,v 1.72 2016/09/13 13:40:58 tedu Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 4 2016 $
+.Dd $Mdocdate: September 13 2016 $
.Dt TLS_INIT 3
.Os
.Sh NAME
@@ -189,13 +189,13 @@
.Ft "int"
.Fn tls_connect_socket "struct tls *ctx" "int s" "const char *servername"
.Ft "int"
-.Fn tls_connect_cbs "struct tls *ctx" "ssize_t (*tls_read_cb)(void *ctx, void *buf, size_t buflen, void *cb_arg)" "ssize_t (*tls_write_cb)(void *ctx, const void *buf, size_t buflen, void *cb_arg)" "void *cb_arg" "const char *servername"
+.Fn tls_connect_cbs "struct tls *ctx" "ssize_t (*tls_read_cb)(struct tls *ctx, void *buf, size_t buflen, void *cb_arg)" "ssize_t (*tls_write_cb)(struct tls *ctx, const void *buf, size_t buflen, void *cb_arg)" "void *cb_arg" "const char *servername"
.Ft "int"
.Fn tls_accept_fds "struct tls *tls" "struct tls **cctx" "int fd_read" "int fd_write"
.Ft "int"
.Fn tls_accept_socket "struct tls *tls" "struct tls **cctx" "int socket"
.Ft "int"
-.Fn tls_accept_cbs "struct tls *ctx" "struct tls **cctx" "ssize_t (*tls_read_cb)(void *ctx, void *buf, size_t buflen, void *cb_arg)" "ssize_t (*tls_write_cb)(void *ctx, const void *buf, size_t buflen, void *cb_arg)" "void *cb_arg"
+.Fn tls_accept_cbs "struct tls *ctx" "struct tls **cctx" "ssize_t (*tls_read_cb)(struct *ctx, void *buf, size_t buflen, void *cb_arg)" "ssize_t (*tls_write_cb)(struct tls *ctx, const void *buf, size_t buflen, void *cb_arg)" "void *cb_arg"
.Ft "int"
.Fn tls_handshake "struct tls *ctx"
.Ft "ssize_t"