dtlsconnection: do not set keys_exported flag if actually not exported
authorMiguel Paris <mparisdiaz@gmail.com>
Wed, 1 Apr 2020 16:08:45 +0000 (18:08 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 26 Jun 2020 07:19:28 +0000 (10:19 +0300)
commit3dd2bbf23cb8c7c1f4efc4106858602fb9e57ecc
treee8534b7d8fcd27680a6318ebfe9aab6e5e5dbf38
parent117f593cff5b6ba5ef9d0d1100ede56c8756809c
dtlsconnection: do not set keys_exported flag if actually not exported

keys_exported flag should be set only if keys are actually exported.
For that the next conditions are needed:
  1 - SSL_export_keying_material on success
  2 - SSL_get_selected_srtp_profile returns a valid profile
  3 - The profile ID is SRTP_AES128_CM_SHA1_80 or SRTP_AES128_CM_SHA1_32

Also don't crash if NULL is returned as profile.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1156>
ext/dtls/gstdtlsconnection.c