SSL_export_keying_material.pod 2.5 KB

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