summaryrefslogtreecommitdiff
path: root/lib/libtls/tls_init.3
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2016-04-28 16:48:45 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2016-04-28 16:48:45 +0000
commiteb65459604e2a7010ecdda143c94d347c8f4bacf (patch)
treebc04b26a80d2c2dcf489b0d8b4da92145a78ac54 /lib/libtls/tls_init.3
parent2e30d192e1b3f71af1f52191a4eee816cdc76a37 (diff)
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