summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Winship <danw@gnome.org>2014-10-15 17:49:09 -0400
committerDan Winship <danw@gnome.org>2014-10-25 08:52:54 -0400
commit0501bf26b924cdaccf9c1c38522f267b7a520ef4 (patch)
tree8cf8c175ce44a000371530487406ee29441377e3
parent4125415e7f4d1213fc7122beac0d91af08e37b28 (diff)
downloadglib-0501bf26b924cdaccf9c1c38522f267b7a520ef4.tar.gz
gio/tests/tls-certificates: fix
da053e34 broke the tls-certificates test by requiring the backend to implement g_tls_certificate_verify() (which the test TLS backend didn't). Add a trivial implementation to make the test pass again; we'll need something more complicated when we add tests that are supposed to get errors.
-rw-r--r--gio/tests/gtesttlsbackend.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/gio/tests/gtesttlsbackend.c b/gio/tests/gtesttlsbackend.c
index d08e2aa9e..d5417fd81 100644
--- a/gio/tests/gtesttlsbackend.c
+++ b/gio/tests/gtesttlsbackend.c
@@ -92,6 +92,15 @@ G_DEFINE_TYPE_WITH_CODE (GTestTlsCertificate, g_test_tls_certificate, G_TYPE_TLS
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE,
g_test_tls_certificate_initable_iface_init);)
+static GTlsCertificateFlags
+g_test_tls_certificate_verify (GTlsCertificate *cert,
+ GSocketConnectable *identity,
+ GTlsCertificate *trusted_ca)
+{
+ /* For now, all of the tests expect the certificate to verify */
+ return 0;
+}
+
static void
g_test_tls_certificate_get_property (GObject *object,
guint prop_id,
@@ -151,14 +160,17 @@ g_test_tls_certificate_finalize (GObject *object)
}
static void
-g_test_tls_certificate_class_init (GTestTlsCertificateClass *certificate_class)
+g_test_tls_certificate_class_init (GTestTlsCertificateClass *test_class)
{
- GObjectClass *gobject_class = G_OBJECT_CLASS (certificate_class);
+ GObjectClass *gobject_class = G_OBJECT_CLASS (test_class);
+ GTlsCertificateClass *certificate_class = G_TLS_CERTIFICATE_CLASS (test_class);
gobject_class->get_property = g_test_tls_certificate_get_property;
gobject_class->set_property = g_test_tls_certificate_set_property;
gobject_class->finalize = g_test_tls_certificate_finalize;
+ certificate_class->verify = g_test_tls_certificate_verify;
+
g_object_class_override_property (gobject_class, PROP_CERT_CERTIFICATE, "certificate");
g_object_class_override_property (gobject_class, PROP_CERT_CERTIFICATE_PEM, "certificate-pem");
g_object_class_override_property (gobject_class, PROP_CERT_PRIVATE_KEY, "private-key");