summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorschwarze <>2018-02-27 18:30:30 +0000
committerschwarze <>2018-02-27 18:30:30 +0000
commitd178a0bfaef776435417eab3923c3de1c3b57df1 (patch)
tree5c95692e2f038ad8b219972827dceae0b3c55801
parentc2a4b3cc2d9f73d481864b1d74bd0c426c765ca6 (diff)
downloadopenbsd-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/Makefile3
-rw-r--r--src/lib/libssl/man/SSL_CTX_set_tlsext_use_srtp.3188
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
81SRTP is the Secure Real-Time Transport Protocol.
82OpenSSL implements support for the "use_srtp" DTLS extension
83defined in RFC5764.
84This provides a mechanism for establishing SRTP keying material,
85algorithms and parameters using DTLS.
86This capability may be used as part of an implementation that
87conforms to RFC5763.
88OpenSSL does not implement SRTP itself or RFC5763.
89Note that OpenSSL does not support the use of SRTP Master Key
90Identifiers (MKIs).
91Also note that this extension is only supported in DTLS.
92Any SRTP configuration is ignored if a TLS connection is attempted.
93.Pp
94An OpenSSL client wishing to send the "use_srtp" extension should call
95.Fn SSL_CTX_set_tlsext_use_srtp
96to set its use for all
97.Vt SSL
98objects subsequently created from
99.Fa ctx .
100Alternatively a client may call
101.Fn SSL_set_tlsext_use_srtp
102to set its use for an individual
103.Vt SSL
104object.
105The
106.Fa profiles
107parameter should point to a NUL-terminated, colon delimited list of
108SRTP protection profile names.
109.Pp
110The currently supported protection profile names are:
111.Bl -tag -width Ds
112.It Dv SRTP_AES128_CM_SHA1_80
113This corresponds to SRTP_AES128_CM_HMAC_SHA1_80 defined in RFC5764.
114.It Dv SRTP_AES128_CM_SHA1_32
115This corresponds to SRTP_AES128_CM_HMAC_SHA1_32 defined in RFC5764.
116.El
117.Pp
118Supplying an unrecognised protection profile name results in an error.
119.Pp
120An OpenSSL server wishing to support the "use_srtp" extension should
121also call
122.Fn SSL_CTX_set_tlsext_use_srtp
123or
124.Fn SSL_set_tlsext_use_srtp
125to indicate the protection profiles that it is willing to negotiate.
126.Pp
127The currently configured list of protection profiles for either a client
128or a server can be obtained by calling
129.Fn SSL_get_srtp_profiles .
130This returns a stack of
131.Vt SRTP_PROTECTION_PROFILE
132objects.
133The memory pointed to in the return value of this function should not be
134freed by the caller.
135.Pp
136After a handshake has been completed, the negotiated SRTP protection
137profile (if any) can be obtained (on the client or the server) by
138calling
139.Fn SSL_get_selected_srtp_profile .
140This function returns
141.Dv NULL
142if no SRTP protection profile was negotiated.
143The memory returned from this function should not be freed by the
144caller.
145.Pp
146If an SRTP protection profile has been sucessfully negotiated,
147then the SRTP keying material (on both the client and server)
148should be obtained by calling
149.Xr SSL_export_keying_material 3
150with a
151.Fa label
152of
153.Qq EXTRACTOR-dtls_srtp ,
154a
155.Fa context
156of
157.Dv NULL ,
158and a
159.Fa use_context
160argument of 0.
161The total length of keying material obtained should be equal to two
162times the sum of the master key length and the salt length as defined
163for the protection profile in use.
164This provides the client write master key, the server write master key,
165the client write master salt and the server write master salt in that
166order.
167.Sh RETURN VALUES
168Contrary to OpenSSL conventions,
169.Fn SSL_CTX_set_tlsext_use_srtp
170and
171.Fn SSL_set_tlsext_use_srtp
172return 0 on success or 1 on error.
173.Pp
174.Fn SSL_get_srtp_profiles
175returns a stack of
176.Vt SRTP_PROTECTION_PROFILE
177objects on success or
178.Dv NULL
179on error or if no protection profiles have been configured.
180.Pp
181.Fn SSL_get_selected_srtp_profile
182returns a pointer to an
183.Vt SRTP_PROTECTION_PROFILE
184object if one has been negotiated or
185.Dv NULL
186otherwise.
187.Sh SEE ALSO
188.Xr SSL_export_keying_material 3