After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 790315 - srt: add stream encryption support
srt: add stream encryption support
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other All
: Normal enhancement
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-11-14 07:44 UTC by Justin Kim
Modified: 2017-11-15 15:54 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[1/2] add gst_srt_client_connect_full (2.86 KB, patch)
2017-11-14 07:45 UTC, Justin Kim
none Details | Review
[2/2]: add properties and set to srt socket (9.34 KB, patch)
2017-11-14 07:45 UTC, Justin Kim
none Details | Review
srt: add passphrase and keylength (12.05 KB, patch)
2017-11-15 01:05 UTC, Justin Kim
committed Details | Review

Description Justin Kim 2017-11-14 07:44:25 UTC
For transmitting encrypted stream, SRT socket requires "passphrase" and crypto "key-length".
Comment 1 Justin Kim 2017-11-14 07:45:06 UTC
Created attachment 363557 [details] [review]
[1/2] add gst_srt_client_connect_full
Comment 2 Justin Kim 2017-11-14 07:45:43 UTC
Created attachment 363558 [details] [review]
[2/2]: add properties and set to srt socket
Comment 3 Olivier Crête 2017-11-14 19:34:28 UTC
Review of attachment 363557 [details] [review]:

::: ext/srt/gstsrt.c
@@ +82,3 @@
+  if (passphrase != NULL && passphrase[0] != '\0') {
+    srt_setsockopt (sock, 0, SRTO_PASSPHRASE, passphrase, strlen (passphrase));
+    srt_setsockopt (sock, 0, SRT_PBKEYLEN, &key_length, sizeof (int));

SRTO_PBKEYLEN
Comment 4 Olivier Crête 2017-11-14 19:38:15 UTC
Review of attachment 363558 [details] [review]:

Also squash with the other patch.

::: ext/srt/gstsrtbasesink.c
@@ +108,3 @@
+      break;
+    case PROP_KEY_LENGTH:
+      self->key_length = g_value_get_int (value);

g_return_if_fail (g_value_get_int (value) == 16 || .. == 32 || .. == 128);

::: ext/srt/gstsrtbasesrc.c
@@ +118,3 @@
+      break;
+    case PROP_KEY_LENGTH:
+      self->key_length = g_value_get_int (value);

same here

::: ext/srt/gstsrtserversink.c
@@ +325,3 @@
+    srt_setsockopt (priv->sock, 0, SRTO_PASSPHRASE,
+        base->passphrase, strlen (base->passphrase));
+    srt_setsockopt (priv->sock, 0, SRT_PBKEYLEN,

SRTO_

@@ +328,3 @@
+        &base->key_length, sizeof (int));
+
+    GST_WARNING ("passphrase ==> %s", base->passphrase);

GST_WARNING_OBJECT (sink, ...);

@@ +331,3 @@
+
+  } else {
+    GST_WARNING ("No passphrase");

same here

::: ext/srt/gstsrtserversrc.c
@@ +323,3 @@
+  if (base->passphrase != NULL && base->passphrase[0] != '\0') {
+    srt_setsockopt (priv->sock, 0, SRTO_PASSPHRASE,
+        base->passphrase, strlen (base->passphrase));

SRTO_
Comment 5 Justin Kim 2017-11-15 01:05:24 UTC
Created attachment 363646 [details] [review]
srt: add passphrase and keylength
Comment 6 Olivier Crête 2017-11-15 03:20:50 UTC
Review of attachment 363646 [details] [review]:

Looks good, lets merge this
Comment 7 Nicolas Dufresne (ndufresne) 2017-11-15 15:53:52 UTC
Attachment @363646 was pushed as ec32124