summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorjsing <>2015-02-15 13:33:14 +0000
committerjsing <>2015-02-15 13:33:14 +0000
commit4e8dcc3be3a44bacbaeb4f967669477a05aea21b (patch)
treeee671008f827f93f98921e23170b7c3aae1a935d /src/lib
parentb14ee9fa51f3b9946c30db015d8cebc5cf62d1cc (diff)
downloadopenbsd-4e8dcc3be3a44bacbaeb4f967669477a05aea21b.tar.gz
openbsd-4e8dcc3be3a44bacbaeb4f967669477a05aea21b.tar.bz2
openbsd-4e8dcc3be3a44bacbaeb4f967669477a05aea21b.zip
Document tls_config_parse_protocols() and update documentation for
tls_config_set_protocols().
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libtls/Makefile3
-rw-r--r--src/lib/libtls/tls_init.329
2 files changed, 27 insertions, 5 deletions
diff --git a/src/lib/libtls/Makefile b/src/lib/libtls/Makefile
index 61368bccfd..6baf210143 100644
--- a/src/lib/libtls/Makefile
+++ b/src/lib/libtls/Makefile
@@ -1,4 +1,4 @@
1# $OpenBSD: Makefile,v 1.5 2015/02/11 07:01:10 jsing Exp $ 1# $OpenBSD: Makefile,v 1.6 2015/02/15 13:33:14 jsing Exp $
2 2
3CFLAGS+= -Wall -Werror -Wimplicit 3CFLAGS+= -Wall -Werror -Wimplicit
4CFLAGS+= -DLIBRESSL_INTERNAL 4CFLAGS+= -DLIBRESSL_INTERNAL
@@ -20,6 +20,7 @@ MAN= tls_init.3
20 20
21MLINKS+=tls_init.3 tls_config_new.3 21MLINKS+=tls_init.3 tls_config_new.3
22MLINKS+=tls_init.3 tls_config_free.3 22MLINKS+=tls_init.3 tls_config_free.3
23MLINKS+=tls_init.3 tls_config_parse_protocols.3
23MLINKS+=tls_init.3 tls_config_set_ca_file.3 24MLINKS+=tls_init.3 tls_config_set_ca_file.3
24MLINKS+=tls_init.3 tls_config_set_ca_path.3 25MLINKS+=tls_init.3 tls_config_set_ca_path.3
25MLINKS+=tls_init.3 tls_config_set_ca_mem.3 26MLINKS+=tls_init.3 tls_config_set_ca_mem.3
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3
index c1e59383c4..5f72d9549b 100644
--- a/src/lib/libtls/tls_init.3
+++ b/src/lib/libtls/tls_init.3
@@ -1,4 +1,4 @@
1.\" $OpenBSD: tls_init.3,v 1.12 2015/02/11 07:01:10 jsing Exp $ 1.\" $OpenBSD: tls_init.3,v 1.13 2015/02/15 13:33:14 jsing Exp $
2.\" 2.\"
3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> 3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4.\" 4.\"
@@ -14,7 +14,7 @@
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\" 16.\"
17.Dd $Mdocdate: February 11 2015 $ 17.Dd $Mdocdate: February 15 2015 $
18.Dt TLS 3 18.Dt TLS 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -22,6 +22,7 @@
22.Nm tls_error , 22.Nm tls_error ,
23.Nm tls_config_new , 23.Nm tls_config_new ,
24.Nm tls_config_free , 24.Nm tls_config_free ,
25.Nm tls_config_parse_protocols ,
25.Nm tls_config_set_ca_file , 26.Nm tls_config_set_ca_file ,
26.Nm tls_config_set_ca_path , 27.Nm tls_config_set_ca_path ,
27.Nm tls_config_set_ca_mem , 28.Nm tls_config_set_ca_mem ,
@@ -64,6 +65,8 @@
64.Ft "void" 65.Ft "void"
65.Fn tls_config_free "struct tls_config *config" 66.Fn tls_config_free "struct tls_config *config"
66.Ft "int" 67.Ft "int"
68.Fn tls_config_parse_protocols "uint32_t *protocols" "const char *protostr"
69.Ft "int"
67.Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file" 70.Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file"
68.Ft "int" 71.Ft "int"
69.Fn tls_config_set_ca_path "struct tls_config *config" "const char *ca_path" 72.Fn tls_config_set_ca_path "struct tls_config *config" "const char *ca_path"
@@ -208,6 +211,22 @@ allocates a new default configuration object.
208frees a configuration object. 211frees a configuration object.
209.El 212.El
210.Pp 213.Pp
214The
215.Fn tls_config_parse_protocols
216function parses a protocol string and returns the corresponding value via the
217.Ar protocols
218argument.
219This value can then be passed to the
220.Fn tls_config_set_protocols
221function.
222The protocol string is a comma or colon separated list of keywords.
223Valid keywords are tlsv1.0, tlsv1.1, tlsv1.2, all (all supported protocols),
224default (an alias for secure), legacy (an alias for all) and secure (currently
225TLSv1.2 only).
226If a value has a negative prefix (in the form of a leading exclamation mark)
227then it is removed from the list of available protocols, rather than being
228added to it.
229.Pp
211The following functions modify a configuration by setting parameters. 230The following functions modify a configuration by setting parameters.
212Configuration options may apply to only clients or only servers or both. 231Configuration options may apply to only clients or only servers or both.
213.Bl -bullet -offset four 232.Bl -bullet -offset four
@@ -258,9 +277,11 @@ Possible values are the bitwise OR of:
258.Pp 277.Pp
259Additionally, the values 278Additionally, the values
260.Dv TLS_PROTOCOL_TLSv1 279.Dv TLS_PROTOCOL_TLSv1
261(all TLS versions) and 280(TLSv1.0, TLSv1.1 and TLSv1.2),
281.Dv TLS_PROTOCOLS_ALL
282(all supported protocols) and
262.Dv TLS_PROTOCOLS_DEFAULT 283.Dv TLS_PROTOCOLS_DEFAULT
263(currently all TLS versions) may be used. 284(TLSv1.2 only) may be used.
264.Em (Client and server) 285.Em (Client and server)
265.It 286.It
266.Fn tls_config_clear_keys 287.Fn tls_config_clear_keys