SSL_export_keying_material.pod revision 325337
1=pod
2
3=head1 NAME
4
5SSL_export_keying_material - obtain keying material for application use
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen,
12                                const char *label, size_t llen,
13                                const unsigned char *context,
14                                size_t contextlen, int use_context);
15
16=head1 DESCRIPTION
17
18During the creation of a TLS or DTLS connection shared keying material is
19established between the two endpoints. The function SSL_export_keying_material()
20enables an application to use some of this keying material for its own purposes
21in accordance with RFC5705.
22
23An application may need to securely establish the context within which this
24keying material will be used. For example this may include identifiers for the
25application session, application algorithms or parameters, or the lifetime of
26the context. The context value is left to the application but must be the same
27on both sides of the communication.
28
29For a given SSL connection B<s>, B<olen> bytes of data will be written to
30B<out>. The application specific context should be supplied in the location
31pointed to by B<context> and should be B<contextlen> bytes long. Provision of
32a context is optional. If the context should be omitted entirely then
33B<use_context> should be set to 0. Otherwise it should be any other value. If
34B<use_context> is 0 then the values of B<context> and B<contextlen> are ignored.
35Note that a zero length context is treated differently to no context at all, and
36will result in different keying material being returned.
37
38An application specific label should be provided in the location pointed to by
39B<label> and should be B<llen> bytes long. Typically this will be a value from
40the IANA Exporter Label Registry
41(L<https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#exporter-labels>).
42Alternatively labels beginning with "EXPERIMENTAL" are permitted by the standard
43to be used without registration.
44
45Note that this function is only defined for TLSv1.0 and above, and DTLSv1.0 and
46above. Attempting to use it in SSLv3 will result in an error.
47
48=head1 RETURN VALUES
49
50SSL_export_keying_material() returns 0 or -1 on failure or 1 on success.
51
52=head1 COPYRIGHT
53
54Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
55
56Licensed under the OpenSSL license (the "License").  You may not use
57this file except in compliance with the License.  You can obtain a copy
58in the file LICENSE in the source distribution or at
59L<https://www.openssl.org/source/license.html>.
60
61=cut
62