mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
sdp: gstmikey: gst_mikey_message_to_caps: extract salt and append to srtp-key
A KEMAC can hold both key and salt, so if salt is present, we should extract it and append it to the srtp-key cap because libsrtp expects the srtp-key to hold the concantenated srtp master key and salt. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3568>
This commit is contained in:
parent
5678151799
commit
a62b07f3b4
1 changed files with 6 additions and 1 deletions
|
@ -2489,7 +2489,7 @@ gst_mikey_message_to_caps (const GstMIKEYMessage * msg, GstCaps * caps)
|
||||||
GstMIKEYPayloadKEMAC *p = (GstMIKEYPayloadKEMAC *) payload;
|
GstMIKEYPayloadKEMAC *p = (GstMIKEYPayloadKEMAC *) payload;
|
||||||
const GstMIKEYPayload *sub;
|
const GstMIKEYPayload *sub;
|
||||||
GstMIKEYPayloadKeyData *pkd;
|
GstMIKEYPayloadKeyData *pkd;
|
||||||
GstBuffer *buf;
|
GstBuffer *buf, *saltbuf;
|
||||||
|
|
||||||
if (p->enc_alg != GST_MIKEY_ENC_NULL || p->mac_alg != GST_MIKEY_MAC_NULL)
|
if (p->enc_alg != GST_MIKEY_ENC_NULL || p->mac_alg != GST_MIKEY_MAC_NULL)
|
||||||
goto done;
|
goto done;
|
||||||
|
@ -2502,6 +2502,11 @@ gst_mikey_message_to_caps (const GstMIKEYMessage * msg, GstCaps * caps)
|
||||||
|
|
||||||
pkd = (GstMIKEYPayloadKeyData *) sub;
|
pkd = (GstMIKEYPayloadKeyData *) sub;
|
||||||
buf = gst_buffer_new_memdup (pkd->key_data, pkd->key_len);
|
buf = gst_buffer_new_memdup (pkd->key_data, pkd->key_len);
|
||||||
|
if (pkd->salt_len) {
|
||||||
|
saltbuf = gst_buffer_new_memdup (pkd->salt_data, pkd->salt_len);
|
||||||
|
gst_buffer_append (buf, saltbuf);
|
||||||
|
gst_buffer_unref (saltbuf);
|
||||||
|
}
|
||||||
gst_caps_set_simple (caps, "srtp-key", GST_TYPE_BUFFER, buf, NULL);
|
gst_caps_set_simple (caps, "srtp-key", GST_TYPE_BUFFER, buf, NULL);
|
||||||
gst_buffer_unref (buf);
|
gst_buffer_unref (buf);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue