Ejemplo n.º 1
0
static void
g_tls_interaction_finalize (GObject *object)
{
  GTlsInteraction *interaction = G_TLS_INTERACTION (object);

  g_main_context_unref (interaction->priv->context);

  G_OBJECT_CLASS (g_tls_interaction_parent_class)->finalize (object);
}
Ejemplo n.º 2
0
GTlsInteraction *
mock_interaction_new (const gchar *password)
{
	MockInteraction *result;

	result = g_object_new (MOCK_TYPE_INTERACTION, NULL);
	result->password = g_strdup (password);

	return G_TLS_INTERACTION (result);
}
Ejemplo n.º 3
0
GTlsInteraction *
mock_interaction_new_static_certificate (GTlsCertificate *cert)
{
  MockInteraction *self;

  self = g_object_new (MOCK_TYPE_INTERACTION, NULL);

  self->static_certificate = cert ? g_object_ref (cert) : NULL;
  return G_TLS_INTERACTION (self);
}
Ejemplo n.º 4
0
GTlsInteraction *
mock_interaction_new_static_password (const gchar *password)
{
  MockInteraction *self;

  self = g_object_new (MOCK_TYPE_INTERACTION, NULL);

  self->static_password = g_strdup (password);
  return G_TLS_INTERACTION (self);
}
Ejemplo n.º 5
0
GTlsInteraction *
mock_interaction_new_static_error (GQuark domain,
                                   gint code,
                                   const gchar *message)
{
  MockInteraction *self;

  self = g_object_new (MOCK_TYPE_INTERACTION, NULL);

  self->static_error = g_error_new (domain, code, "%s", message);
  return G_TLS_INTERACTION (self);
}
Ejemplo n.º 6
0
static void
ask_password_with_getpass (GTask        *task,
                           gpointer      object,
                           gpointer      task_data,
                           GCancellable *cancellable)
{
  GTlsPassword *password = task_data;
  GError *error = NULL;

  g_tls_console_interaction_ask_password (G_TLS_INTERACTION (object), password,
                                          cancellable, &error);
  if (error != NULL)
    g_task_return_error (task, error);
  else
    g_task_return_int (task, G_TLS_INTERACTION_HANDLED);
}