SSL_CTX_set_tlsext_use_srtp.pod 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. =pod
  2. =head1 NAME
  3. SSL_CTX_set_tlsext_use_srtp,
  4. SSL_set_tlsext_use_srtp,
  5. SSL_get_srtp_profiles,
  6. SSL_get_selected_srtp_profile
  7. - Configure and query SRTP support
  8. =head1 SYNOPSIS
  9. #include <openssl/srtp.h>
  10. int SSL_CTX_set_tlsext_use_srtp(SSL_CTX *ctx, const char *profiles);
  11. int SSL_set_tlsext_use_srtp(SSL *ssl, const char *profiles);
  12. STACK_OF(SRTP_PROTECTION_PROFILE) *SSL_get_srtp_profiles(SSL *ssl);
  13. SRTP_PROTECTION_PROFILE *SSL_get_selected_srtp_profile(SSL *s);
  14. =head1 DESCRIPTION
  15. SRTP is the Secure Real-Time Transport Protocol. OpenSSL implements support for
  16. the "use_srtp" DTLS extension defined in RFC5764. This provides a mechanism for
  17. establishing SRTP keying material, algorithms and parameters using DTLS. This
  18. capability may be used as part of an implementation that conforms to RFC5763.
  19. OpenSSL does not implement SRTP itself or RFC5763. Note that OpenSSL does not
  20. support the use of SRTP Master Key Identifiers (MKIs). Also note that this
  21. extension is only supported in DTLS. Any SRTP configuration will be ignored if a
  22. TLS connection is attempted.
  23. An OpenSSL client wishing to send the "use_srtp" extension should call
  24. SSL_CTX_set_tlsext_use_srtp() to set its use for all SSL objects subsequently
  25. created from an SSL_CTX. Alternatively a client may call
  26. SSL_set_tlsext_use_srtp() to set its use for an individual SSL object. The
  27. B<profiles> parameters should point to a NUL-terminated, colon delimited list of
  28. SRTP protection profile names.
  29. The currently supported protection profile names are:
  30. =over 4
  31. =item SRTP_AES128_CM_SHA1_80
  32. This corresponds to SRTP_AES128_CM_HMAC_SHA1_80 defined in RFC5764.
  33. =item SRTP_AES128_CM_SHA1_32
  34. This corresponds to SRTP_AES128_CM_HMAC_SHA1_32 defined in RFC5764.
  35. =item SRTP_AEAD_AES_128_GCM
  36. This corresponds to the profile of the same name defined in RFC7714.
  37. =item SRTP_AEAD_AES_256_GCM
  38. This corresponds to the profile of the same name defined in RFC7714.
  39. =item SRTP_DOUBLE_AEAD_AES_128_GCM_AEAD_AES_128_GCM
  40. This corresponds to the profile of the same name defined in RFC8723.
  41. =item SRTP_DOUBLE_AEAD_AES_256_GCM_AEAD_AES_256_GCM
  42. This corresponds to the profile of the same name defined in RFC8723.
  43. =item SRTP_ARIA_128_CTR_HMAC_SHA1_80
  44. This corresponds to the profile of the same name defined in RFC8269.
  45. =item SRTP_ARIA_128_CTR_HMAC_SHA1_32
  46. This corresponds to the profile of the same name defined in RFC8269.
  47. =item SRTP_ARIA_256_CTR_HMAC_SHA1_80
  48. This corresponds to the profile of the same name defined in RFC8269.
  49. =item SRTP_ARIA_256_CTR_HMAC_SHA1_32
  50. This corresponds to the profile of the same name defined in RFC8269.
  51. =item SRTP_AEAD_ARIA_128_GCM
  52. This corresponds to the profile of the same name defined in RFC8269.
  53. =item SRTP_AEAD_ARIA_256_GCM
  54. This corresponds to the profile of the same name defined in RFC8269.
  55. =back
  56. Supplying an unrecognised protection profile name will result in an error.
  57. An OpenSSL server wishing to support the "use_srtp" extension should also call
  58. SSL_CTX_set_tlsext_use_srtp() or SSL_set_tlsext_use_srtp() to indicate the
  59. protection profiles that it is willing to negotiate.
  60. The currently configured list of protection profiles for either a client or a
  61. server can be obtained by calling SSL_get_srtp_profiles(). This returns a stack
  62. of SRTP_PROTECTION_PROFILE objects. The memory pointed to in the return value of
  63. this function should not be freed by the caller.
  64. After a handshake has been completed the negotiated SRTP protection profile (if
  65. any) can be obtained (on the client or the server) by calling
  66. SSL_get_selected_srtp_profile(). This function will return NULL if no SRTP
  67. protection profile was negotiated. The memory returned from this function should
  68. not be freed by the caller.
  69. If an SRTP protection profile has been successfully negotiated then the SRTP
  70. keying material (on both the client and server) should be obtained via a call to
  71. L<SSL_export_keying_material(3)>. This call should provide a label value of
  72. "EXTRACTOR-dtls_srtp" and a NULL context value (use_context is 0). The total
  73. length of keying material obtained should be equal to two times the sum of the
  74. master key length and the salt length as defined for the protection profile in
  75. use. This provides the client write master key, the server write master key, the
  76. client write master salt and the server write master salt in that order.
  77. =head1 RETURN VALUES
  78. SSL_CTX_set_tlsext_use_srtp() and SSL_set_tlsext_use_srtp() return 0 on success
  79. or 1 on error.
  80. SSL_get_srtp_profiles() returns a stack of SRTP_PROTECTION_PROFILE objects on
  81. success or NULL on error or if no protection profiles have been configured.
  82. SSL_get_selected_srtp_profile() returns a pointer to an SRTP_PROTECTION_PROFILE
  83. object if one has been negotiated or NULL otherwise.
  84. =head1 SEE ALSO
  85. L<ssl(7)>,
  86. L<SSL_export_keying_material(3)>
  87. =head1 COPYRIGHT
  88. Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
  89. Licensed under the Apache License 2.0 (the "License"). You may not use
  90. this file except in compliance with the License. You can obtain a copy
  91. in the file LICENSE in the source distribution or at
  92. L<https://www.openssl.org/source/license.html>.
  93. =cut