| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | /* GIO - GLib Input, Output and Streaming Library
 | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Copyright © 2010 Red Hat, Inc | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  |  * Copyright © 2015 Collabora, Ltd. | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2022-05-18 09:12:45 +01:00
										 |  |  |  |  * SPDX-License-Identifier: LGPL-2.1-or-later | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  |  * modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  |  * License as published by the Free Software Foundation; either | 
					
						
							| 
									
										
										
										
											2017-05-27 18:21:30 +02:00
										 |  |  |  |  * version 2.1 of the License, or (at your option) any later version. | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  |  * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  |  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  |  * Lesser General Public License for more details. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * You should have received a copy of the GNU Lesser General | 
					
						
							| 
									
										
										
										
											2014-01-23 12:58:29 +01:00
										 |  |  |  |  * Public License along with this library; if not, see <http://www.gnu.org/licenses/>.
 | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | #include "config.h"
 | 
					
						
							|  |  |  |  | #include "glib.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | #include "gtlsbackend.h"
 | 
					
						
							| 
									
										
										
										
											2018-08-16 23:25:29 +10:00
										 |  |  |  | #include "gtlsdatabase.h"
 | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | #include "gdummytlsbackend.h"
 | 
					
						
							|  |  |  |  | #include "gioenumtypes.h"
 | 
					
						
							|  |  |  |  | #include "giomodule-priv.h"
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * GTlsBackend: | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  |  * TLS (Transport Layer Security, aka SSL) and DTLS backend. This is an | 
					
						
							| 
									
										
										
										
											2012-04-03 13:20:01 +02:00
										 |  |  |  |  * internal type used to coordinate the different classes implemented | 
					
						
							|  |  |  |  |  * by a TLS backend. | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-17 11:54:02 +01:00
										 |  |  |  | G_DEFINE_INTERFACE (GTlsBackend, g_tls_backend, G_TYPE_OBJECT) | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-16 23:25:29 +10:00
										 |  |  |  | static GTlsDatabase *default_database; | 
					
						
							|  |  |  |  | G_LOCK_DEFINE_STATIC (default_database_lock); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | static void | 
					
						
							|  |  |  |  | g_tls_backend_default_init (GTlsBackendInterface *iface) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-01-23 16:07:51 +00:00
										 |  |  |  | static GTlsBackend *tls_backend_default_singleton = NULL;  /* (owned) (atomic) */ | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_default: | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the default #GTlsBackend for the system. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2020-11-13 17:19:42 +02:00
										 |  |  |  |  * Returns: (not nullable) (transfer none): a #GTlsBackend, which will be a | 
					
						
							|  |  |  |  |  *     dummy object if no TLS backend is available | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GTlsBackend * | 
					
						
							|  |  |  |  | g_tls_backend_get_default (void) | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2023-09-11 23:59:52 -07:00
										 |  |  |  |   if (g_once_init_enter_pointer (&tls_backend_default_singleton)) | 
					
						
							| 
									
										
										
										
											2019-01-23 16:07:51 +00:00
										 |  |  |  |     { | 
					
						
							|  |  |  |  |       GTlsBackend *singleton; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |       singleton = _g_io_module_get_default (G_TLS_BACKEND_EXTENSION_POINT_NAME, | 
					
						
							|  |  |  |  |                                             "GIO_USE_TLS", | 
					
						
							|  |  |  |  |                                             NULL); | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-09-11 23:59:52 -07:00
										 |  |  |  |       g_once_init_leave_pointer (&tls_backend_default_singleton, singleton); | 
					
						
							| 
									
										
										
										
											2019-01-23 16:07:51 +00:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return tls_backend_default_singleton; | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_supports_tls: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Checks if TLS is supported; if this returns %FALSE for the default | 
					
						
							|  |  |  |  |  * #GTlsBackend, it means no "real" TLS backend is available. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: whether or not TLS is supported | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | gboolean | 
					
						
							|  |  |  |  | g_tls_backend_supports_tls (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   if (G_TLS_BACKEND_GET_INTERFACE (backend)->supports_tls) | 
					
						
							|  |  |  |  |     return G_TLS_BACKEND_GET_INTERFACE (backend)->supports_tls (backend); | 
					
						
							|  |  |  |  |   else if (G_IS_DUMMY_TLS_BACKEND (backend)) | 
					
						
							|  |  |  |  |     return FALSE; | 
					
						
							|  |  |  |  |   else | 
					
						
							|  |  |  |  |     return TRUE; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_supports_dtls: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Checks if DTLS is supported. DTLS support may not be available even if TLS | 
					
						
							|  |  |  |  |  * support is available, and vice-versa. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Returns: whether DTLS is supported | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.48 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | gboolean | 
					
						
							|  |  |  |  | g_tls_backend_supports_dtls (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   if (G_TLS_BACKEND_GET_INTERFACE (backend)->supports_dtls) | 
					
						
							|  |  |  |  |     return G_TLS_BACKEND_GET_INTERFACE (backend)->supports_dtls (backend); | 
					
						
							| 
									
										
										
										
											2017-09-11 09:59:50 +01:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |   return FALSE; | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_default_database: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the default #GTlsDatabase used to verify TLS connections. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: (transfer full): the default database, which should be | 
					
						
							| 
									
										
										
										
											2011-08-11 11:36:22 +02:00
										 |  |  |  |  *               unreffed when done. | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.30 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GTlsDatabase * | 
					
						
							|  |  |  |  | g_tls_backend_get_default_database (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2018-08-16 23:25:29 +10:00
										 |  |  |  |   GTlsDatabase *db; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  |   g_return_val_if_fail (G_IS_TLS_BACKEND (backend), NULL); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   /* This method was added later, so accept the (remote) possibility it can be NULL */ | 
					
						
							|  |  |  |  |   if (!G_TLS_BACKEND_GET_INTERFACE (backend)->get_default_database) | 
					
						
							|  |  |  |  |     return NULL; | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-16 23:25:29 +10:00
										 |  |  |  |   G_LOCK (default_database_lock); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   if (!default_database) | 
					
						
							|  |  |  |  |     default_database = G_TLS_BACKEND_GET_INTERFACE (backend)->get_default_database (backend); | 
					
						
							|  |  |  |  |   db = default_database ? g_object_ref (default_database) : NULL; | 
					
						
							|  |  |  |  |   G_UNLOCK (default_database_lock); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return db; | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_set_default_database: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * @database: (nullable): the #GTlsDatabase | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Set the default #GTlsDatabase used to verify TLS connections | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Any subsequent call to g_tls_backend_get_default_database() will return | 
					
						
							|  |  |  |  |  * the database set in this call.  Existing databases and connections are not | 
					
						
							|  |  |  |  |  * modified. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Setting a %NULL default database will reset to using the system default | 
					
						
							|  |  |  |  |  * database as if g_tls_backend_set_default_database() had never been called. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.60 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | void | 
					
						
							|  |  |  |  | g_tls_backend_set_default_database (GTlsBackend  *backend, | 
					
						
							|  |  |  |  |                                     GTlsDatabase *database) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   g_return_if_fail (G_IS_TLS_BACKEND (backend)); | 
					
						
							|  |  |  |  |   g_return_if_fail (database == NULL || G_IS_TLS_DATABASE (database)); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   G_LOCK (default_database_lock); | 
					
						
							|  |  |  |  |   g_set_object (&default_database, database); | 
					
						
							|  |  |  |  |   G_UNLOCK (default_database_lock); | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_certificate_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the #GType of @backend's #GTlsCertificate implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: the #GType of @backend's #GTlsCertificate | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  *   implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_certificate_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   return G_TLS_BACKEND_GET_INTERFACE (backend)->get_certificate_type (); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_client_connection_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the #GType of @backend's #GTlsClientConnection implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: the #GType of @backend's #GTlsClientConnection | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  *   implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_client_connection_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   return G_TLS_BACKEND_GET_INTERFACE (backend)->get_client_connection_type (); | 
					
						
							|  |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_server_connection_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the #GType of @backend's #GTlsServerConnection implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: the #GType of @backend's #GTlsServerConnection | 
					
						
							| 
									
										
										
										
											2009-12-21 20:50:32 +01:00
										 |  |  |  |  *   implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.28 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_server_connection_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   return G_TLS_BACKEND_GET_INTERFACE (backend)->get_server_connection_type (); | 
					
						
							|  |  |  |  | } | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_dtls_client_connection_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the #GType of @backend’s #GDtlsClientConnection implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Returns: the #GType of @backend’s #GDtlsClientConnection | 
					
						
							| 
									
										
										
										
											2017-09-11 09:57:30 +01:00
										 |  |  |  |  *   implementation, or %G_TYPE_INVALID if this backend doesn’t support DTLS. | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.48 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_dtls_client_connection_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-09-11 09:57:30 +01:00
										 |  |  |  |   GTlsBackendInterface *iface; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   g_return_val_if_fail (G_IS_TLS_BACKEND (backend), G_TYPE_INVALID); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   iface = G_TLS_BACKEND_GET_INTERFACE (backend); | 
					
						
							|  |  |  |  |   if (iface->get_dtls_client_connection_type == NULL) | 
					
						
							|  |  |  |  |     return G_TYPE_INVALID; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return iface->get_dtls_client_connection_type (); | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_dtls_server_connection_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Gets the #GType of @backend’s #GDtlsServerConnection implementation. | 
					
						
							|  |  |  |  |  * | 
					
						
							|  |  |  |  |  * Returns: the #GType of @backend’s #GDtlsServerConnection | 
					
						
							| 
									
										
										
										
											2017-09-11 09:57:30 +01:00
										 |  |  |  |  *   implementation, or %G_TYPE_INVALID if this backend doesn’t support DTLS. | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.48 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_dtls_server_connection_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							| 
									
										
										
										
											2017-09-11 09:57:30 +01:00
										 |  |  |  |   GTlsBackendInterface *iface; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   g_return_val_if_fail (G_IS_TLS_BACKEND (backend), G_TYPE_INVALID); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   iface = G_TLS_BACKEND_GET_INTERFACE (backend); | 
					
						
							|  |  |  |  |   if (iface->get_dtls_server_connection_type == NULL) | 
					
						
							|  |  |  |  |     return G_TYPE_INVALID; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return iface->get_dtls_server_connection_type (); | 
					
						
							| 
									
										
										
										
											2015-06-25 12:58:14 +01:00
										 |  |  |  | } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  | /**
 | 
					
						
							|  |  |  |  |  * g_tls_backend_get_file_database_type: | 
					
						
							|  |  |  |  |  * @backend: the #GTlsBackend | 
					
						
							|  |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2012-02-19 15:41:12 +00:00
										 |  |  |  |  * Gets the #GType of @backend's #GTlsFileDatabase implementation. | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  |  * | 
					
						
							| 
									
										
										
										
											2014-02-19 19:35:23 -05:00
										 |  |  |  |  * Returns: the #GType of backend's #GTlsFileDatabase implementation. | 
					
						
							| 
									
										
										
										
											2011-08-04 08:54:55 +02:00
										 |  |  |  |  * | 
					
						
							|  |  |  |  |  * Since: 2.30 | 
					
						
							|  |  |  |  |  */ | 
					
						
							|  |  |  |  | GType | 
					
						
							|  |  |  |  | g_tls_backend_get_file_database_type (GTlsBackend *backend) | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |   g_return_val_if_fail (G_IS_TLS_BACKEND (backend), 0); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   /* This method was added later, so accept the (remote) possibility it can be NULL */ | 
					
						
							|  |  |  |  |   if (!G_TLS_BACKEND_GET_INTERFACE (backend)->get_file_database_type) | 
					
						
							|  |  |  |  |     return 0; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |   return G_TLS_BACKEND_GET_INTERFACE (backend)->get_file_database_type (); | 
					
						
							|  |  |  |  | } |