diff options
| author | jsing <> | 2015-02-15 13:33:14 +0000 | 
|---|---|---|
| committer | jsing <> | 2015-02-15 13:33:14 +0000 | 
| commit | 3dbac869f1034ed967bdef2a4b0f58103bff3088 (patch) | |
| tree | ee671008f827f93f98921e23170b7c3aae1a935d | |
| parent | 23a04fa2273190c4874c5263ecbaf03e743b19f6 (diff) | |
| download | openbsd-3dbac869f1034ed967bdef2a4b0f58103bff3088.tar.gz openbsd-3dbac869f1034ed967bdef2a4b0f58103bff3088.tar.bz2 openbsd-3dbac869f1034ed967bdef2a4b0f58103bff3088.zip | |
Document tls_config_parse_protocols() and update documentation for
tls_config_set_protocols().
| -rw-r--r-- | src/lib/libtls/Makefile | 3 | ||||
| -rw-r--r-- | src/lib/libtls/tls_init.3 | 29 | 
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 | ||
| 3 | CFLAGS+= -Wall -Werror -Wimplicit | 3 | CFLAGS+= -Wall -Werror -Wimplicit | 
| 4 | CFLAGS+= -DLIBRESSL_INTERNAL | 4 | CFLAGS+= -DLIBRESSL_INTERNAL | 
| @@ -20,6 +20,7 @@ MAN= tls_init.3 | |||
| 20 | 20 | ||
| 21 | MLINKS+=tls_init.3 tls_config_new.3 | 21 | MLINKS+=tls_init.3 tls_config_new.3 | 
| 22 | MLINKS+=tls_init.3 tls_config_free.3 | 22 | MLINKS+=tls_init.3 tls_config_free.3 | 
| 23 | MLINKS+=tls_init.3 tls_config_parse_protocols.3 | ||
| 23 | MLINKS+=tls_init.3 tls_config_set_ca_file.3 | 24 | MLINKS+=tls_init.3 tls_config_set_ca_file.3 | 
| 24 | MLINKS+=tls_init.3 tls_config_set_ca_path.3 | 25 | MLINKS+=tls_init.3 tls_config_set_ca_path.3 | 
| 25 | MLINKS+=tls_init.3 tls_config_set_ca_mem.3 | 26 | MLINKS+=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. | |||
| 208 | frees a configuration object. | 211 | frees a configuration object. | 
| 209 | .El | 212 | .El | 
| 210 | .Pp | 213 | .Pp | 
| 214 | The | ||
| 215 | .Fn tls_config_parse_protocols | ||
| 216 | function parses a protocol string and returns the corresponding value via the | ||
| 217 | .Ar protocols | ||
| 218 | argument. | ||
| 219 | This value can then be passed to the | ||
| 220 | .Fn tls_config_set_protocols | ||
| 221 | function. | ||
| 222 | The protocol string is a comma or colon separated list of keywords. | ||
| 223 | Valid keywords are tlsv1.0, tlsv1.1, tlsv1.2, all (all supported protocols), | ||
| 224 | default (an alias for secure), legacy (an alias for all) and secure (currently | ||
| 225 | TLSv1.2 only). | ||
| 226 | If a value has a negative prefix (in the form of a leading exclamation mark) | ||
| 227 | then it is removed from the list of available protocols, rather than being | ||
| 228 | added to it. | ||
| 229 | .Pp | ||
| 211 | The following functions modify a configuration by setting parameters. | 230 | The following functions modify a configuration by setting parameters. | 
| 212 | Configuration options may apply to only clients or only servers or both. | 231 | Configuration 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 | 
| 259 | Additionally, the values | 278 | Additionally, 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 | 
