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 711231 - rtspconnection: allow setting tls certificate validation flags
rtspconnection: allow setting tls certificate validation flags
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.2.0
Other Linux
: Normal enhancement
: 1.2.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 711230
 
 
Reported: 2013-10-31 21:10 UTC by Aleix Conchillo Flaqué
Modified: 2013-11-01 15:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
new function gst_rtsp_connection_set_tls_validation_flags (7.22 KB, patch)
2013-10-31 21:13 UTC, Aleix Conchillo Flaqué
needs-work Details | Review
tls validation flags setter/getter (3.04 KB, patch)
2013-11-01 14:28 UTC, Aleix Conchillo Flaqué
needs-work Details | Review
tls validation flags setter/getter for 1.2.1 (3.01 KB, patch)
2013-11-01 15:37 UTC, Aleix Conchillo Flaqué
committed Details | Review

Description Aleix Conchillo Flaqué 2013-10-31 21:10:42 UTC
Because of bug 711230, we need a way to set the TLS certificate validatoin flags to be used in a TLS connection.
Comment 1 Aleix Conchillo Flaqué 2013-10-31 21:13:59 UTC
Created attachment 258692 [details] [review]
new function gst_rtsp_connection_set_tls_validation_flags
Comment 2 Sebastian Dröge (slomo) 2013-11-01 13:51:53 UTC
Review of attachment 258692 [details] [review]:

Please get rid of all the unrelated whitespace changes

::: gst-libs/gst/rtsp/gstrtspconnection.c
@@ +448,3 @@
 
+/**
+ * gst_rtsp_connection_set_tls_validation_flags:

Maybe also a getter function for them?

@@ +458,3 @@
+ * @conn is NULL or is not a TLS connection.
+ *
+ * Since: 1.2.1

Will be Since: 1.4.0 probably
Comment 3 Aleix Conchillo Flaqué 2013-11-01 14:28:44 UTC
Created attachment 258737 [details] [review]
tls validation flags setter/getter

Let's see now. I've updated to 1.4.0 but it would be nice for 1.2, but it's an API addition...
Comment 4 Sebastian Dröge (slomo) 2013-11-01 14:49:35 UTC
Review of attachment 258737 [details] [review]:

::: gst-libs/gst/rtsp/gstrtspconnection.c
@@ +482,3 @@
+ * when a TLS connection is established.
+ *
+ * Returns: the validationg flags. If @conn is NULL 0 is returned.

As you've used g_return_val_if_fail(), conn==NULL is considered a programming error and should not be mentioned at all in the docs. Same above

@@ +491,3 @@
+  g_return_val_if_fail (conn != NULL, 0);
+
+  return g_socket_client_get_tls_validation_flags (conn->client);

What is this doing if this is not a TLS connection?
Comment 5 Sebastian Dröge (slomo) 2013-11-01 14:55:39 UTC
Also make it "Since: 1.2.1" please :)
Comment 6 Aleix Conchillo Flaqué 2013-11-01 15:35:28 UTC
(In reply to comment #4)
> Review of attachment 258737 [details] [review]:
> 
> 
> As you've used g_return_val_if_fail(), conn==NULL is considered a programming
> error and should not be mentioned at all in the docs. Same above
> 

OK, didn't notice that convention. Thanks!

> @@ +491,3 @@
> +  g_return_val_if_fail (conn != NULL, 0);
> +
> +  return g_socket_client_get_tls_validation_flags (conn->client);
> 
> What is this doing if this is not a TLS connection?

It just returns the flags that you have set. It doesn't make any check whether the connection is TLS or not. I guess because you can set it later, that is you can set and get the flags and later make the client socket TLS.
Comment 7 Aleix Conchillo Flaqué 2013-11-01 15:37:16 UTC
Created attachment 258743 [details] [review]
tls validation flags setter/getter for 1.2.1
Comment 8 Sebastian Dröge (slomo) 2013-11-01 15:45:01 UTC
commit 53c7ad0c8723e2bb95aafef6f92ec59de0203d7f
Author: Aleix Conchillo Flaque <aleix@oblong.com>
Date:   Fri Nov 1 07:25:01 2013 -0700

    rtspconnection: allow setting tls certificate validation
    
    Added new functions gst_rtsp_connection_set_tls_validation_flags() to
    allow setting the TLS certificate validation flags when establishing a
    TLS connection.
    A getter is also available, gst_rtsp_connection_get_tls_validation_flags().
    
    https://bugzilla.gnome.org/show_bug.cgi?id=711231