mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 15:36:17 +01:00
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.
This commit is contained in:
parent
4125415e7f
commit
0501bf26b9
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user