diff options
author | beck <> | 2017-01-31 16:18:57 +0000 |
---|---|---|
committer | beck <> | 2017-01-31 16:18:57 +0000 |
commit | fb9dca0f0ed93924626f04529bb4dfa85e3ef25e (patch) | |
tree | 6cf82628d4d8b9b0ed4d03dd90872a7deae8fcb3 /src/lib/libtls/man | |
parent | 5dc75c022fd90332aaa1050db40f77ae54a9f43d (diff) | |
download | openbsd-fb9dca0f0ed93924626f04529bb4dfa85e3ef25e.tar.gz openbsd-fb9dca0f0ed93924626f04529bb4dfa85e3ef25e.tar.bz2 openbsd-fb9dca0f0ed93924626f04529bb4dfa85e3ef25e.zip |
Add tls_config_[add|set]keypair_ocsp functions so that ocsp staples may be
added associated to a keypair used for SNI, and are usable for more than
just the "main" certificate. Modify httpd to use this.
Bump libtls minor.
ok jsing@
Diffstat (limited to 'src/lib/libtls/man')
-rw-r--r-- | src/lib/libtls/man/tls_config_ocsp_require_stapling.3 | 33 | ||||
-rw-r--r-- | src/lib/libtls/man/tls_load_file.3 | 97 |
2 files changed, 91 insertions, 39 deletions
diff --git a/src/lib/libtls/man/tls_config_ocsp_require_stapling.3 b/src/lib/libtls/man/tls_config_ocsp_require_stapling.3 index 0f532cf8c0..b8b7600904 100644 --- a/src/lib/libtls/man/tls_config_ocsp_require_stapling.3 +++ b/src/lib/libtls/man/tls_config_ocsp_require_stapling.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: tls_config_ocsp_require_stapling.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ | 1 | .\" $OpenBSD: tls_config_ocsp_require_stapling.3,v 1.4 2017/01/31 16:18:57 beck Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2016 Bob Beck <beck@openbsd.org> | 3 | .\" Copyright (c) 2016 Bob Beck <beck@openbsd.org> |
4 | .\" | 4 | .\" |
@@ -14,46 +14,25 @@ | |||
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: January 28 2017 $ | 17 | .Dd $Mdocdate: January 31 2017 $ |
18 | .Dt TLS_CONFIG_OCSP_REQUIRE_STAPLING 3 | 18 | .Dt TLS_CONFIG_OCSP_REQUIRE_STAPLING 3 |
19 | .Os | 19 | .Os |
20 | .Sh NAME | 20 | .Sh NAME |
21 | .Nm tls_config_ocsp_require_stapling , | 21 | .Nm tls_config_ocsp_require_stapling , |
22 | .Nm tls_config_set_ocsp_staple_mem , | ||
23 | .Nm tls_config_set_ocsp_staple_file | ||
24 | .Nd OCSP configuration for libtls | 22 | .Nd OCSP configuration for libtls |
25 | .Sh SYNOPSIS | 23 | .Sh SYNOPSIS |
26 | .In tls.h | 24 | .In tls.h |
27 | .Ft void | 25 | .Ft void |
28 | .Fn tls_config_ocsp_require_stapling "struct tls_config *config" | 26 | .Fn tls_config_ocsp_require_stapling "struct tls_config *config" |
29 | .Ft int | ||
30 | .Fo tls_config_set_ocsp_staple_mem | ||
31 | .Fa "struct tls_config *config" | ||
32 | .Fa "const char *staple" | ||
33 | .Fa "size_t len" | ||
34 | .Fc | ||
35 | .Ft int | ||
36 | .Fo tls_config_set_ocsp_staple_file | ||
37 | .Fa "struct tls_config *config" | ||
38 | .Fa "const char *staple_file" | ||
39 | .Fc | 27 | .Fc |
40 | .Sh DESCRIPTION | 28 | .Sh DESCRIPTION |
41 | .Fn tls_config_ocsp_require_stapling | 29 | .Fn tls_config_ocsp_require_stapling |
42 | requires that a valid stapled OCSP response be provided during the TLS handshake. | 30 | requires that a valid stapled OCSP response be provided during the TLS handshake. |
43 | .Pp | ||
44 | .Fn tls_config_set_ocsp_staple_file | ||
45 | sets a DER-encoded OCSP response to be stapled during the TLS handshake from | ||
46 | the specified file. | ||
47 | .Pp | ||
48 | .Fn tls_config_set_ocsp_staple_mem | ||
49 | sets a DER-encoded OCSP response to be stapled during the TLS handshake from | ||
50 | memory. | ||
51 | .Sh RETURN VALUES | ||
52 | .Fn tls_config_set_ocsp_staple_mem | ||
53 | and | ||
54 | .Fn tls_config_set_ocsp_staple_file | ||
55 | return 0 on success or -1 on error. | ||
56 | .Sh SEE ALSO | 31 | .Sh SEE ALSO |
32 | .Xr tls_config_set_keypair_file 3 , | ||
33 | .Xr tls_config_set_keypair_mem 3 , | ||
34 | .Xr tls_config_add_keypair_file 3 , | ||
35 | .Xr tls_config_add_keypair_mem 3 , | ||
57 | .Xr tls_handshake 3 , | 36 | .Xr tls_handshake 3 , |
58 | .Xr tls_init 3 , | 37 | .Xr tls_init 3 , |
59 | .Xr tls_ocsp_process_response 3 | 38 | .Xr tls_ocsp_process_response 3 |
diff --git a/src/lib/libtls/man/tls_load_file.3 b/src/lib/libtls/man/tls_load_file.3 index eeebd0339e..6c0a025955 100644 --- a/src/lib/libtls/man/tls_load_file.3 +++ b/src/lib/libtls/man/tls_load_file.3 | |||
@@ -1,4 +1,4 @@ | |||
1 | .\" $OpenBSD: tls_load_file.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $ | 1 | .\" $OpenBSD: tls_load_file.3,v 1.4 2017/01/31 16:18:57 beck Exp $ |
2 | .\" | 2 | .\" |
3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> | 3 | .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org> |
4 | .\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> | 4 | .\" Copyright (c) 2015 Reyk Floeter <reyk@openbsd.org> |
@@ -17,7 +17,7 @@ | |||
17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | 17 | .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | 18 | .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
19 | .\" | 19 | .\" |
20 | .Dd $Mdocdate: January 28 2017 $ | 20 | .Dd $Mdocdate: January 31 2017 $ |
21 | .Dt TLS_LOAD_FILE 3 | 21 | .Dt TLS_LOAD_FILE 3 |
22 | .Os | 22 | .Os |
23 | .Sh NAME | 23 | .Sh NAME |
@@ -29,9 +29,15 @@ | |||
29 | .Nm tls_config_set_cert_mem , | 29 | .Nm tls_config_set_cert_mem , |
30 | .Nm tls_config_set_key_file , | 30 | .Nm tls_config_set_key_file , |
31 | .Nm tls_config_set_key_mem , | 31 | .Nm tls_config_set_key_mem , |
32 | .Nm tls_config_set_ocsp_staple_mem , | ||
33 | .Nm tls_config_set_ocsp_staple_file | ||
32 | .Nm tls_config_set_keypair_file , | 34 | .Nm tls_config_set_keypair_file , |
33 | .Nm tls_config_set_keypair_mem , | 35 | .Nm tls_config_set_keypair_mem , |
36 | .Nm tls_config_set_keypair_ocsp_file , | ||
37 | .Nm tls_config_set_keypair_ocsp_mem , | ||
34 | .Nm tls_config_add_keypair_file , | 38 | .Nm tls_config_add_keypair_file , |
39 | .Nm tls_config_add_keypair_ocsp_mem , | ||
40 | .Nm tls_config_add_keypair_ocsp_file , | ||
35 | .Nm tls_config_add_keypair_mem , | 41 | .Nm tls_config_add_keypair_mem , |
36 | .Nm tls_config_clear_keys , | 42 | .Nm tls_config_clear_keys , |
37 | .Nm tls_config_set_verify_depth , | 43 | .Nm tls_config_set_verify_depth , |
@@ -83,6 +89,17 @@ | |||
83 | .Fa "struct tls_config *config" | 89 | .Fa "struct tls_config *config" |
84 | .Fa "const uint8_t *key" | 90 | .Fa "const uint8_t *key" |
85 | .Fa "size_t len" | 91 | .Fa "size_t len" |
92 | .Ft int | ||
93 | .Fc | ||
94 | .Fo tls_config_set_ocsp_staple_mem | ||
95 | .Fa "struct tls_config *config" | ||
96 | .Fa "const uint8_t *staple" | ||
97 | .Fa "size_t len" | ||
98 | .Fc | ||
99 | .Ft int | ||
100 | .Fo tls_config_set_ocsp_staple_file | ||
101 | .Fa "struct tls_config *config" | ||
102 | .Fa "const uint8_t *staple_file" | ||
86 | .Fc | 103 | .Fc |
87 | .Ft int | 104 | .Ft int |
88 | .Fo tls_config_set_keypair_file | 105 | .Fo tls_config_set_keypair_file |
@@ -99,6 +116,23 @@ | |||
99 | .Fa "size_t key_len" | 116 | .Fa "size_t key_len" |
100 | .Fc | 117 | .Fc |
101 | .Ft int | 118 | .Ft int |
119 | .Fo tls_config_set_keypair_ocsp_file | ||
120 | .Fa "struct tls_config *config" | ||
121 | .Fa "const char *cert_file" | ||
122 | .Fa "const char *key_file" | ||
123 | .Fa "const char *staple_file" | ||
124 | .Fc | ||
125 | .Ft int | ||
126 | .Fo tls_config_set_keypair_ocsp_mem | ||
127 | .Fa "struct tls_config *config" | ||
128 | .Fa "const uint8_t *cert" | ||
129 | .Fa "size_t cert_len" | ||
130 | .Fa "const uint8_t *key" | ||
131 | .Fa "size_t key_len" | ||
132 | .Fa "const uint8_t *staple" | ||
133 | .Fa "size_t staple_len" | ||
134 | .Fc | ||
135 | .Ft int | ||
102 | .Fo tls_config_add_keypair_file | 136 | .Fo tls_config_add_keypair_file |
103 | .Fa "struct tls_config *config" | 137 | .Fa "struct tls_config *config" |
104 | .Fa "const char *cert_file" | 138 | .Fa "const char *cert_file" |
@@ -112,6 +146,23 @@ | |||
112 | .Fa "const uint8_t *key" | 146 | .Fa "const uint8_t *key" |
113 | .Fa "size_t key_len" | 147 | .Fa "size_t key_len" |
114 | .Fc | 148 | .Fc |
149 | .Ft int | ||
150 | .Fo tls_config_add_keypair_ocsp_file | ||
151 | .Fa "struct tls_config *config" | ||
152 | .Fa "const char *cert_file" | ||
153 | .Fa "const char *key_file" | ||
154 | .Fa "const char *staple_file" | ||
155 | .Fc | ||
156 | .Ft int | ||
157 | .Fo tls_config_add_keypair_ocsp_mem | ||
158 | .Fa "struct tls_config *config" | ||
159 | .Fa "const uint8_t *cert" | ||
160 | .Fa "size_t cert_len" | ||
161 | .Fa "const uint8_t *key" | ||
162 | .Fa "size_t key_len" | ||
163 | .Fa "const uint8_t *staple" | ||
164 | .Fa "size_t staple_len" | ||
165 | .Fc | ||
115 | .Ft void | 166 | .Ft void |
116 | .Fn tls_config_clear_keys "struct tls_config *config" | 167 | .Fn tls_config_clear_keys "struct tls_config *config" |
117 | .Ft int | 168 | .Ft int |
@@ -157,19 +208,46 @@ sets the file from which the private key will be read. | |||
157 | .Fn tls_config_set_key_mem | 208 | .Fn tls_config_set_key_mem |
158 | directly sets the private key from memory. | 209 | directly sets the private key from memory. |
159 | .Pp | 210 | .Pp |
211 | .Fn tls_config_set_ocsp_staple_file | ||
212 | sets a DER-encoded OCSP response to be stapled during the TLS handshake from | ||
213 | the specified file. | ||
214 | .Pp | ||
215 | .Fn tls_config_set_ocsp_staple_mem | ||
216 | sets a DER-encoded OCSP response to be stapled during the TLS handshake from | ||
217 | memory. | ||
218 | .Pp | ||
160 | .Fn tls_config_set_keypair_file | 219 | .Fn tls_config_set_keypair_file |
161 | sets the files from which the public certificate and private key will be read. | 220 | sets the files from which the public certificate, and private key will be read. |
162 | .Pp | 221 | .Pp |
163 | .Fn tls_config_set_keypair_mem | 222 | .Fn tls_config_set_keypair_mem |
164 | directly sets the public certificate and private key from memory. | 223 | directly sets the public certificate, and private key from memory. |
224 | .Pp | ||
225 | .Fn tls_config_set_keypair_file | ||
226 | sets the files from which the public certificate, private key, and DER encoded | ||
227 | ocsp staple will be read. | ||
228 | .Pp | ||
229 | .Fn tls_config_set_keypair_ocsp_mem | ||
230 | directly sets the public certificate, private key, and DER encoded OCSP staple | ||
231 | from memory. | ||
165 | .Pp | 232 | .Pp |
166 | .Fn tls_config_add_keypair_file | 233 | .Fn tls_config_add_keypair_file |
167 | adds an additional public certificate and private key from the specified files, | 234 | adds an additional public certificate, and private key from the specified files, |
168 | used as an alternative certificate for Server Name Indication (server only). | 235 | used as an alternative certificate for Server Name Indication (server only). |
169 | .Pp | 236 | .Pp |
170 | .Fn tls_config_add_keypair_mem | 237 | .Fn tls_config_add_keypair_mem |
171 | adds an additional public certificate and private key from memory, | 238 | adds an additional public certificate, and private key from memory, used as an |
172 | used as an alternative certificate for Server Name Indication (server only). | 239 | alternative certificate for Server Name Indication (server only). |
240 | .Pp | ||
241 | .Pp | ||
242 | .Fn tls_config_add_keypair_ocsp_file | ||
243 | adds an additional public certificate, private key, and DER encoded OCSP staple | ||
244 | from the specified files, used as an alternative certificate for Server Name | ||
245 | Indication (server only). | ||
246 | .Pp | ||
247 | .Fn tls_config_add_keypair_ocsp_mem | ||
248 | adds an additional public certificate, private key, and DER encoded OCSP staple | ||
249 | from memory, used as an alternative certificate for Server Name Indication | ||
250 | (server only). | ||
173 | .Pp | 251 | .Pp |
174 | .Fn tls_config_clear_keys | 252 | .Fn tls_config_clear_keys |
175 | clears any secret keys from memory. | 253 | clears any secret keys from memory. |
@@ -240,12 +318,7 @@ in | |||
240 | .An Joel Sing Aq Mt jsing@openbsd.org | 318 | .An Joel Sing Aq Mt jsing@openbsd.org |
241 | with contibutions from | 319 | with contibutions from |
242 | .An Ted Unangst Aq Mt tedu@openbsd.org | 320 | .An Ted Unangst Aq Mt tedu@openbsd.org |
243 | .Pp | ||
244 | .An -nosplit | ||
245 | .Fn tls_config_verify_client | ||
246 | and | 321 | and |
247 | .Fn tls_config_verify_client_optional | ||
248 | were written by | ||
249 | .An Bob Beck Aq Mt beck@openbsd.org . | 322 | .An Bob Beck Aq Mt beck@openbsd.org . |
250 | .Pp | 323 | .Pp |
251 | .Fn tls_load_file | 324 | .Fn tls_load_file |