From 1bf1e5946bc687f1a7f0eb85ca9a72ac407d940a Mon Sep 17 00:00:00 2001 From: tedu <> Date: Sat, 21 Feb 2015 19:54:59 +0000 Subject: fill out docs a bit more, notably the read/write again behaviors. ok jsing --- src/lib/libtls/tls_init.3 | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'src/lib/libtls/tls_init.3') diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3 index 61614ca239..de87119f33 100644 --- a/src/lib/libtls/tls_init.3 +++ b/src/lib/libtls/tls_init.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: tls_init.3,v 1.14 2015/02/15 13:36:06 jsing Exp $ +.\" $OpenBSD: tls_init.3,v 1.15 2015/02/21 19:54:59 tedu Exp $ .\" .\" Copyright (c) 2014 Ted Unangst .\" @@ -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: February 15 2015 $ +.Dd $Mdocdate: February 21 2015 $ .Dt TLS 3 .Os .Sh NAME @@ -135,6 +135,7 @@ Both clients and servers are supported. The .Fn tls_init function should be called once before any function is used. +It may be called more than once, but not concurrently. .Pp Before a connection is created, a configuration must be created. The @@ -381,7 +382,30 @@ Functions that return .Vt int will return 0 on success and -1 on error. Functions that return a pointer will return NULL on error. -.\" .Sh ERRORS +.Pp +The +.Fn tls_read +and +.Fn tls_write +functions and the +.Fn tls_connect +family of functions have two special return values. +.Pp +.Bl -tag -width "TLS_WRITE_AGAIN" -offset indent -compact +.It Dv TLS_READ_AGAIN +A read operation is necessary to continue. +.It Dv TLS_WRITE_AGAIN +A write operation is necessary to continue. +.El +.Pp +The caller should call the appropriate function, or in the case of +.Fn tls_connect , +repeat the call. +.Sh ERRORS +The +.Fn tls_error +function may be used to retrieve a string containing more information +about the most recent error. .\" .Sh SEE ALSO .Sh HISTORY The -- cgit v1.2.3-55-g6feb