diff options
| author | schwarze <> | 2017-02-20 13:09:15 +0000 |
|---|---|---|
| committer | schwarze <> | 2017-02-20 13:09:15 +0000 |
| commit | bed6069126e89ffb93d1298db322577383495227 (patch) | |
| tree | 04d13d955e559423c5b686fdcf26ac7cc33c112e /src/lib/libtls/man/tls_init.3 | |
| parent | 17eaedeba84258abf9626346d66e5be2d6f42442 (diff) | |
| download | openbsd-bed6069126e89ffb93d1298db322577383495227.tar.gz openbsd-bed6069126e89ffb93d1298db322577383495227.tar.bz2 openbsd-bed6069126e89ffb93d1298db322577383495227.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_init.3')
| -rw-r--r-- | src/lib/libtls/man/tls_init.3 | 29 |
1 files changed, 27 insertions, 2 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. | |||
| 107 | returns | 108 | returns |
| 108 | .Dv NULL | 109 | .Dv NULL |
| 109 | on error or an out of memory condition. | 110 | on error or an out of memory condition. |
| 111 | .Pp | ||
| 112 | .Fn tls_config_error | ||
| 113 | returns | ||
| 114 | .Dv NULL | ||
| 115 | if no error occured with | ||
| 116 | .Fa config | ||
| 117 | at all, or if memory allocation failed while trying to assemble the | ||
| 118 | string 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 |
| 143 | Many others contributed to various parts of the library; see the | 153 | Many others contributed to various parts of the library; see the |
| 144 | individual manual pages for more information. | 154 | individual manual pages for more information. |
| 155 | .Sh CAVEATS | ||
| 156 | The function | ||
| 157 | .Fn tls_config_error | ||
| 158 | returns an internal pointer. | ||
| 159 | It must not be freed by the application, or a double free error | ||
| 160 | will occur. | ||
| 161 | The pointer will become invalid when the next error occurs with | ||
| 162 | .Fa config . | ||
| 163 | Consequently, if the application may need the message at a later | ||
| 164 | time, it has to copy the string before calling the next | ||
| 165 | .Sy libtls | ||
| 166 | function involving | ||
| 167 | .Fa config , | ||
| 168 | or a segmentation fault or read access to unintended data is the | ||
| 169 | likely result. | ||
