diff options
author | schwarze <> | 2018-02-27 18:30:30 +0000 |
---|---|---|
committer | schwarze <> | 2018-02-27 18:30:30 +0000 |
commit | d178a0bfaef776435417eab3923c3de1c3b57df1 (patch) | |
tree | 5c95692e2f038ad8b219972827dceae0b3c55801 | |
parent | c2a4b3cc2d9f73d481864b1d74bd0c426c765ca6 (diff) | |
download | openbsd-d178a0bfaef776435417eab3923c3de1c3b57df1.tar.gz openbsd-d178a0bfaef776435417eab3923c3de1c3b57df1.tar.bz2 openbsd-d178a0bfaef776435417eab3923c3de1c3b57df1.zip |
Import SSL_CTX_set_tlsext_use_srtp(3) from OpenSSL, slightly tweaked by me.
-rw-r--r-- | src/lib/libssl/man/Makefile | 3 | ||||
-rw-r--r-- | src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3 | 188 |
2 files changed, 190 insertions, 1 deletions
diff --git a/src/lib/libssl/man/Makefile b/src/lib/libssl/man/Makefile index 9679441fc4..2d32f44dbf 100644 --- a/src/lib/libssl/man/Makefile +++ b/src/lib/libssl/man/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # $OpenBSD: Makefile,v 1.62 2018/02/24 19:24:09 schwarze Exp $ | 1 | # $OpenBSD: Makefile,v 1.63 2018/02/27 18:30:30 schwarze Exp $ |
2 | 2 | ||
3 | .include <bsd.own.mk> | 3 | .include <bsd.own.mk> |
4 | 4 | ||
@@ -44,6 +44,7 @@ MAN = BIO_f_ssl.3 \ | |||
44 | SSL_CTX_set_tlsext_servername_callback.3 \ | 44 | SSL_CTX_set_tlsext_servername_callback.3 \ |
45 | SSL_CTX_set_tlsext_status_cb.3 \ | 45 | SSL_CTX_set_tlsext_status_cb.3 \ |
46 | SSL_CTX_set_tlsext_ticket_key_cb.3 \ | 46 | SSL_CTX_set_tlsext_ticket_key_cb.3 \ |
47 | SSL_CTX_set_tlsext_use_srtp.3 \ | ||
47 | SSL_CTX_set_tmp_dh_callback.3 \ | 48 | SSL_CTX_set_tmp_dh_callback.3 \ |
48 | SSL_CTX_set_tmp_rsa_callback.3 \ | 49 | SSL_CTX_set_tmp_rsa_callback.3 \ |
49 | SSL_CTX_set_verify.3 \ | 50 | SSL_CTX_set_verify.3 \ |
diff --git a/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3 b/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3 new file mode 100644 index 0000000000..d4af103d42 --- /dev/null +++ b/src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3 | |||
@@ -0,0 +1,188 @@ | |||
1 | .\" $OpenBSD: SSL_CTX_set_tlsext_use_srtp.3,v 1.1 2018/02/27 18:30:30 schwarze Exp $ | ||
2 | .\" full merge up to: OpenSSL 3733ce61 Aug 21 08:44:14 2017 +0100 | ||
3 | .\" | ||
4 | .\" This file was written by Matt Caswell <matt@openssl.org>. | ||
5 | .\" Copyright (c) 2017 The OpenSSL Project. All rights reserved. | ||
6 | .\" | ||
7 | .\" Redistribution and use in source and binary forms, with or without | ||
8 | .\" modification, are permitted provided that the following conditions | ||
9 | .\" are met: | ||
10 | .\" | ||
11 | .\" 1. Redistributions of source code must retain the above copyright | ||
12 | .\" notice, this list of conditions and the following disclaimer. | ||
13 | .\" | ||
14 | .\" 2. Redistributions in binary form must reproduce the above copyright | ||
15 | .\" notice, this list of conditions and the following disclaimer in | ||
16 | .\" the documentation and/or other materials provided with the | ||
17 | .\" distribution. | ||
18 | .\" | ||
19 | .\" 3. All advertising materials mentioning features or use of this | ||
20 | .\" software must display the following acknowledgment: | ||
21 | .\" "This product includes software developed by the OpenSSL Project | ||
22 | .\" for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
23 | .\" | ||
24 | .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
25 | .\" endorse or promote products derived from this software without | ||
26 | .\" prior written permission. For written permission, please contact | ||
27 | .\" openssl-core@openssl.org. | ||
28 | .\" | ||
29 | .\" 5. Products derived from this software may not be called "OpenSSL" | ||
30 | .\" nor may "OpenSSL" appear in their names without prior written | ||
31 | .\" permission of the OpenSSL Project. | ||
32 | .\" | ||
33 | .\" 6. Redistributions of any form whatsoever must retain the following | ||
34 | .\" acknowledgment: | ||
35 | .\" "This product includes software developed by the OpenSSL Project | ||
36 | .\" for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
37 | .\" | ||
38 | .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
39 | .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
40 | .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
41 | .\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
42 | .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
43 | .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
44 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
45 | .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
46 | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
47 | .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
48 | .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
49 | .\" OF THE POSSIBILITY OF SUCH DAMAGE. | ||
50 | .\" | ||
51 | .Dd $Mdocdate: February 27 2018 $ | ||
52 | .Dt SSL_CTX_SET_TLSEXT_USE_SRTP 3 | ||
53 | .Os | ||
54 | .Sh NAME | ||
55 | .Nm SSL_CTX_set_tlsext_use_srtp , | ||
56 | .Nm SSL_set_tlsext_use_srtp , | ||
57 | .Nm SSL_get_srtp_profiles , | ||
58 | .Nm SSL_get_selected_srtp_profile | ||
59 | .Nd Configure and query SRTP support | ||
60 | .Sh SYNOPSIS | ||
61 | .In openssl/srtp.h | ||
62 | .Ft int | ||
63 | .Fo SSL_CTX_set_tlsext_use_srtp | ||
64 | .Fa "SSL_CTX *ctx" | ||
65 | .Fa "const char *profiles" | ||
66 | .Fc | ||
67 | .Ft int | ||
68 | .Fo SSL_set_tlsext_use_srtp | ||
69 | .Fa "SSL *ssl" | ||
70 | .Fa "const char *profiles" | ||
71 | .Fc | ||
72 | .Ft STACK_OF(SRTP_PROTECTION_PROFILE) * | ||
73 | .Fo SSL_get_srtp_profiles | ||
74 | .Fa "SSL *ssl" | ||
75 | .Fc | ||
76 | .Ft SRTP_PROTECTION_PROFILE * | ||
77 | .Fo SSL_get_selected_srtp_profile | ||
78 | .Fa "SSL *ssl" | ||
79 | .Fc | ||
80 | .Sh DESCRIPTION | ||
81 | SRTP is the Secure Real-Time Transport Protocol. | ||
82 | OpenSSL implements support for the "use_srtp" DTLS extension | ||
83 | defined in RFC5764. | ||
84 | This provides a mechanism for establishing SRTP keying material, | ||
85 | algorithms and parameters using DTLS. | ||
86 | This capability may be used as part of an implementation that | ||
87 | conforms to RFC5763. | ||
88 | OpenSSL does not implement SRTP itself or RFC5763. | ||
89 | Note that OpenSSL does not support the use of SRTP Master Key | ||
90 | Identifiers (MKIs). | ||
91 | Also note that this extension is only supported in DTLS. | ||
92 | Any SRTP configuration is ignored if a TLS connection is attempted. | ||
93 | .Pp | ||
94 | An OpenSSL client wishing to send the "use_srtp" extension should call | ||
95 | .Fn SSL_CTX_set_tlsext_use_srtp | ||
96 | to set its use for all | ||
97 | .Vt SSL | ||
98 | objects subsequently created from | ||
99 | .Fa ctx . | ||
100 | Alternatively a client may call | ||
101 | .Fn SSL_set_tlsext_use_srtp | ||
102 | to set its use for an individual | ||
103 | .Vt SSL | ||
104 | object. | ||
105 | The | ||
106 | .Fa profiles | ||
107 | parameter should point to a NUL-terminated, colon delimited list of | ||
108 | SRTP protection profile names. | ||
109 | .Pp | ||
110 | The currently supported protection profile names are: | ||
111 | .Bl -tag -width Ds | ||
112 | .It Dv SRTP_AES128_CM_SHA1_80 | ||
113 | This corresponds to SRTP_AES128_CM_HMAC_SHA1_80 defined in RFC5764. | ||
114 | .It Dv SRTP_AES128_CM_SHA1_32 | ||
115 | This corresponds to SRTP_AES128_CM_HMAC_SHA1_32 defined in RFC5764. | ||
116 | .El | ||
117 | .Pp | ||
118 | Supplying an unrecognised protection profile name results in an error. | ||
119 | .Pp | ||
120 | An OpenSSL server wishing to support the "use_srtp" extension should | ||
121 | also call | ||
122 | .Fn SSL_CTX_set_tlsext_use_srtp | ||
123 | or | ||
124 | .Fn SSL_set_tlsext_use_srtp | ||
125 | to indicate the protection profiles that it is willing to negotiate. | ||
126 | .Pp | ||
127 | The currently configured list of protection profiles for either a client | ||
128 | or a server can be obtained by calling | ||
129 | .Fn SSL_get_srtp_profiles . | ||
130 | This returns a stack of | ||
131 | .Vt SRTP_PROTECTION_PROFILE | ||
132 | objects. | ||
133 | The memory pointed to in the return value of this function should not be | ||
134 | freed by the caller. | ||
135 | .Pp | ||
136 | After a handshake has been completed, the negotiated SRTP protection | ||
137 | profile (if any) can be obtained (on the client or the server) by | ||
138 | calling | ||
139 | .Fn SSL_get_selected_srtp_profile . | ||
140 | This function returns | ||
141 | .Dv NULL | ||
142 | if no SRTP protection profile was negotiated. | ||
143 | The memory returned from this function should not be freed by the | ||
144 | caller. | ||
145 | .Pp | ||
146 | If an SRTP protection profile has been sucessfully negotiated, | ||
147 | then the SRTP keying material (on both the client and server) | ||
148 | should be obtained by calling | ||
149 | .Xr SSL_export_keying_material 3 | ||
150 | with a | ||
151 | .Fa label | ||
152 | of | ||
153 | .Qq EXTRACTOR-dtls_srtp , | ||
154 | a | ||
155 | .Fa context | ||
156 | of | ||
157 | .Dv NULL , | ||
158 | and a | ||
159 | .Fa use_context | ||
160 | argument of 0. | ||
161 | The total length of keying material obtained should be equal to two | ||
162 | times the sum of the master key length and the salt length as defined | ||
163 | for the protection profile in use. | ||
164 | This provides the client write master key, the server write master key, | ||
165 | the client write master salt and the server write master salt in that | ||
166 | order. | ||
167 | .Sh RETURN VALUES | ||
168 | Contrary to OpenSSL conventions, | ||
169 | .Fn SSL_CTX_set_tlsext_use_srtp | ||
170 | and | ||
171 | .Fn SSL_set_tlsext_use_srtp | ||
172 | return 0 on success or 1 on error. | ||
173 | .Pp | ||
174 | .Fn SSL_get_srtp_profiles | ||
175 | returns a stack of | ||
176 | .Vt SRTP_PROTECTION_PROFILE | ||
177 | objects on success or | ||
178 | .Dv NULL | ||
179 | on error or if no protection profiles have been configured. | ||
180 | .Pp | ||
181 | .Fn SSL_get_selected_srtp_profile | ||
182 | returns a pointer to an | ||
183 | .Vt SRTP_PROTECTION_PROFILE | ||
184 | object if one has been negotiated or | ||
185 | .Dv NULL | ||
186 | otherwise. | ||
187 | .Sh SEE ALSO | ||
188 | .Xr SSL_export_keying_material 3 | ||