summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2017-02-20 13:09:15 +0000
committerschwarze <>2017-02-20 13:09:15 +0000
commit4565e979c4bc23c9029219f98144e218958f0de5 (patch)
tree04d13d955e559423c5b686fdcf26ac7cc33c112e
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@
-rw-r--r--src/lib/libtls/man/tls_init.329
-rw-r--r--src/lib/libtls/man/tls_read.336
2 files changed, 59 insertions, 6 deletions
diff --git a/src/lib/libtls/man/tls_init.3 b/src/lib/libtls/man/tls_init.3
index 36d2e29084..b17bb814fe 100644
--- a/src/lib/libtls/man/tls_init.3
+++ b/src/lib/libtls/man/tls_init.3
@@ -1,7 +1,8 @@
1.\" $OpenBSD: tls_init.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ 1.\" $OpenBSD: tls_init.3,v 1.4 2017/02/20 13:09:15 schwarze Exp $
2.\" 2.\"
3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4.\" Copyright (c) 2016 Joel Sing <jsing@openbsd.org> 4.\" Copyright (c) 2016 Joel Sing <jsing@openbsd.org>
5.\" Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
5.\" 6.\"
6.\" Permission to use, copy, modify, and distribute this software for any 7.\" Permission to use, copy, modify, and distribute this software for any
7.\" purpose with or without fee is hereby granted, provided that the above 8.\" purpose with or without fee is hereby granted, provided that the above
@@ -15,7 +16,7 @@
15.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 16.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 17.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17.\" 18.\"
18.Dd $Mdocdate: January 28 2017 $ 19.Dd $Mdocdate: February 20 2017 $
19.Dt TLS_INIT 3 20.Dt TLS_INIT 3
20.Os 21.Os
21.Sh NAME 22.Sh NAME
@@ -107,6 +108,15 @@ returns 0 on success or -1 on error.
107returns 108returns
108.Dv NULL 109.Dv NULL
109on error or an out of memory condition. 110on error or an out of memory condition.
111.Pp
112.Fn tls_config_error
113returns
114.Dv NULL
115if no error occured with
116.Fa config
117at all, or if memory allocation failed while trying to assemble the
118string describing the most recent error related to
119.Fa config .
110.Sh SEE ALSO 120.Sh SEE ALSO
111.Xr tls_accept_socket 3 , 121.Xr tls_accept_socket 3 ,
112.Xr tls_client 3 , 122.Xr tls_client 3 ,
@@ -142,3 +152,18 @@ appeared in
142.Pp 152.Pp
143Many others contributed to various parts of the library; see the 153Many others contributed to various parts of the library; see the
144individual manual pages for more information. 154individual manual pages for more information.
155.Sh CAVEATS
156The function
157.Fn tls_config_error
158returns an internal pointer.
159It must not be freed by the application, or a double free error
160will occur.
161The pointer will become invalid when the next error occurs with
162.Fa config .
163Consequently, if the application may need the message at a later
164time, it has to copy the string before calling the next
165.Sy libtls
166function involving
167.Fa config ,
168or a segmentation fault or read access to unintended data is the
169likely result.
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.