diff options
author | jsing <> | 2015-03-31 14:03:38 +0000 |
---|---|---|
committer | jsing <> | 2015-03-31 14:03:38 +0000 |
commit | a0cae064c7fb3e6f9795357b0897fc7cfbada29a (patch) | |
tree | c543b48853afa3779822fdf734c77e67d886bf12 /src/lib/libtls/tls_init.3 | |
parent | e23e95b70f14a01a428a6d966e2cb510a4bf1cd6 (diff) | |
download | openbsd-a0cae064c7fb3e6f9795357b0897fc7cfbada29a.tar.gz openbsd-a0cae064c7fb3e6f9795357b0897fc7cfbada29a.tar.bz2 openbsd-a0cae064c7fb3e6f9795357b0897fc7cfbada29a.zip |
Provide a tls_accept_fds() function, which allows a TLS connection to be
accepted via an existing pair of file descriptors.
Based on a diff from Jan Klemkow.
Diffstat (limited to 'src/lib/libtls/tls_init.3')
-rw-r--r-- | src/lib/libtls/tls_init.3 | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3 index 3e888115e8..f038f9313a 100644 --- a/src/lib/libtls/tls_init.3 +++ b/src/lib/libtls/tls_init.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: tls_init.3,v 1.18 2015/02/22 15:09:54 jsing Exp $ | 1 | .\" $OpenBSD: tls_init.3,v 1.19 2015/03/31 14:03:38 jsing Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,7 +14,7 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 16 | .\" |
17 | .Dd $Mdocdate: February 22 2015 $ | 17 | .Dd $Mdocdate: March 31 2015 $ |
18 | .Dt TLS 3 | 18 | .Dt TLS 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
@@ -50,6 +50,7 @@ | |||
50 | .Nm tls_connect_fds , | 50 | .Nm tls_connect_fds , |
51 | .Nm tls_connect_servername , | 51 | .Nm tls_connect_servername , |
52 | .Nm tls_connect_socket , | 52 | .Nm tls_connect_socket , |
53 | .Nm tls_accept_fds , | ||
53 | .Nm tls_accept_socket , | 54 | .Nm tls_accept_socket , |
54 | .Nm tls_read , | 55 | .Nm tls_read , |
55 | .Nm tls_write | 56 | .Nm tls_write |
@@ -120,6 +121,8 @@ | |||
120 | .Ft "int" | 121 | .Ft "int" |
121 | .Fn tls_connect_socket "struct tls *ctx" "int s" "const char *servername" | 122 | .Fn tls_connect_socket "struct tls *ctx" "int s" "const char *servername" |
122 | .Ft "int" | 123 | .Ft "int" |
124 | .Fn tls_accept_fds "struct tls *tls" "struct tls **cctx" "int fd_read" "int fd_write" | ||
125 | .Ft "int" | ||
123 | .Fn tls_accept_socket "struct tls *tls" "struct tls **cctx" "int socket" | 126 | .Fn tls_accept_socket "struct tls *tls" "struct tls **cctx" "int socket" |
124 | .Ft "int" | 127 | .Ft "int" |
125 | .Fn tls_read "struct tls *ctx" "void *buf" "size_t buflen" "size_t *outlen" | 128 | .Fn tls_read "struct tls *ctx" "void *buf" "size_t buflen" "size_t *outlen" |
@@ -180,6 +183,9 @@ file descriptors by calling | |||
180 | A server can accept a new client connection by calling | 183 | A server can accept a new client connection by calling |
181 | .Fn tls_accept_socket | 184 | .Fn tls_accept_socket |
182 | on an already established socket connection. | 185 | on an already established socket connection. |
186 | Alternatively, a new client connection can be accepted over a pair of existing | ||
187 | file descriptors by calling | ||
188 | .Fn tls_accept_fds . | ||
183 | .Pp | 189 | .Pp |
184 | Two functions are provided for input and output, | 190 | Two functions are provided for input and output, |
185 | .Fn tls_read | 191 | .Fn tls_read |
@@ -357,6 +363,16 @@ connects a client context to a pair of existing file descriptors. | |||
357 | .Fn tls_connect_socket | 363 | .Fn tls_connect_socket |
358 | connects a client context to an already established socket connection. | 364 | connects a client context to an already established socket connection. |
359 | .It | 365 | .It |
366 | .Fn tls_accept_fds | ||
367 | creates a new context suitable for reading and writing on an existing pair of | ||
368 | file descriptors and returns it in | ||
369 | .Fa *cctx . | ||
370 | A configured server context should be passed in | ||
371 | .Fa ctx | ||
372 | and | ||
373 | .Fa *cctx | ||
374 | should be initialized to NULL. | ||
375 | .It | ||
360 | .Fn tls_accept_socket | 376 | .Fn tls_accept_socket |
361 | creates a new context suitable for reading and writing on an already | 377 | creates a new context suitable for reading and writing on an already |
362 | established socket connection and returns it in | 378 | established socket connection and returns it in |