diff options
Diffstat (limited to 'src/lib/libtls/tls_init.3')
| -rw-r--r-- | src/lib/libtls/tls_init.3 | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/src/lib/libtls/tls_init.3 b/src/lib/libtls/tls_init.3 index b4c6a7cc3a..0969c093a1 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.62 2016/07/13 16:30:48 jsing Exp $ | 1 | .\" $OpenBSD: tls_init.3,v 1.63 2016/08/01 17:32:19 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: July 13 2016 $ | 17 | .Dd $Mdocdate: August 1 2016 $ |
| 18 | .Dt TLS_INIT 3 | 18 | .Dt TLS_INIT 3 |
| 19 | .Os | 19 | .Os |
| 20 | .Sh NAME | 20 | .Sh NAME |
| @@ -24,6 +24,7 @@ | |||
| 24 | .Nm tls_config_new , | 24 | .Nm tls_config_new , |
| 25 | .Nm tls_config_free , | 25 | .Nm tls_config_free , |
| 26 | .Nm tls_config_parse_protocols , | 26 | .Nm tls_config_parse_protocols , |
| 27 | .Nm tls_config_set_alpn , | ||
| 27 | .Nm tls_config_set_ca_file , | 28 | .Nm tls_config_set_ca_file , |
| 28 | .Nm tls_config_set_ca_path , | 29 | .Nm tls_config_set_ca_path , |
| 29 | .Nm tls_config_set_ca_mem , | 30 | .Nm tls_config_set_ca_mem , |
| @@ -54,8 +55,9 @@ | |||
| 54 | .Nm tls_peer_cert_hash , | 55 | .Nm tls_peer_cert_hash , |
| 55 | .Nm tls_peer_cert_notbefore , | 56 | .Nm tls_peer_cert_notbefore , |
| 56 | .Nm tls_peer_cert_notafter , | 57 | .Nm tls_peer_cert_notafter , |
| 57 | .Nm tls_conn_version , | 58 | .Nm tls_conn_alpn_selected , |
| 58 | .Nm tls_conn_cipher , | 59 | .Nm tls_conn_cipher , |
| 60 | .Nm tls_conn_version , | ||
| 59 | .Nm tls_load_file , | 61 | .Nm tls_load_file , |
| 60 | .Nm tls_client , | 62 | .Nm tls_client , |
| 61 | .Nm tls_server , | 63 | .Nm tls_server , |
| @@ -88,6 +90,8 @@ | |||
| 88 | .Ft "int" | 90 | .Ft "int" |
| 89 | .Fn tls_config_parse_protocols "uint32_t *protocols" "const char *protostr" | 91 | .Fn tls_config_parse_protocols "uint32_t *protocols" "const char *protostr" |
| 90 | .Ft "int" | 92 | .Ft "int" |
| 93 | .Fn tls_config_set_alpn "struct tls_config *config" "const char *alpn" | ||
| 94 | .Ft "int" | ||
| 91 | .Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file" | 95 | .Fn tls_config_set_ca_file "struct tls_config *config" "const char *ca_file" |
| 92 | .Ft "int" | 96 | .Ft "int" |
| 93 | .Fn tls_config_set_ca_path "struct tls_config *config" "const char *ca_path" | 97 | .Fn tls_config_set_ca_path "struct tls_config *config" "const char *ca_path" |
| @@ -148,9 +152,11 @@ | |||
| 148 | .Ft "time_t" | 152 | .Ft "time_t" |
| 149 | .Fn tls_peer_cert_notafter "struct tls *ctx" | 153 | .Fn tls_peer_cert_notafter "struct tls *ctx" |
| 150 | .Ft "const char *" | 154 | .Ft "const char *" |
| 151 | .Fn tls_conn_version "struct tls *ctx" | 155 | .Fn tls_conn_alpn_selected "struct tls *ctx" |
| 152 | .Ft "const char *" | 156 | .Ft "const char *" |
| 153 | .Fn tls_conn_cipher "struct tls *ctx" | 157 | .Fn tls_conn_cipher "struct tls *ctx" |
| 158 | .Ft "const char *" | ||
| 159 | .Fn tls_conn_version "struct tls *ctx" | ||
| 154 | .Ft "uint8_t *" | 160 | .Ft "uint8_t *" |
| 155 | .Fn tls_load_file "const char *file" "size_t *len" "char *password" | 161 | .Fn tls_load_file "const char *file" "size_t *len" "char *password" |
| 156 | .Ft "struct tls *" | 162 | .Ft "struct tls *" |
| @@ -295,6 +301,11 @@ The following functions modify a configuration by setting parameters. | |||
| 295 | Configuration options may apply to only clients or only servers or both. | 301 | Configuration options may apply to only clients or only servers or both. |
| 296 | .Bl -bullet -offset four | 302 | .Bl -bullet -offset four |
| 297 | .It | 303 | .It |
| 304 | .Fn tls_config_set_alpn | ||
| 305 | sets the ALPN protocols that are supported. | ||
| 306 | The alpn string is a comma separated list of protocols, in order of preference. | ||
| 307 | .Em (Client and Server) | ||
| 308 | .It | ||
| 298 | .Fn tls_config_set_ca_file | 309 | .Fn tls_config_set_ca_file |
| 299 | sets the filename used to load a file | 310 | sets the filename used to load a file |
| 300 | containing the root certificates. | 311 | containing the root certificates. |
| @@ -480,13 +491,14 @@ the peer certificate from | |||
| 480 | will only succeed after the handshake is complete. | 491 | will only succeed after the handshake is complete. |
| 481 | .Em (Server and client) | 492 | .Em (Server and client) |
| 482 | .It | 493 | .It |
| 483 | .Fn tls_conn_version | 494 | .Fn tls_conn_alpn_selected |
| 484 | returns a string | 495 | returns a string that specifies the ALPN protocol selected for use with the peer |
| 485 | corresponding to a TLS version negotiated with the peer | ||
| 486 | connected to | 496 | connected to |
| 487 | .Ar ctx . | 497 | .Ar ctx . |
| 488 | .Fn tls_conn_version | 498 | If no protocol was selected then NULL is returned. |
| 499 | .Fn tls_conn_alpn_selected | ||
| 489 | will only succeed after the handshake is complete. | 500 | will only succeed after the handshake is complete. |
| 501 | .Em (Server and Client) | ||
| 490 | .It | 502 | .It |
| 491 | .Fn tls_conn_cipher | 503 | .Fn tls_conn_cipher |
| 492 | returns a string | 504 | returns a string |
| @@ -497,6 +509,14 @@ connected to | |||
| 497 | will only succeed after the handshake is complete. | 509 | will only succeed after the handshake is complete. |
| 498 | .Em (Server and client) | 510 | .Em (Server and client) |
| 499 | .It | 511 | .It |
| 512 | .Fn tls_conn_version | ||
| 513 | returns a string | ||
| 514 | corresponding to a TLS version negotiated with the peer | ||
| 515 | connected to | ||
| 516 | .Ar ctx . | ||
| 517 | .Fn tls_conn_version | ||
| 518 | will only succeed after the handshake is complete. | ||
| 519 | .It | ||
| 500 | .Fn tls_load_file | 520 | .Fn tls_load_file |
| 501 | loads a certificate or key from disk into memory to be loaded with | 521 | loads a certificate or key from disk into memory to be loaded with |
| 502 | .Fn tls_config_set_ca_mem , | 522 | .Fn tls_config_set_ca_mem , |
