[telepathy-glib-0.20] telepathy-glib: tls-certificate: invalidate the proxy if CertificateChainData is missing

Simon McVittie smcv at kemper.freedesktop.org
Mon Jun 10 07:28:32 PDT 2013


Module: telepathy-glib
Branch: telepathy-glib-0.20
Commit: 02b70ab2cffc399846fba5f94aff937963d170a4
URL:    http://cgit.freedesktop.org/telepathy/telepathy-glib/commit/?id=02b70ab2cffc399846fba5f94aff937963d170a4

Author: Guillaume Desmottes <guillaume.desmottes at collabora.co.uk>
Date:   Tue Mar 12 11:11:02 2013 +0100

tls-certificate: invalidate the proxy if CertificateChainData is missing

We shouldn't assert if the CM is broken.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61616
Reviewed-by: Simon McVittie <simon.mcvittie at collabora.co.uk>

---

 telepathy-glib/tls-certificate.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/telepathy-glib/tls-certificate.c b/telepathy-glib/tls-certificate.c
index 2a2de5b..0f465d2 100644
--- a/telepathy-glib/tls-certificate.c
+++ b/telepathy-glib/tls-certificate.c
@@ -250,7 +250,18 @@ tls_certificate_got_all_cb (TpProxy *proxy,
 
   cert_data = tp_asv_get_boxed (properties, "CertificateChainData",
       TP_ARRAY_TYPE_UCHAR_ARRAY_LIST);
-  g_assert (cert_data != NULL);
+
+  if (cert_data == NULL)
+    {
+      GError e = { TP_DBUS_ERRORS, TP_DBUS_ERROR_INCONSISTENT,
+          "Missing CertificateChainData property" };
+
+      DEBUG ("Missing CertificateChainData property on %s",
+          tp_proxy_get_object_path (self));
+
+      tp_proxy_invalidate (proxy, &e);
+      return;
+    }
 
   self->priv->cert_data = g_ptr_array_new_with_free_func (
       (GDestroyNotify) g_bytes_unref);



More information about the telepathy-commits mailing list