]> git.0d.be Git - empathy.git/commitdiff
libempathy: Use new gcr functions properly and fix build.
authorStef Walter <stefw@collabora.co.uk>
Mon, 6 Dec 2010 22:47:13 +0000 (22:47 +0000)
committerStef Walter <stefw@collabora.co.uk>
Fri, 24 Dec 2010 13:40:02 +0000 (07:40 -0600)
libgcr now uses single header include model.

libempathy/empathy-tls-verifier.c

index 7bf8daeb88e484c5d9e3553e630b6ebde2134e49..a0feb77e8e838defc4855a4660d60292599d3d0f 100644 (file)
@@ -28,8 +28,7 @@
 
 #include "empathy-tls-verifier.h"
 
-#include <gcr/gcr-simple-certificate.h>
-#include <gcr/gcr-trust.h>
+#include <gcr/gcr.h>
 
 #define DEBUG_FLAG EMPATHY_DEBUG_TLS
 #include "empathy-debug.h"
@@ -185,6 +184,7 @@ build_certificate_chain_for_gnutls (EmpathyTLSVerifier *self,
   GPtrArray *chain;
   gnutls_x509_crt_t *result;
   GArray *cert_data;
+  GError *error = NULL;
   GcrCertificate *cert;
   GcrCertificate *anchor;
   guint idx;
@@ -234,9 +234,17 @@ build_certificate_chain_for_gnutls (EmpathyTLSVerifier *self,
       if (gcr_certificate_is_issuer (cert, cert))
         break;
 
-      cert = gcr_pkcs11_certificate_lookup_for_issuer (cert);
+      cert = gcr_pkcs11_certificate_lookup_issuer (cert, NULL, &error);
       if (cert == NULL)
-        break;
+        {
+          if (error != NULL)
+            {
+              DEBUG ("Lookup of certificate in PKCS#11 store failed: %s",
+                      error->message);
+              g_clear_error (&error);
+            }
+          break;
+        }
 
       /* Add this to the chain */
       g_ptr_array_add (chain, cert);