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 774416 - RTSP digest Authentification for gst-rtsp-server
RTSP digest Authentification for gst-rtsp-server
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-rtsp-server
1.10.0
Other All
: Normal enhancement
: 1.11.1
Assigned To: Sebastian Dröge (slomo)
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-11-14 15:54 UTC by Mikhaylo
Modified: 2016-11-21 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
rtsp-auth: Add support for Digest authentication (24.48 KB, patch)
2016-11-16 06:42 UTC, Sebastian Dröge (slomo)
none Details | Review
rtsp: Add gst_rtsp_generate_digest_auth_response() to calculate digest auth response (9.67 KB, patch)
2016-11-18 11:24 UTC, Sebastian Dröge (slomo)
committed Details | Review
rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials (16.09 KB, patch)
2016-11-18 15:01 UTC, Sebastian Dröge (slomo)
none Details | Review
rtspsrc: Move to new helper function to parse authentication responses (6.35 KB, patch)
2016-11-18 15:01 UTC, Sebastian Dröge (slomo)
none Details | Review
rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials (19.13 KB, patch)
2016-11-18 15:47 UTC, Sebastian Dröge (slomo)
committed Details | Review
rtspsrc: Move to new helper function to parse authentication responses (6.33 KB, patch)
2016-11-18 15:47 UTC, Sebastian Dröge (slomo)
committed Details | Review
rtsp-auth: Add support for Digest authentication (22.04 KB, patch)
2016-11-18 15:47 UTC, Sebastian Dröge (slomo)
none Details | Review
rtspclientsink: Move to new helper function to parse authentication responses (6.52 KB, patch)
2016-11-18 15:48 UTC, Sebastian Dröge (slomo)
none Details | Review
rtsp-auth: Add support for Digest authentication (22.94 KB, patch)
2016-11-19 09:59 UTC, Sebastian Dröge (slomo)
committed Details | Review
rtspclientsink: Move to new helper function to parse authentication responses (6.52 KB, patch)
2016-11-19 09:59 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Mikhaylo 2016-11-14 15:54:04 UTC
Need a way to use digest Auth for RTSP server

Now only basic Auth is supported:

gst_rtsp_auth_make_basic
gst_rtsp_auth_add_basic

Need similar methods for RTSP digest Authentification
Comment 1 Sebastian Dröge (slomo) 2016-11-16 06:42:39 UTC
Created attachment 339993 [details] [review]
rtsp-auth: Add support for Digest authentication
Comment 2 Sebastian Dröge (slomo) 2016-11-16 11:38:16 UTC
Review of attachment 339993 [details] [review]:

::: gst/rtsp-server/rtsp-auth.c
@@ +792,3 @@
+
+  GST_DEBUG_OBJECT (auth, "check Digest auth");
+

The code to parse the Digest auth header, and to check if the response is the correct one (i.e. to generate the response), is copied from the RTSP RECORD sink and/or RTSP connection.

Should probably be exposed as API in libgstrtsp instead before this here is merged.
Comment 3 Sebastian Dröge (slomo) 2016-11-17 16:39:08 UTC
Review of attachment 339993 [details] [review]:

::: gst/rtsp-server/rtsp-auth.c
@@ +730,3 @@
+auth_digest_compute_response (const gchar * method,
+    const gchar * uri, const gchar * hex_a1, const gchar * nonce,
+    gchar response[33])

I would add a gst_rtsp_generate_digest_auth_response(algorithm (=="md5", method, real, username, password, uri, nonce)

@@ +837,3 @@
+      response = g_strdup (value);
+    else if (!uri && strcmp (item, "uri") == 0 && value)
+      uri = g_strdup (value);

And for this a gst_rtsp_message_parse_authorization(request, &method, &tokens)

Where tokens is a struct {char *key; char *value} (do we have something reusable for that?)
Comment 4 Sebastian Dröge (slomo) 2016-11-18 11:24:58 UTC
Created attachment 340230 [details] [review]
rtsp: Add gst_rtsp_generate_digest_auth_response() to calculate digest auth response
Comment 5 Sebastian Dröge (slomo) 2016-11-18 15:01:31 UTC
Created attachment 340237 [details] [review]
rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials
Comment 6 Sebastian Dröge (slomo) 2016-11-18 15:01:44 UTC
Created attachment 340238 [details] [review]
rtspsrc: Move to new helper function to parse authentication responses
Comment 7 Sebastian Dröge (slomo) 2016-11-18 15:47:33 UTC
Created attachment 340250 [details] [review]
rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials
Comment 8 Sebastian Dröge (slomo) 2016-11-18 15:47:43 UTC
Created attachment 340251 [details] [review]
rtspsrc: Move to new helper function to parse authentication responses
Comment 9 Sebastian Dröge (slomo) 2016-11-18 15:47:55 UTC
Created attachment 340252 [details] [review]
rtsp-auth: Add support for Digest authentication
Comment 10 Sebastian Dröge (slomo) 2016-11-18 15:48:01 UTC
Created attachment 340253 [details] [review]
rtspclientsink: Move to new helper function to parse authentication responses
Comment 11 Sebastian Dröge (slomo) 2016-11-19 09:59:49 UTC
Created attachment 340293 [details] [review]
rtsp-auth: Add support for Digest authentication
Comment 12 Sebastian Dröge (slomo) 2016-11-19 09:59:55 UTC
Created attachment 340294 [details] [review]
rtspclientsink: Move to new helper function to parse authentication responses
Comment 13 Sebastian Dröge (slomo) 2016-11-21 07:39:33 UTC
Attachment 340230 [details] pushed as 828c860 - rtsp: Add gst_rtsp_generate_digest_auth_response() to calculate digest auth response
Attachment 340250 [details] pushed as 90b24d3 - rtsp: Add gst_rtsp_message_parse_auth_credentials() to parse authentication credentials
Comment 14 Sebastian Dröge (slomo) 2016-11-21 07:40:21 UTC
Comment on attachment 340251 [details] [review]
rtspsrc: Move to new helper function to parse authentication responses

Attachment 340251 [details] pushed as 058ab0d - rtspsrc: Move to new helper function to parse authentication responses
Comment 15 Sebastian Dröge (slomo) 2016-11-21 07:40:45 UTC
Attachment 340293 [details] pushed as 927a44c - rtsp-auth: Add support for Digest authentication
Attachment 340294 [details] pushed as 6622b5b - rtspclientsink: Move to new helper function to parse authentication responses