summaryrefslogtreecommitdiff
path: root/src/lib/libtls/man/tls_read.3
diff options
context:
space:
mode:
authorschwarze <>2017-02-20 13:09:15 +0000
committerschwarze <>2017-02-20 13:09:15 +0000
commit4565e979c4bc23c9029219f98144e218958f0de5 (patch)
tree04d13d955e559423c5b686fdcf26ac7cc33c112e /src/lib/libtls/man/tls_read.3
parentf5687e58de136104a8aedcd260a57135fbb9572c (diff)
downloadopenbsd-4565e979c4bc23c9029219f98144e218958f0de5.tar.gz
openbsd-4565e979c4bc23c9029219f98144e218958f0de5.tar.bz2
openbsd-4565e979c4bc23c9029219f98144e218958f0de5.zip
document tls_config_error(3) RETURN VALUES, improve what is said
about tls_error(3), and warn about some traps; OK jmc@
Diffstat (limited to 'src/lib/libtls/man/tls_read.3')
-rw-r--r--src/lib/libtls/man/tls_read.336
1 files changed, 32 insertions, 4 deletions
diff --git a/src/lib/libtls/man/tls_read.3 b/src/lib/libtls/man/tls_read.3
index e990361017..a7faebaea7 100644
--- a/src/lib/libtls/man/tls_read.3
+++ b/src/lib/libtls/man/tls_read.3
@@ -1,9 +1,10 @@
1.\" $OpenBSD: tls_read.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ 1.\" $OpenBSD: tls_read.3,v 1.4 2017/02/20 13:09:15 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2014, 2015 Ted Unangst <tedu@openbsd.org> 3.\" Copyright (c) 2014, 2015 Ted Unangst <tedu@openbsd.org>
4.\" Copyright (c) 2015 Doug Hogan <doug@openbsd.org> 4.\" Copyright (c) 2015 Doug Hogan <doug@openbsd.org>
5.\" Copyright (c) 2015 Joel Sing <jsing@openbsd.org> 5.\" Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
6.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org> 6.\" Copyright (c) 2015 Bob Beck <beck@openbsd.org>
7.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
7.\" 8.\"
8.\" Permission to use, copy, modify, and distribute this software for any 9.\" Permission to use, copy, modify, and distribute this software for any
9.\" purpose with or without fee is hereby granted, provided that the above 10.\" purpose with or without fee is hereby granted, provided that the above
@@ -17,7 +18,7 @@
17.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 18.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 19.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19.\" 20.\"
20.Dd $Mdocdate: January 28 2017 $ 21.Dd $Mdocdate: February 20 2017 $
21.Dt TLS_READ 3 22.Dt TLS_READ 3
22.Os 23.Os
23.Sh NAME 24.Sh NAME
@@ -106,8 +107,20 @@ return 0 on success or -1 on error.
106.Fn tls_error 107.Fn tls_error
107returns 108returns
108.Dv NULL 109.Dv NULL
109if no error occurred or the first place, or if memory allocation 110if no error occurred with
110failed while trying to assemble the string describing the error. 111.Fa ctx
112during or since the last call to
113.Fn tls_handshake ,
114.Fn tls_read ,
115.Fn tls_write ,
116.Fn tls_close ,
117or
118.Fn tls_reset
119involving
120.Fa ctx ,
121or if memory allocation failed while trying to assemble the string
122describing the most recent error related to
123.Fa ctx .
111.Pp 124.Pp
112The 125The
113.Fn tls_read , 126.Fn tls_read ,
@@ -215,3 +228,18 @@ appeared in
215.An Joel Sing Aq Mt jsing@openbsd.org 228.An Joel Sing Aq Mt jsing@openbsd.org
216with contributions from 229with contributions from
217.An Bob Beck Aq Mt beck@openbsd.org 230.An Bob Beck Aq Mt beck@openbsd.org
231.Sh CAVEATS
232The function
233.Fn tls_error
234returns an internal pointer.
235It must not be freed by the application, or a double free error
236will occur.
237The pointer will become invalid when the next error occurs with
238.Fa ctx .
239Consequently, if the application may need the message at a later
240time, it has to copy the string before calling the next
241.Sy libtls
242function involving
243.Fa ctx ,
244or a segmentation fault or read access to unintended data is the
245likely result.