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 724393 - rtspconnection: allow specifying an anchor certificate database
rtspconnection: allow specifying an anchor certificate database
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal enhancement
: 1.3.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 724396
 
 
Reported: 2014-02-15 00:39 UTC by Aleix Conchillo Flaqué
Modified: 2014-02-20 19:07 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
tls certificate database support (10.65 KB, patch)
2014-02-15 00:50 UTC, Aleix Conchillo Flaqué
none Details | Review
tls certificate database support (10.67 KB, patch)
2014-02-15 00:59 UTC, Aleix Conchillo Flaqué
none Details | Review
tls certificate database support (10.67 KB, patch)
2014-02-15 01:03 UTC, Aleix Conchillo Flaqué
none Details | Review
tls certificate database support 2nd fixup (10.93 KB, patch)
2014-02-15 01:07 UTC, Aleix Conchillo Flaqué
needs-work Details | Review
tls certificate database support 3rd fixup (6.40 KB, patch)
2014-02-17 01:45 UTC, Aleix Conchillo Flaqué
none Details | Review
get rid of rtspconnectoin whitespaces (5.47 KB, patch)
2014-02-17 07:57 UTC, Aleix Conchillo Flaqué
none Details | Review
tls certificate database support 4th fixup (6.24 KB, patch)
2014-02-17 23:15 UTC, Aleix Conchillo Flaqué
none Details | Review
get rid of rtspconnection superfluous whitespaces (5.48 KB, patch)
2014-02-17 23:15 UTC, Aleix Conchillo Flaqué
committed Details | Review
tls certificate database support 5th fixup (6.25 KB, patch)
2014-02-17 23:17 UTC, Aleix Conchillo Flaqué
committed Details | Review
update windoes symbols file (1.05 KB, patch)
2014-02-20 00:13 UTC, Aleix Conchillo Flaqué
committed Details | Review

Description Aleix Conchillo Flaqué 2014-02-15 00:39:52 UTC
Right now, it's not possible for a client to validate a server certificate with a custom anchor certificate file. The server certificate is only verified agains the default certificate database.
Comment 1 Aleix Conchillo Flaqué 2014-02-15 00:50:50 UTC
Created attachment 269154 [details] [review]
tls certificate database support

This adds support for additional server certificate verification given a user certificate database file.
Comment 2 Aleix Conchillo Flaqué 2014-02-15 00:59:31 UTC
Created attachment 269155 [details] [review]
tls certificate database support

Forgot to show the error flags in latest patch.
Comment 3 Aleix Conchillo Flaqué 2014-02-15 01:03:19 UTC
Created attachment 269157 [details] [review]
tls certificate database support

Forgot to show the error flags in latest patch.
Comment 4 Aleix Conchillo Flaqué 2014-02-15 01:07:56 UTC
Created attachment 269158 [details] [review]
tls certificate database support 2nd fixup

Sorry, forgot to free tls_database_file and bugzilla is not helping.
Comment 5 Sebastian Dröge (slomo) 2014-02-16 09:01:19 UTC
Review of attachment 269158 [details] [review]:

Seems like a good idea, just some questions.

::: gst-libs/gst/rtsp/gstrtspconnection.c
@@ +230,3 @@
+
+    if (error)
+      goto verify_error;

Shouldn't this use the tls-validation-flags property here to ignore some errors but not others, like what happens in rtspsrc?

@@ +580,3 @@
+ * Sets the anchor certificate authorities database file. This
+ * certificate database will be used after a server certificate can't be
+ * verified with the default certificate database.

Does this require a single file with all certificates or can it also be a directory like /etc/ssl/certs ?

@@ +2251,3 @@
  *
  * Close and free @conn.
+ *

Please get rid of all these useless whitespace changes :)
Comment 6 Aleix Conchillo Flaqué 2014-02-17 01:39:39 UTC
(In reply to comment #5)
> Review of attachment 269158 [details] [review]:
> 
> Seems like a good idea, just some questions.
> 
> ::: gst-libs/gst/rtsp/gstrtspconnection.c
> @@ +230,3 @@
> +
> +    if (error)
> +      goto verify_error;
> 
> Shouldn't this use the tls-validation-flags property here to ignore some errors
> but not others, like what happens in rtspsrc?
> 

error is just a GError, but it's true that we should take into account the tls-validation-flags in here:

    accept = ((errors & rtspcon->tls_validation_flags) == 0);

i missed that, thanks!

> @@ +580,3 @@
> + * Sets the anchor certificate authorities database file. This
> + * certificate database will be used after a server certificate can't be
> + * verified with the default certificate database.
> 
> Does this require a single file with all certificates or can it also be a
> directory like /etc/ssl/certs ?
> 

Yes, it requires a single file with PEM encoded certificates.

https://developer.gnome.org/gio/2.32/GTlsFileDatabase.html#g-tls-file-database-new

Like the default database: /etc/ssl/certs/ca-certificates.crt

> @@ +2251,3 @@
>   *
>   * Close and free @conn.
> + *
> 
> Please get rid of all these useless whitespace changes :)

i have a deja vu here :-). we should get rid of those white spaces at some point.
Comment 7 Aleix Conchillo Flaqué 2014-02-17 01:45:04 UTC
Created attachment 269350 [details] [review]
tls certificate database support 3rd fixup

let's see now. added tls_validation_flags check and Since notes.
Comment 8 Sebastian Dröge (slomo) 2014-02-17 07:51:01 UTC
(In reply to comment #6)

> > Please get rid of all these useless whitespace changes :)
> 
> i have a deja vu here :-). we should get rid of those white spaces at some
> point.

Yes, please attach a second patch just doing that here :)
Comment 9 Aleix Conchillo Flaqué 2014-02-17 07:57:50 UTC
Created attachment 269358 [details] [review]
get rid of rtspconnectoin whitespaces

get rid of whitespaces.
Comment 10 Olivier Crête 2014-02-17 17:09:11 UTC
Any reason to use the filename instead of a GTlsDatabase object in the API ?
Comment 11 Aleix Conchillo Flaqué 2014-02-17 20:29:17 UTC
(In reply to comment #10)
> Any reason to use the filename instead of a GTlsDatabase object in the API ?

Not really. I didn't think about it. :-) Good point. And this gives more flexibility to rtspconnection.
Comment 12 Aleix Conchillo Flaqué 2014-02-17 23:15:14 UTC
Created attachment 269477 [details] [review]
tls certificate database support 4th fixup

It now uses a GTlsDatabase directly instead of a file name.
Comment 13 Aleix Conchillo Flaqué 2014-02-17 23:15:51 UTC
Created attachment 269478 [details] [review]
get rid of rtspconnection superfluous whitespaces
Comment 14 Aleix Conchillo Flaqué 2014-02-17 23:17:57 UTC
Created attachment 269479 [details] [review]
tls certificate database support 5th fixup

I hate typos.
Comment 15 Aleix Conchillo Flaqué 2014-02-19 18:43:21 UTC
This could be used as a worked around to bug 724708.
Comment 16 Sebastian Dröge (slomo) 2014-02-19 20:23:37 UTC
Comment on attachment 269478 [details] [review]
get rid of rtspconnection superfluous whitespaces

commit 9121b16aa097b0de12368da336085d1ebccd5b7d
Author: Aleix Conchillo Flaqué <aleix@oblong.com>
Date:   Sun Feb 16 23:55:17 2014 -0800

    rtspconnection: get rid of superfluous whitespaces
Comment 17 Sebastian Dröge (slomo) 2014-02-19 20:26:05 UTC
Review of attachment 269479 [details] [review]:

::: gst-libs/gst/rtsp/gstrtspconnection.c
@@ +223,3 @@
+
+    if (error)
+      goto verify_error;

Because of this you will never validate it against the validation_flags below.
Comment 18 Aleix Conchillo Flaqué 2014-02-19 20:34:49 UTC
(In reply to comment #17)
> Review of attachment 269479 [details] [review]:
> 
> ::: gst-libs/gst/rtsp/gstrtspconnection.c
> @@ +223,3 @@
> +
> +    if (error)
> +      goto verify_error;
> 
> Because of this you will never validate it against the validation_flags below.

But you don't get a GError "error" if it can't verify, you just get "errors". May be the variable names are confusing.

I've tried it an it works as expected.
Comment 19 Sebastian Dröge (slomo) 2014-02-19 20:49:01 UTC
Comment on attachment 269479 [details] [review]
tls certificate database support 5th fixup

Oops, yes I missed the 's' :) Sorry

commit 0a115bd31f77a6b4b38127937c562f4145f8ccfc
Author: Aleix Conchillo Flaqué <aleix@oblong.com>
Date:   Sun Feb 16 17:39:35 2014 -0800

    rtspconnection: allow specifying a certificate database
    
    Two new functions have been added,
    gst_rtsp_connection_set_tls_database() and
    gst_rtsp_connection_get_tls_database(). The certificate database will be
    used when a certificate can't be verified with the default database.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=724393
Comment 20 Aleix Conchillo Flaqué 2014-02-20 00:13:40 UTC
Created attachment 269740 [details] [review]
update windoes symbols file

It seems we also need this to make "make dist" happy.