summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2016-09-04 12:03:24 +0000
committerjsing <>2016-09-04 12:03:24 +0000
commit1065b80f68d7b85ea1dbc56b3198bcff3a079b30 (patch)
treecc40a727fed54e9ce1a7cc0483ea8d78ab283416 /src
parentef745a12d6659f6c4fde2e9094bd306fdf6afa0d (diff)
downloadopenbsd-1065b80f68d7b85ea1dbc56b3198bcff3a079b30.tar.gz
openbsd-1065b80f68d7b85ea1dbc56b3198bcff3a079b30.tar.bz2
openbsd-1065b80f68d7b85ea1dbc56b3198bcff3a079b30.zip
State that libtls functions apply to both clients and servers, unless
noted otherwise. Remove all of the now redundant "client and server" notations and change the client and server notations to "client only" and "server only". With input from jmc@. ok beck@ jmc@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libtls/tls_init.363
1 files changed, 16 insertions, 47 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3
index 4d7367408b..f9a8ac1f80 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.67 2016/08/22 14:55:59 jsing Exp $ 1.\" $OpenBSD: tls_init.3,v 1.68 2016/09/04 12:03:24 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: August 22 2016 $ 17.Dd $Mdocdate: September 4 2016 $
18.Dt TLS_INIT 3 18.Dt TLS_INIT 3
19.Os 19.Os
20.Sh NAME 20.Sh NAME
@@ -307,45 +307,38 @@ then it is removed from the list of available protocols, rather than being
307added to it. 307added to it.
308.Pp 308.Pp
309The following functions modify a configuration by setting parameters (the 309The following functions modify a configuration by setting parameters (the
310configuration options may only apply to clients, to servers or to both): 310configuration options apply to both clients and servers, unless noted
311otherwise):
311.Bl -bullet -offset four 312.Bl -bullet -offset four
312.It 313.It
313.Fn tls_config_add_keypair_file 314.Fn tls_config_add_keypair_file
314adds an additional public certificate and private key from the specified files, 315adds an additional public certificate and private key from the specified files,
315used as an alternative certificate for Server Name Indication. 316used as an alternative certificate for Server Name Indication (server only).
316.Em (Server)
317.It 317.It
318.Fn tls_config_set_keypair_mem 318.Fn tls_config_set_keypair_mem
319adds an additional public certificate and private key from memory, 319adds an additional public certificate and private key from memory,
320used as an alternative certificate for Server Name Indication. 320used as an alternative certificate for Server Name Indication (server only).
321.Em (Server)
322.It 321.It
323.Fn tls_config_set_alpn 322.Fn tls_config_set_alpn
324sets the ALPN protocols that are supported. 323sets the ALPN protocols that are supported.
325The alpn string is a comma separated list of protocols, in order of preference. 324The alpn string is a comma separated list of protocols, in order of preference.
326.Em (Client and Server)
327.It 325.It
328.Fn tls_config_set_ca_file 326.Fn tls_config_set_ca_file
329sets the filename used to load a file 327sets the filename used to load a file
330containing the root certificates. 328containing the root certificates.
331.Em (Client and Server)
332.It 329.It
333.Fn tls_config_set_ca_path 330.Fn tls_config_set_ca_path
334sets the path (directory) which should be searched for root 331sets the path (directory) which should be searched for root
335certificates. 332certificates.
336.Em (Client and Server)
337.It 333.It
338.Fn tls_config_set_ca_mem 334.Fn tls_config_set_ca_mem
339sets the root certificates directly from memory. 335sets the root certificates directly from memory.
340.Em (Client and Server)
341.It 336.It
342.Fn tls_config_set_cert_file 337.Fn tls_config_set_cert_file
343sets file from which the public certificate will be read. 338sets file from which the public certificate will be read.
344.Em (Client and server)
345.It 339.It
346.Fn tls_config_set_cert_mem 340.Fn tls_config_set_cert_mem
347sets the public certificate directly from memory. 341sets the public certificate directly from memory.
348.Em (Client and server)
349.It 342.It
350.Fn tls_config_set_ciphers 343.Fn tls_config_set_ciphers
351sets the list of ciphers that may be used. 344sets the list of ciphers that may be used.
@@ -363,24 +356,18 @@ Alternatively, libssl cipher strings can be specified.
363See the CIPHERS section of 356See the CIPHERS section of
364.Xr openssl 1 357.Xr openssl 1
365for further information. 358for further information.
366.Pp
367.Em (Client and server)
368.It 359.It
369.Fn tls_config_set_key_file 360.Fn tls_config_set_key_file
370sets the file from which the private key will be read. 361sets the file from which the private key will be read.
371.Em (Client and server)
372.It 362.It
373.Fn tls_config_set_key_mem 363.Fn tls_config_set_key_mem
374directly sets the private key from memory. 364directly sets the private key from memory.
375.Em (Client and server)
376.It 365.It
377.Fn tls_config_set_keypair_file 366.Fn tls_config_set_keypair_file
378sets the files from which the public certificate and private key will be read. 367sets the files from which the public certificate and private key will be read.
379.Em (Client and server)
380.It 368.It
381.Fn tls_config_set_keypair_mem 369.Fn tls_config_set_keypair_mem
382directly sets the public certificate and private key from memory. 370directly sets the public certificate and private key from memory.
383.Em (Client and server)
384.It 371.It
385.Fn tls_config_set_protocols 372.Fn tls_config_set_protocols
386sets which versions of the protocol may be used. 373sets which versions of the protocol may be used.
@@ -399,56 +386,48 @@ Additionally, the values
399(all supported protocols) and 386(all supported protocols) and
400.Dv TLS_PROTOCOLS_DEFAULT 387.Dv TLS_PROTOCOLS_DEFAULT
401(TLSv1.2 only) may be used. 388(TLSv1.2 only) may be used.
402.Em (Client and server)
403.It 389.It
404.Fn tls_config_prefer_ciphers_client 390.Fn tls_config_prefer_ciphers_client
405prefers ciphers in the client's cipher list when selecting a cipher suite. 391prefers ciphers in the client's cipher list when selecting a cipher suite
392(server only).
406This is considered to be less secure than preferring the server's list. 393This is considered to be less secure than preferring the server's list.
407.Em (Server)
408.It 394.It
409.Fn tls_config_prefer_ciphers_server 395.Fn tls_config_prefer_ciphers_server
410prefers ciphers in the server's cipher list when selecting a cipher suite. 396prefers ciphers in the server's cipher list when selecting a cipher suite
397(server only).
411This is considered to be more secure than preferring the client's list and is 398This is considered to be more secure than preferring the client's list and is
412the default. 399the default.
413.Em (Server)
414.It 400.It
415.Fn tls_config_clear_keys 401.Fn tls_config_clear_keys
416clears any secret keys from memory. 402clears any secret keys from memory.
417.Em (Server)
418.It 403.It
419.Fn tls_config_insecure_noverifycert 404.Fn tls_config_insecure_noverifycert
420disables certificate verification. 405disables certificate verification.
421Be extremely careful when using this option. 406Be extremely careful when using this option.
422.Em (Client and server)
423.It 407.It
424.Fn tls_config_insecure_noverifyname 408.Fn tls_config_insecure_noverifyname
425disables server name verification. 409disables server name verification (client only).
426Be careful when using this option. 410Be careful when using this option.
427.Em (Client)
428.It 411.It
429.Fn tls_config_insecure_noverifytime 412.Fn tls_config_insecure_noverifytime
430disables validity checking of certificates. 413disables validity checking of certificates.
431Be careful when using this option. 414Be careful when using this option.
432.Em (Client and server)
433.It 415.It
434.Fn tls_config_verify 416.Fn tls_config_verify
435reenables server name and certificate verification. 417reenables server name and certificate verification.
436.Em (Client)
437.It 418.It
438.Fn tls_config_verify_client 419.Fn tls_config_verify_client
439enables client certificate verification, requiring the client to send 420enables client certificate verification, requiring the client to send
440a certificate. 421a certificate (server only).
441.Em (Server)
442.It 422.It
443.Fn tls_config_verify_client_optional 423.Fn tls_config_verify_client_optional
444enables client certificate verification, without requiring the client 424enables client certificate verification, without requiring the client
445to send a certificate. 425to send a certificate (server only).
446.Em (Server)
447.El 426.El
448.Pp 427.Pp
449The following functions return information about a TLS connection and will only 428The following functions return information about a TLS connection and will only
450succeed after the handshake is complete (the connection information may only 429succeed after the handshake is complete (the connection information applies
451apply to clients, to servers or to both): 430to both clients and servers, unless noted otherwise):
452.Bl -bullet -offset four 431.Bl -bullet -offset four
453.It 432.It
454.Fn tls_conn_alpn_selected 433.Fn tls_conn_alpn_selected
@@ -456,19 +435,16 @@ returns a string that specifies the ALPN protocol selected for use with the peer
456connected to 435connected to
457.Ar ctx . 436.Ar ctx .
458If no protocol was selected then NULL is returned. 437If no protocol was selected then NULL is returned.
459.Em (Server and Client)
460.It 438.It
461.Fn tls_conn_cipher 439.Fn tls_conn_cipher
462returns a string corresponding to the cipher suite negotiated with the peer 440returns a string corresponding to the cipher suite negotiated with the peer
463connected to 441connected to
464.Ar ctx . 442.Ar ctx .
465.Em (Server and client)
466.It 443.It
467.Fn tls_conn_servername 444.Fn tls_conn_servername
468returns a string corresponding to the servername that the client connected to 445returns a string corresponding to the servername that the client connected to
469.Ar ctx 446.Ar ctx
470requested by sending a TLS Server Name Indication extension. 447requested by sending a TLS Server Name Indication extension (server only).
471.Em (Server)
472.It 448.It
473.Fn tls_conn_version 449.Fn tls_conn_version
474returns a string corresponding to a TLS version negotiated with the peer 450returns a string corresponding to a TLS version negotiated with the peer
@@ -479,7 +455,6 @@ connected to
479checks if the peer of 455checks if the peer of
480.Ar ctx 456.Ar ctx
481has provided a certificate. 457has provided a certificate.
482.Em (Server and client)
483.It 458.It
484.Fn tls_peer_cert_contains_name 459.Fn tls_peer_cert_contains_name
485checks if the peer of a TLS 460checks if the peer of a TLS
@@ -487,19 +462,16 @@ checks if the peer of a TLS
487has provided a certificate that contains a 462has provided a certificate that contains a
488SAN or CN that matches 463SAN or CN that matches
489.Ar name . 464.Ar name .
490.Em (Server and client)
491.It 465.It
492.Fn tls_peer_cert_subject 466.Fn tls_peer_cert_subject
493returns a string 467returns a string
494corresponding to the subject of the peer certificate from 468corresponding to the subject of the peer certificate from
495.Ar ctx . 469.Ar ctx .
496.Em (Server and client)
497.It 470.It
498.Fn tls_peer_cert_issuer 471.Fn tls_peer_cert_issuer
499returns a string 472returns a string
500corresponding to the issuer of the peer certificate from 473corresponding to the issuer of the peer certificate from
501.Ar ctx . 474.Ar ctx .
502.Em (Server and client)
503.It 475.It
504.Fn tls_peer_cert_hash 476.Fn tls_peer_cert_hash
505returns a string 477returns a string
@@ -520,13 +492,11 @@ printf "SHA256:${h}\\n"
520returns the time corresponding to the start of the validity period of 492returns the time corresponding to the start of the validity period of
521the peer certificate from 493the peer certificate from
522.Ar ctx . 494.Ar ctx .
523.Em (Server and client)
524.It 495.It
525.Fn tls_peer_cert_notafter 496.Fn tls_peer_cert_notafter
526returns the time corresponding to the end of the validity period of 497returns the time corresponding to the end of the validity period of
527the peer certificate from 498the peer certificate from
528.Ar ctx . 499.Ar ctx .
529.Em (Server and client)
530.El 500.El
531.Pp 501.Pp
532The following are TLS related utility functions: 502The following are TLS related utility functions:
@@ -541,7 +511,6 @@ or
541A private key will be decrypted if the optional 511A private key will be decrypted if the optional
542.Ar password 512.Ar password
543argument is specified. 513argument is specified.
544.Em (Client and server)
545.El 514.El
546.Pp 515.Pp
547The following functions create, prepare, and free a connection context: 516The following functions create, prepare, and free a connection context: