diff options
author | jsing <> | 2018-02-10 04:43:16 +0000 |
---|---|---|
committer | jsing <> | 2018-02-10 04:43:16 +0000 |
commit | a65702226b7ff26155233ebc9d8ece695d77fba7 (patch) | |
tree | cee45eb89743392a35df8b2c40ec5feabf5018c2 | |
parent | ad2580ae7b71760c38ec88f34f360d5f1e6b3f13 (diff) | |
download | openbsd-a65702226b7ff26155233ebc9d8ece695d77fba7.tar.gz openbsd-a65702226b7ff26155233ebc9d8ece695d77fba7.tar.bz2 openbsd-a65702226b7ff26155233ebc9d8ece695d77fba7.zip |
Document functions for client-side TLS session support.
-rw-r--r-- | src/lib/libtls/man/tls_config_set_session_id.3 | 42 | ||||
-rw-r--r-- | src/lib/libtls/man/tls_conn_version.3 | 23 |
2 files changed, 56 insertions, 9 deletions
diff --git a/src/lib/libtls/man/tls_config_set_session_id.3 b/src/lib/libtls/man/tls_config_set_session_id.3 index 7106de46df..e8a5e60cd7 100644 --- a/src/lib/libtls/man/tls_config_set_session_id.3 +++ b/src/lib/libtls/man/tls_config_set_session_id.3 | |||
@@ -1,6 +1,7 @@ | |||
1 | .\" $OpenBSD: tls_config_set_session_id.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ | 1 | .\" $OpenBSD: tls_config_set_session_id.3,v 1.4 2018/02/10 04:43:16 jsing Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2017 Claudio Jeker <claudio@openbsd.org> | 3 | .\" Copyright (c) 2017 Claudio Jeker <claudio@openbsd.org> |
4 | .\" Copyright (c) 2018 Joel Sing <jsing@openbsd.org> | ||
4 | .\" | 5 | .\" |
5 | .\" Permission to use, copy, modify, and distribute this software for any | 6 | .\" Permission to use, copy, modify, and distribute this software for any |
6 | .\" purpose with or without fee is hereby granted, provided that the above | 7 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -14,10 +15,11 @@ | |||
14 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
15 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
16 | .\" | 17 | .\" |
17 | .Dd $Mdocdate: January 28 2017 $ | 18 | .Dd $Mdocdate: February 10 2018 $ |
18 | .Dt TLS_CONFIG_SET_SESSION_ID 3 | 19 | .Dt TLS_CONFIG_SET_SESSION_ID 3 |
19 | .Os | 20 | .Os |
20 | .Sh NAME | 21 | .Sh NAME |
22 | .Nm tls_config_set_session_fd , | ||
21 | .Nm tls_config_set_session_id , | 23 | .Nm tls_config_set_session_id , |
22 | .Nm tls_config_set_session_lifetime , | 24 | .Nm tls_config_set_session_lifetime , |
23 | .Nm tls_config_add_ticket_key | 25 | .Nm tls_config_add_ticket_key |
@@ -25,6 +27,11 @@ | |||
25 | .Sh SYNOPSIS | 27 | .Sh SYNOPSIS |
26 | .In tls.h | 28 | .In tls.h |
27 | .Ft int | 29 | .Ft int |
30 | .Fo tls_config_set_session_fd | ||
31 | .Fa "struct tls_config *config" | ||
32 | .Fa "int session_fd" | ||
33 | .Fc | ||
34 | .Ft int | ||
28 | .Fo tls_config_set_session_id | 35 | .Fo tls_config_set_session_id |
29 | .Fa "struct tls_config *config" | 36 | .Fa "struct tls_config *config" |
30 | .Fa "const unsigned char *session_id" | 37 | .Fa "const unsigned char *session_id" |
@@ -43,18 +50,32 @@ | |||
43 | .Fa "size_t keylen" | 50 | .Fa "size_t keylen" |
44 | .Fc | 51 | .Fc |
45 | .Sh DESCRIPTION | 52 | .Sh DESCRIPTION |
53 | .Fn tls_config_set_session_fd | ||
54 | sets a file descriptor to be used to manage data for TLS sessions (client only). | ||
55 | The given file descriptor must be a regular file and be owned by the current | ||
56 | user, with permissions being restricted to only allow the owner to read and | ||
57 | write the file (0600). | ||
58 | If the file has a non-zero length, the client will attempt to read session | ||
59 | data from this file and resume the previous TLS session with the server. | ||
60 | Upon a successful handshake the file will be updated with current session | ||
61 | data. | ||
62 | The caller is responsible for closing this file descriptor, after all TLS | ||
63 | contexts that have been configured to use it have been freed via | ||
64 | .Fn tls_free . | ||
65 | .Pp | ||
46 | .Fn tls_config_set_session_id | 66 | .Fn tls_config_set_session_id |
47 | sets the session identifier that will be used by the TLS server when | 67 | sets the session identifier that will be used by the TLS server when |
48 | sessions are enabled. | 68 | sessions are enabled (server only). |
49 | By default a random value is used. | 69 | By default a random value is used. |
50 | .Pp | 70 | .Pp |
51 | .Fn tls_config_set_session_lifetime | 71 | .Fn tls_config_set_session_lifetime |
52 | sets the lifetime to be used for TLS sessions. | 72 | sets the lifetime to be used for TLS sessions (server only). |
53 | Session support is disabled if a lifetime of zero is specified, which is the | 73 | Session support is disabled if a lifetime of zero is specified, which is the |
54 | default. | 74 | default. |
55 | .Pp | 75 | .Pp |
56 | .Fn tls_config_add_ticket_key | 76 | .Fn tls_config_add_ticket_key |
57 | adds a key used for the encryption and authentication of TLS tickets. | 77 | adds a key used for the encryption and authentication of TLS tickets |
78 | (server only). | ||
58 | By default keys are generated and rotated automatically based on their lifetime. | 79 | By default keys are generated and rotated automatically based on their lifetime. |
59 | This function should only be used to synchronise ticket encryption key across | 80 | This function should only be used to synchronise ticket encryption key across |
60 | multiple processes. | 81 | multiple processes. |
@@ -69,7 +90,16 @@ These functions return 0 on success or -1 on error. | |||
69 | .Xr tls_load_file 3 , | 90 | .Xr tls_load_file 3 , |
70 | .Xr tls_server 3 | 91 | .Xr tls_server 3 |
71 | .Sh HISTORY | 92 | .Sh HISTORY |
72 | These functions appeared in | 93 | .Fn tls_config_set_session_id , |
94 | .Fn tls_config_set_session_lifetime | ||
95 | and | ||
96 | .Fn tls_config_add_ticket_key | ||
97 | appeared in | ||
73 | .Ox 6.1 . | 98 | .Ox 6.1 . |
99 | .Pp | ||
100 | .Fn tls_config_set_session_fd | ||
101 | appeared in | ||
102 | .Ox 6.3 . | ||
74 | .Sh AUTHORS | 103 | .Sh AUTHORS |
75 | .An Claudio Jeker Aq Mt claudio@openbsd.org | 104 | .An Claudio Jeker Aq Mt claudio@openbsd.org |
105 | .An Joel Sing Aq Mt jsing@openbsd.org | ||
diff --git a/src/lib/libtls/man/tls_conn_version.3 b/src/lib/libtls/man/tls_conn_version.3 index f8a1678e8c..d9ee4ac4b6 100644 --- a/src/lib/libtls/man/tls_conn_version.3 +++ b/src/lib/libtls/man/tls_conn_version.3 | |||
@@ -1,7 +1,7 @@ | |||
1 | .\" $OpenBSD: tls_conn_version.3,v 1.6 2017/10/08 06:56:36 jmc Exp $ | 1 | .\" $OpenBSD: tls_conn_version.3,v 1.7 2018/02/10 04:43:16 jsing Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2015 Bob Beck <beck@openbsd.org> | 3 | .\" Copyright (c) 2015 Bob Beck <beck@openbsd.org> |
4 | .\" Copyright (c) 2016 Joel Sing <jsing@openbsd.org> | 4 | .\" Copyright (c) 2016, 2018 Joel Sing <jsing@openbsd.org> |
5 | .\" | 5 | .\" |
6 | .\" Permission to use, copy, modify, and distribute this software for any | 6 | .\" Permission to use, copy, modify, and distribute this software for any |
7 | .\" purpose with or without fee is hereby granted, provided that the above | 7 | .\" purpose with or without fee is hereby granted, provided that the above |
@@ -15,7 +15,7 @@ | |||
15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 15 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 16 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
17 | .\" | 17 | .\" |
18 | .Dd $Mdocdate: October 8 2017 $ | 18 | .Dd $Mdocdate: February 10 2018 $ |
19 | .Dt TLS_CONN_VERSION 3 | 19 | .Dt TLS_CONN_VERSION 3 |
20 | .Os | 20 | .Os |
21 | .Sh NAME | 21 | .Sh NAME |
@@ -23,6 +23,7 @@ | |||
23 | .Nm tls_conn_cipher , | 23 | .Nm tls_conn_cipher , |
24 | .Nm tls_conn_alpn_selected , | 24 | .Nm tls_conn_alpn_selected , |
25 | .Nm tls_conn_servername , | 25 | .Nm tls_conn_servername , |
26 | .Nm tls_conn_session_resumed , | ||
26 | .Nm tls_peer_cert_provided , | 27 | .Nm tls_peer_cert_provided , |
27 | .Nm tls_peer_cert_contains_name , | 28 | .Nm tls_peer_cert_contains_name , |
28 | .Nm tls_peer_cert_chain_pem , | 29 | .Nm tls_peer_cert_chain_pem , |
@@ -43,6 +44,8 @@ | |||
43 | .Ft const char * | 44 | .Ft const char * |
44 | .Fn tls_conn_servername "struct tls *ctx" | 45 | .Fn tls_conn_servername "struct tls *ctx" |
45 | .Ft int | 46 | .Ft int |
47 | .Fn tls_conn_session_resumed "struct tls *ctx" | ||
48 | .Ft int | ||
46 | .Fn tls_peer_cert_provided "struct tls *ctx" | 49 | .Fn tls_peer_cert_provided "struct tls *ctx" |
47 | .Ft int | 50 | .Ft int |
48 | .Fo tls_peer_cert_contains_name | 51 | .Fo tls_peer_cert_contains_name |
@@ -90,6 +93,12 @@ returns a string corresponding to the servername that the client connected to | |||
90 | .Ar ctx | 93 | .Ar ctx |
91 | requested by sending a TLS Server Name Indication extension (server only). | 94 | requested by sending a TLS Server Name Indication extension (server only). |
92 | .Pp | 95 | .Pp |
96 | .Fn tls_conn_session_resumed | ||
97 | indicates whether a TLS session has been resumed during the handshake with | ||
98 | the server connected to | ||
99 | .Ar ctx | ||
100 | (client only). | ||
101 | .Pp | ||
93 | .Fn tls_peer_cert_provided | 102 | .Fn tls_peer_cert_provided |
94 | checks if the peer of | 103 | checks if the peer of |
95 | .Ar ctx | 104 | .Ar ctx |
@@ -146,6 +155,10 @@ POINTER TO | |||
146 | .Xr tls_ocsp_process_response 3 | 155 | .Xr tls_ocsp_process_response 3 |
147 | .Sh RETURN VALUES | 156 | .Sh RETURN VALUES |
148 | The | 157 | The |
158 | .Fn tls_conn_session_resumed | ||
159 | function returns 1 if a TLS session was resumed or 0 if it was not. | ||
160 | .Pp | ||
161 | The | ||
149 | .Fn tls_peer_cert_provided | 162 | .Fn tls_peer_cert_provided |
150 | and | 163 | and |
151 | .Fn tls_peer_cert_contains_name | 164 | .Fn tls_peer_cert_contains_name |
@@ -183,6 +196,10 @@ and | |||
183 | .Fn tls_conn_alpn_selected | 196 | .Fn tls_conn_alpn_selected |
184 | appeared in | 197 | appeared in |
185 | .Ox 6.1 . | 198 | .Ox 6.1 . |
199 | .Pp | ||
200 | .Fn tls_conn_session_resumed | ||
201 | appeared in | ||
202 | .Ox 6.3 . | ||
186 | .Sh AUTHORS | 203 | .Sh AUTHORS |
187 | .An Bob Beck Aq Mt beck@openbsd.org | 204 | .An Bob Beck Aq Mt beck@openbsd.org |
188 | .An Joel Sing Aq Mt jsing@openbsd.org | 205 | .An Joel Sing Aq Mt jsing@openbsd.org |