summaryrefslogtreecommitdiffstats
path: root/lib/libtls/tls_init.3
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2016-04-28 16:48:44 +0000
committerjsing <jsing@openbsd.org>2016-04-28 16:48:44 +0000
commita88e9e95f700d9db8d2f78052b581f175c0646f4 (patch)
treee88b38806fdcb15981a493bd8e37d1fa6655f646 /lib/libtls/tls_init.3
parentPlug a couple of leaks of input buffers. (diff)
downloadwireguard-openbsd-a88e9e95f700d9db8d2f78052b581f175c0646f4.tar.xz
wireguard-openbsd-a88e9e95f700d9db8d2f78052b581f175c0646f4.zip
Rework the error handling in libtls so that we can associate errors with
both configuration and contexts. This allows us to propagate errors that occur during configuration, rather than either just failing with no reason or delaying the failure until it can be propagated via the tls context. Also provide a tls_config_error() function for retrieving the last error from a tls_config *. ok bcook@
Diffstat (limited to 'lib/libtls/tls_init.3')
-rw-r--r--lib/libtls/tls_init.315
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/libtls/tls_init.3 b/lib/libtls/tls_init.3
index d5acc59cdc0..48662e08683 100644
--- a/lib/libtls/tls_init.3
+++ b/lib/libtls/tls_init.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: tls_init.3,v 1.56 2016/04/24 12:16:36 jmc Exp $
+.\" $OpenBSD: tls_init.3,v 1.57 2016/04/28 16:48:44 jsing Exp $
.\"
.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
.\"
@@ -14,11 +14,12 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: April 24 2016 $
+.Dd $Mdocdate: April 28 2016 $
.Dt TLS_INIT 3
.Os
.Sh NAME
.Nm tls_init ,
+.Nm tls_config_error ,
.Nm tls_error ,
.Nm tls_config_new ,
.Nm tls_config_free ,
@@ -75,8 +76,10 @@
.Ft "int"
.Fn tls_init "void"
.Ft "const char *"
-.Fn tls_error "struct tls *ctx"
+.Fn tls_config_error "struct tls *config"
.Ft "struct tls_config *"
+.Fn tls_error "struct tls *ctx"
+.Ft "const char *"
.Fn tls_config_new "void"
.Ft "void"
.Fn tls_config_free "struct tls_config *config"
@@ -668,9 +671,11 @@ while (len > 0) {
.Ed
.Sh ERRORS
The
+.Fn tls_config_error
+and
.Fn tls_error
-function may be used to retrieve a string containing more information
-about the most recent error.
+functions may be used to retrieve a string containing more information
+about the most recent error relating to a configuration or context.
.\" .Sh SEE ALSO
.Sh HISTORY
The