[gnome-keyring/dbus-api] [dbus] Rename secrets service to secret service.
- From: Stefan Walter <stefw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-keyring/dbus-api] [dbus] Rename secrets service to secret service.
- Date: Thu, 12 Nov 2009 01:25:02 +0000 (UTC)
commit 89db8a5da5ed24a94b7fa0e6bbba4727874bf9b0
Author: Stef Walter <stef memberwebs com>
Date: Wed Nov 11 01:15:30 2009 +0000
[dbus] Rename secrets service to secret service.
This was discussed on authentication mailing list. Also
cleans up some whitespace damage necessary to commit.
daemon/dbus/Makefile.am | 12 +-
daemon/dbus/gkd-dbus-secrets.c | 14 +-
...{gkd-secrets-objects.c => gkd-secret-objects.c} | 190 ++++++++--------
...{gkd-secrets-objects.h => gkd-secret-objects.h} | 42 ++--
.../{gkd-secrets-prompt.c => gkd-secret-prompt.c} | 146 ++++++------
daemon/dbus/gkd-secret-prompt.h | 70 ++++++
...{gkd-secrets-service.c => gkd-secret-service.c} | 240 ++++++++++----------
daemon/dbus/gkd-secret-service.h | 76 ++++++
...{gkd-secrets-session.c => gkd-secret-session.c} | 98 ++++----
daemon/dbus/gkd-secret-session.h | 53 +++++
daemon/dbus/gkd-secret-types.h | 54 +++++
.../{gkd-secrets-unlock.c => gkd-secret-unlock.c} | 84 ++++----
daemon/dbus/gkd-secret-unlock.h | 57 +++++
daemon/dbus/gkd-secrets-prompt.h | 70 ------
daemon/dbus/gkd-secrets-service.h | 76 ------
daemon/dbus/gkd-secrets-session.h | 53 -----
daemon/dbus/gkd-secrets-types.h | 54 -----
daemon/dbus/gkd-secrets-unlock.h | 57 -----
18 files changed, 723 insertions(+), 723 deletions(-)
---
diff --git a/daemon/dbus/Makefile.am b/daemon/dbus/Makefile.am
index 818ad16..5aa9758 100644
--- a/daemon/dbus/Makefile.am
+++ b/daemon/dbus/Makefile.am
@@ -18,12 +18,12 @@ libgkr_dbus_la_SOURCES = \
gkd-dbus-service.c \
gkd-dbus-session.c \
gkd-dbus-util.c gkd-dbus-util.h \
- gkd-secrets-objects.c gkd-secrets-objects.h \
- gkd-secrets-prompt.c gkd-secrets-prompt.h \
- gkd-secrets-service.c gkd-secrets-service.h \
- gkd-secrets-session.c gkd-secrets-session.h \
- gkd-secrets-types.h \
- gkd-secrets-unlock.c gkd-secrets-unlock.h
+ gkd-secret-objects.c gkd-secret-objects.h \
+ gkd-secret-prompt.c gkd-secret-prompt.h \
+ gkd-secret-service.c gkd-secret-service.h \
+ gkd-secret-session.c gkd-secret-session.h \
+ gkd-secret-types.h \
+ gkd-secret-unlock.c gkd-secret-unlock.h
libgkr_dbus_la_LIBADD = \
$(GLIB_LIBS) \
diff --git a/daemon/dbus/gkd-dbus-secrets.c b/daemon/dbus/gkd-dbus-secrets.c
index 4cf0836..e049d2a 100644
--- a/daemon/dbus/gkd-dbus-secrets.c
+++ b/daemon/dbus/gkd-dbus-secrets.c
@@ -1,5 +1,5 @@
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
-/* gkd-dbus-secrets.c - dbus secrets service
+/* gkd-dbus-secrets.c - dbus secret service
Copyright (C) 2009, Stefan Walter
@@ -24,13 +24,13 @@
#include "config.h"
#include "gkd-dbus-private.h"
-#include "gkd-secrets-service.h"
+#include "gkd-secret-service.h"
#include "daemon/pkcs11/gkr-pkcs11-daemon.h"
#include "gp11/gp11.h"
-static GkdSecretsService *secrets_service = NULL;
+static GkdSecretService *secrets_service = NULL;
static GP11Slot*
calculate_secrets_slot (void)
@@ -74,10 +74,10 @@ gkd_dbus_secrets_init (DBusConnection *conn)
g_return_if_fail (slot);
/* Try and grab our name */
- result = dbus_bus_request_name (conn, SECRETS_SERVICE, 0, &error);
+ result = dbus_bus_request_name (conn, SECRET_SERVICE, 0, &error);
if (dbus_error_is_set (&error)) {
g_message ("couldn't request name '%s' on session bus: %s",
- SECRETS_SERVICE, error.message);
+ SECRET_SERVICE, error.message);
dbus_error_free (&error);
} else {
@@ -95,7 +95,7 @@ gkd_dbus_secrets_init (DBusConnection *conn)
/* Another daemon is running */
case DBUS_REQUEST_NAME_REPLY_IN_QUEUE:
case DBUS_REQUEST_NAME_REPLY_EXISTS:
- g_message ("another secrets service is running");
+ g_message ("another secret service is running");
break;
default:
@@ -105,7 +105,7 @@ gkd_dbus_secrets_init (DBusConnection *conn)
}
g_return_if_fail (!secrets_service);
- secrets_service = g_object_new (GKD_SECRETS_TYPE_SERVICE,
+ secrets_service = g_object_new (GKD_SECRET_TYPE_SERVICE,
"connection", conn, "pkcs11-slot", slot, NULL);
g_object_unref (slot);
diff --git a/daemon/dbus/gkd-secrets-objects.c b/daemon/dbus/gkd-secret-objects.c
similarity index 87%
rename from daemon/dbus/gkd-secrets-objects.c
rename to daemon/dbus/gkd-secret-objects.c
index a3d8881..af61e46 100644
--- a/daemon/dbus/gkd-secrets-objects.c
+++ b/daemon/dbus/gkd-secret-objects.c
@@ -23,9 +23,9 @@
#include "gkd-dbus-util.h"
-#include "gkd-secrets-service.h"
-#include "gkd-secrets-objects.h"
-#include "gkd-secrets-types.h"
+#include "gkd-secret-service.h"
+#include "gkd-secret-objects.h"
+#include "gkd-secret-types.h"
#include "pkcs11/pkcs11i.h"
@@ -37,13 +37,13 @@ enum {
PROP_SERVICE
};
-struct _GkdSecretsObjects {
+struct _GkdSecretObjects {
GObject parent;
- GkdSecretsService *service;
+ GkdSecretService *service;
GP11Slot *pkcs11_slot;
};
-G_DEFINE_TYPE (GkdSecretsObjects, gkd_secrets_objects, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GkdSecretObjects, gkd_secret_objects, G_TYPE_OBJECT);
typedef enum _DataType {
DATA_TYPE_INVALID = 0,
@@ -144,9 +144,9 @@ parse_collection_and_item_from_path (const gchar *path, gchar **collection, gcha
g_assert (item);
/* Make sure it starts with our prefix */
- if (!g_str_has_prefix (path, SECRETS_COLLECTION_PREFIX))
+ if (!g_str_has_prefix (path, SECRET_COLLECTION_PREFIX))
return FALSE;
- path += strlen (SECRETS_COLLECTION_PREFIX);
+ path += strlen (SECRET_COLLECTION_PREFIX);
/* Skip the path separator */
if (path[0] != '/')
@@ -606,7 +606,7 @@ iter_append_item_paths (DBusMessageIter *iter, GList *items)
g_warning ("item has invalid collection or id");
} else {
- path = g_string_new (SECRETS_COLLECTION_PREFIX);
+ path = g_string_new (SECRET_COLLECTION_PREFIX);
g_string_append_c (path, '/');
encode_object_identifier (path, (gchar*)coll->value, coll->length);
g_string_append_c (path, '/');
@@ -644,7 +644,7 @@ iter_append_collection_paths (DBusMessageIter *iter, GList *collections)
g_clear_error (&error);
} else if (n_data) {
- path = g_string_new (SECRETS_COLLECTION_PREFIX);
+ path = g_string_new (SECRET_COLLECTION_PREFIX);
g_string_append_c (path, '/');
encode_object_identifier (path, (gchar*)data, n_data);
dbus_message_iter_append_basic (&array, DBUS_TYPE_OBJECT_PATH, &(path->str));
@@ -728,7 +728,7 @@ object_property_set (GP11Object *object, DBusMessage *message,
if (error != NULL) {
if (error->code == CKR_USER_NOT_LOGGED_IN)
- reply = dbus_message_new_error (message, SECRETS_ERROR_IS_LOCKED,
+ reply = dbus_message_new_error (message, SECRET_ERROR_IS_LOCKED,
"Cannot set property on a locked object");
else
reply = dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
@@ -783,13 +783,13 @@ item_property_get (GP11Object *object, DBusMessage *message)
const gchar *interface;
const gchar *name;
- if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
+ if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_ITEM_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_ITEM_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
return object_property_get (object, message, name);
@@ -811,7 +811,7 @@ item_property_set (GP11Object *object, DBusMessage *message)
dbus_message_iter_get_basic (&iter, &name);
dbus_message_iter_next (&iter);
- if (!gkd_dbus_interface_match (SECRETS_ITEM_INTERFACE, interface))
+ if (!gkd_dbus_interface_match (SECRET_ITEM_INTERFACE, interface))
return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
"Object does not have properties on interface '%s'",
interface);
@@ -832,9 +832,9 @@ item_property_getall (GP11Object *object, DBusMessage *message)
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_ITEM_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_ITEM_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
attrs = gp11_object_get (object, &error,
@@ -847,7 +847,7 @@ item_property_getall (GP11Object *object, DBusMessage *message)
if (error != NULL)
return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Couldn't retrieve properties: %s",
+ "Couldn't retrieve properties: %s",
error->message);
reply = dbus_message_new_method_return (message);
@@ -860,7 +860,7 @@ item_property_getall (GP11Object *object, DBusMessage *message)
}
static DBusMessage*
-item_method_delete (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+item_method_delete (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
GError *error = NULL;
DBusMessage *reply;
@@ -871,7 +871,7 @@ item_method_delete (GkdSecretsObjects *self, GP11Object *object, DBusMessage *me
if (!gp11_object_destroy (object, &error)) {
if (error->code == CKR_USER_NOT_LOGGED_IN)
- reply = dbus_message_new_error_printf (message, SECRETS_ERROR_IS_LOCKED,
+ reply = dbus_message_new_error_printf (message, SECRET_ERROR_IS_LOCKED,
"Cannot delete a locked item");
else
reply = dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
@@ -888,10 +888,10 @@ item_method_delete (GkdSecretsObjects *self, GP11Object *object, DBusMessage *me
}
static DBusMessage*
-item_message_handler (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+item_message_handler (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
/* org.freedesktop.Secrets.Item.Delete() */
- if (dbus_message_is_method_call (message, SECRETS_ITEM_INTERFACE, "Delete"))
+ if (dbus_message_is_method_call (message, SECRET_ITEM_INTERFACE, "Delete"))
return item_method_delete (self, object, message);
/* org.freedesktop.DBus.Properties.Get */
@@ -955,27 +955,27 @@ collection_for_identifier (GP11Session *session, const gchar *coll_id)
}
static DBusMessage*
-collection_property_get (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_property_get (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
DBusMessageIter iter;
DBusMessage *reply;
const gchar *interface;
const gchar *name;
- if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
+ if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_COLLECTION_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_COLLECTION_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
/* Special case, the Items property */
if (g_str_equal (name, "Items")) {
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &iter);
- gkd_secrets_objects_append_item_paths (self, &iter, message,
+ gkd_secret_objects_append_item_paths (self, &iter, message,
collection_get_identifier (object));
return reply;
}
@@ -984,7 +984,7 @@ collection_property_get (GkdSecretsObjects *self, GP11Object *object, DBusMessag
}
static DBusMessage*
-collection_property_set (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_property_set (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
DBusMessageIter iter;
const char *interface;
@@ -999,7 +999,7 @@ collection_property_set (GkdSecretsObjects *self, GP11Object *object, DBusMessag
dbus_message_iter_get_basic (&iter, &name);
dbus_message_iter_next (&iter);
- if (!gkd_dbus_interface_match (SECRETS_COLLECTION_INTERFACE, interface))
+ if (!gkd_dbus_interface_match (SECRET_COLLECTION_INTERFACE, interface))
return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
"Object does not have properties on interface '%s'",
interface);
@@ -1008,7 +1008,7 @@ collection_property_set (GkdSecretsObjects *self, GP11Object *object, DBusMessag
}
static DBusMessage*
-collection_property_getall (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_property_getall (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
GP11Attributes *attrs;
DBusMessageIter iter;
@@ -1022,9 +1022,9 @@ collection_property_getall (GkdSecretsObjects *self, GP11Object *object, DBusMes
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_COLLECTION_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_COLLECTION_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
attrs = gp11_object_get (object, &error,
@@ -1036,7 +1036,7 @@ collection_property_getall (GkdSecretsObjects *self, GP11Object *object, DBusMes
if (error != NULL)
return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Couldn't retrieve properties: %s",
+ "Couldn't retrieve properties: %s",
error->message);
reply = dbus_message_new_method_return (message);
@@ -1051,7 +1051,7 @@ collection_property_getall (GkdSecretsObjects *self, GP11Object *object, DBusMes
dbus_message_iter_open_container (&array, DBUS_TYPE_DICT_ENTRY, NULL, &dict);
name = "Items";
dbus_message_iter_append_basic (&dict, DBUS_TYPE_STRING, &name);
- gkd_secrets_objects_append_item_paths (self, &dict, message,
+ gkd_secret_objects_append_item_paths (self, &dict, message,
collection_get_identifier (object));
dbus_message_iter_close_container (&array, &dict);
@@ -1060,18 +1060,18 @@ collection_property_getall (GkdSecretsObjects *self, GP11Object *object, DBusMes
}
static DBusMessage*
-collection_method_search_items (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_method_search_items (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
const gchar *coll_id;
coll_id = collection_get_identifier (object);
g_return_val_if_fail (coll_id, NULL);
- return gkd_secrets_objects_handle_search_items (self, message, coll_id);
+ return gkd_secret_objects_handle_search_items (self, message, coll_id);
}
static GP11Object*
-collection_find_matching_item (GkdSecretsObjects *self, GP11Object *coll, GP11Attribute *fields)
+collection_find_matching_item (GkdSecretObjects *self, GP11Object *coll, GP11Attribute *fields)
{
GP11Attributes *attrs;
const gchar *identifier;
@@ -1122,7 +1122,7 @@ collection_find_matching_item (GkdSecretsObjects *self, GP11Object *coll, GP11At
}
static DBusMessage*
-collection_method_create_item (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_method_create_item (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
dbus_bool_t replace = FALSE;
GP11Attributes *attrs;
@@ -1143,7 +1143,7 @@ collection_method_create_item (GkdSecretsObjects *self, GP11Object *object, DBus
if (!dbus_message_iter_init (message, &iter))
g_return_val_if_reached (NULL);
attrs = gp11_attributes_new ();
- if (!gkd_secrets_objects_parse_item_props (self, &iter, attrs)) {
+ if (!gkd_secret_objects_parse_item_props (self, &iter, attrs)) {
gp11_attributes_unref (attrs);
return dbus_message_new_error_printf (message, DBUS_ERROR_INVALID_ARGS,
"Invalid properties");
@@ -1177,7 +1177,7 @@ collection_method_create_item (GkdSecretsObjects *self, GP11Object *object, DBus
if (error == NULL) {
data = gp11_object_get_data (item, CKA_ID, &n_data, &error);
if (data != NULL) {
- path = g_string_new (SECRETS_COLLECTION_PREFIX);
+ path = g_string_new (SECRET_COLLECTION_PREFIX);
g_string_append_c (path, '/');
g_string_append (path, collection_get_identifier (object));
g_string_append_c (path, '/');
@@ -1195,7 +1195,7 @@ collection_method_create_item (GkdSecretsObjects *self, GP11Object *object, DBus
} else {
if (error->code == CKR_USER_NOT_LOGGED_IN)
- reply = dbus_message_new_error_printf (message, SECRETS_ERROR_IS_LOCKED,
+ reply = dbus_message_new_error_printf (message, SECRET_ERROR_IS_LOCKED,
"Cannot create an item in a locked collection");
else
reply = dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
@@ -1211,7 +1211,7 @@ collection_method_create_item (GkdSecretsObjects *self, GP11Object *object, DBus
}
static DBusMessage*
-collection_method_delete (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_method_delete (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
GError *error = NULL;
DBusMessage *reply;
@@ -1235,18 +1235,18 @@ collection_method_delete (GkdSecretsObjects *self, GP11Object *object, DBusMessa
}
static DBusMessage*
-collection_message_handler (GkdSecretsObjects *self, GP11Object *object, DBusMessage *message)
+collection_message_handler (GkdSecretObjects *self, GP11Object *object, DBusMessage *message)
{
/* org.freedesktop.Secrets.Collection.Delete() */
- if (dbus_message_is_method_call (message, SECRETS_COLLECTION_INTERFACE, "Delete"))
+ if (dbus_message_is_method_call (message, SECRET_COLLECTION_INTERFACE, "Delete"))
return collection_method_delete (self, object, message);
/* org.freedesktop.Secrets.Collection.SearchItems() */
- if (dbus_message_is_method_call (message, SECRETS_COLLECTION_INTERFACE, "SearchItems"))
+ if (dbus_message_is_method_call (message, SECRET_COLLECTION_INTERFACE, "SearchItems"))
return collection_method_search_items (self, object, message);
/* org.freedesktop.Secrets.Collection.CreateItem() */
- if (dbus_message_is_method_call (message, SECRETS_COLLECTION_INTERFACE, "CreateItem"))
+ if (dbus_message_is_method_call (message, SECRET_COLLECTION_INTERFACE, "CreateItem"))
return collection_method_create_item (self, object, message);
/* org.freedesktop.DBus.Properties.Get() */
@@ -1272,9 +1272,9 @@ collection_message_handler (GkdSecretsObjects *self, GP11Object *object, DBusMes
*/
static GObject*
-gkd_secrets_objects_constructor (GType type, guint n_props, GObjectConstructParam *props)
+gkd_secret_objects_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- GkdSecretsObjects *self = GKD_SECRETS_OBJECTS (G_OBJECT_CLASS (gkd_secrets_objects_parent_class)->constructor(type, n_props, props));
+ GkdSecretObjects *self = GKD_SECRET_OBJECTS (G_OBJECT_CLASS (gkd_secret_objects_parent_class)->constructor(type, n_props, props));
g_return_val_if_fail (self, NULL);
g_return_val_if_fail (self->pkcs11_slot, NULL);
@@ -1284,15 +1284,15 @@ gkd_secrets_objects_constructor (GType type, guint n_props, GObjectConstructPara
}
static void
-gkd_secrets_objects_init (GkdSecretsObjects *self)
+gkd_secret_objects_init (GkdSecretObjects *self)
{
}
static void
-gkd_secrets_objects_dispose (GObject *obj)
+gkd_secret_objects_dispose (GObject *obj)
{
- GkdSecretsObjects *self = GKD_SECRETS_OBJECTS (obj);
+ GkdSecretObjects *self = GKD_SECRET_OBJECTS (obj);
if (self->pkcs11_slot) {
g_object_unref (self->pkcs11_slot);
@@ -1305,25 +1305,25 @@ gkd_secrets_objects_dispose (GObject *obj)
self->service = NULL;
}
- G_OBJECT_CLASS (gkd_secrets_objects_parent_class)->dispose (obj);
+ G_OBJECT_CLASS (gkd_secret_objects_parent_class)->dispose (obj);
}
static void
-gkd_secrets_objects_finalize (GObject *obj)
+gkd_secret_objects_finalize (GObject *obj)
{
- GkdSecretsObjects *self = GKD_SECRETS_OBJECTS (obj);
+ GkdSecretObjects *self = GKD_SECRET_OBJECTS (obj);
g_assert (!self->pkcs11_slot);
g_assert (!self->service);
- G_OBJECT_CLASS (gkd_secrets_objects_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (gkd_secret_objects_parent_class)->finalize (obj);
}
static void
-gkd_secrets_objects_set_property (GObject *obj, guint prop_id, const GValue *value,
- GParamSpec *pspec)
+gkd_secret_objects_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsObjects *self = GKD_SECRETS_OBJECTS (obj);
+ GkdSecretObjects *self = GKD_SECRET_OBJECTS (obj);
switch (prop_id) {
case PROP_PKCS11_SLOT:
@@ -1345,14 +1345,14 @@ gkd_secrets_objects_set_property (GObject *obj, guint prop_id, const GValue *val
}
static void
-gkd_secrets_objects_get_property (GObject *obj, guint prop_id, GValue *value,
+gkd_secret_objects_get_property (GObject *obj, guint prop_id, GValue *value,
GParamSpec *pspec)
{
- GkdSecretsObjects *self = GKD_SECRETS_OBJECTS (obj);
+ GkdSecretObjects *self = GKD_SECRET_OBJECTS (obj);
switch (prop_id) {
case PROP_PKCS11_SLOT:
- g_value_set_object (value, gkd_secrets_objects_get_pkcs11_slot (self));
+ g_value_set_object (value, gkd_secret_objects_get_pkcs11_slot (self));
break;
case PROP_SERVICE:
g_value_set_object (value, self->service);
@@ -1364,15 +1364,15 @@ gkd_secrets_objects_get_property (GObject *obj, guint prop_id, GValue *value,
}
static void
-gkd_secrets_objects_class_init (GkdSecretsObjectsClass *klass)
+gkd_secret_objects_class_init (GkdSecretObjectsClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->constructor = gkd_secrets_objects_constructor;
- gobject_class->dispose = gkd_secrets_objects_dispose;
- gobject_class->finalize = gkd_secrets_objects_finalize;
- gobject_class->set_property = gkd_secrets_objects_set_property;
- gobject_class->get_property = gkd_secrets_objects_get_property;
+ gobject_class->constructor = gkd_secret_objects_constructor;
+ gobject_class->dispose = gkd_secret_objects_dispose;
+ gobject_class->finalize = gkd_secret_objects_finalize;
+ gobject_class->set_property = gkd_secret_objects_set_property;
+ gobject_class->get_property = gkd_secret_objects_get_property;
g_object_class_install_property (gobject_class, PROP_PKCS11_SLOT,
g_param_spec_object ("pkcs11-slot", "Pkcs11 Slot", "PKCS#11 slot that we use for secrets",
@@ -1380,7 +1380,7 @@ gkd_secrets_objects_class_init (GkdSecretsObjectsClass *klass)
g_object_class_install_property (gobject_class, PROP_SERVICE,
g_param_spec_object ("service", "Service", "Service which owns this objects",
- GKD_SECRETS_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ GKD_SECRET_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
/* -----------------------------------------------------------------------------
@@ -1388,14 +1388,14 @@ gkd_secrets_objects_class_init (GkdSecretsObjectsClass *klass)
*/
GP11Slot*
-gkd_secrets_objects_get_pkcs11_slot (GkdSecretsObjects *self)
+gkd_secret_objects_get_pkcs11_slot (GkdSecretObjects *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_OBJECTS (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_OBJECTS (self), NULL);
return self->pkcs11_slot;
}
DBusMessage*
-gkd_secrets_objects_dispatch (GkdSecretsObjects *self, DBusMessage *message)
+gkd_secret_objects_dispatch (GkdSecretObjects *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
GP11Object *object;
@@ -1403,11 +1403,11 @@ gkd_secrets_objects_dispatch (GkdSecretsObjects *self, DBusMessage *message)
gchar *coll_id;
gchar *item_id;
- g_return_val_if_fail (GKD_SECRETS_IS_OBJECTS (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_OBJECTS (self), NULL);
g_return_val_if_fail (message, NULL);
/* The session we're using to access the object */
- session = gkd_secrets_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
+ session = gkd_secret_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
if (session == NULL)
return NULL;
@@ -1439,8 +1439,8 @@ gkd_secrets_objects_dispatch (GkdSecretsObjects *self, DBusMessage *message)
}
gboolean
-gkd_secrets_objects_parse_item_props (GkdSecretsObjects *self, DBusMessageIter *iter,
- GP11Attributes *attrs)
+gkd_secret_objects_parse_item_props (GkdSecretObjects *self, DBusMessageIter *iter,
+ GP11Attributes *attrs)
{
DBusMessageIter array, dict;
CK_ATTRIBUTE_TYPE attr_type;
@@ -1448,7 +1448,7 @@ gkd_secrets_objects_parse_item_props (GkdSecretsObjects *self, DBusMessageIter *
const char *name;
DataType data_type;
- g_return_val_if_fail (GKD_SECRETS_IS_OBJECTS (self), FALSE);
+ g_return_val_if_fail (GKD_SECRET_IS_OBJECTS (self), FALSE);
g_return_val_if_fail (iter, FALSE);
g_return_val_if_fail (attrs, FALSE);
@@ -1479,20 +1479,20 @@ gkd_secrets_objects_parse_item_props (GkdSecretsObjects *self, DBusMessageIter *
void
-gkd_secrets_objects_append_item_paths (GkdSecretsObjects *self, DBusMessageIter *iter,
- DBusMessage *message, const gchar *coll_id)
+gkd_secret_objects_append_item_paths (GkdSecretObjects *self, DBusMessageIter *iter,
+ DBusMessage *message, const gchar *coll_id)
{
DBusMessageIter variant;
GP11Session *session;
GError *error = NULL;
GList *items;
- g_return_if_fail (GKD_SECRETS_IS_OBJECTS (self));
+ g_return_if_fail (GKD_SECRET_IS_OBJECTS (self));
g_return_if_fail (coll_id);
g_return_if_fail (iter && message);
/* The session we're using to access the object */
- session = gkd_secrets_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
+ session = gkd_secret_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
g_return_if_fail (session);
items = gp11_session_find_objects (session, &error,
@@ -1513,19 +1513,19 @@ gkd_secrets_objects_append_item_paths (GkdSecretsObjects *self, DBusMessageIter
}
void
-gkd_secrets_objects_append_collection_paths (GkdSecretsObjects *self, DBusMessageIter *iter,
- DBusMessage *message)
+gkd_secret_objects_append_collection_paths (GkdSecretObjects *self, DBusMessageIter *iter,
+ DBusMessage *message)
{
DBusMessageIter variant;
GError *error = NULL;
GP11Session *session;
GList *colls;
- g_return_if_fail (GKD_SECRETS_IS_OBJECTS (self));
+ g_return_if_fail (GKD_SECRET_IS_OBJECTS (self));
g_return_if_fail (iter && message);
/* The session we're using to access the object */
- session = gkd_secrets_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
+ session = gkd_secret_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
g_return_if_fail (session);
colls = gp11_session_find_objects (session, &error,
@@ -1545,8 +1545,8 @@ gkd_secrets_objects_append_collection_paths (GkdSecretsObjects *self, DBusMessag
}
DBusMessage*
-gkd_secrets_objects_handle_search_items (GkdSecretsObjects *self, DBusMessage *message,
- const gchar *coll_id)
+gkd_secret_objects_handle_search_items (GkdSecretObjects *self, DBusMessage *message,
+ const gchar *coll_id)
{
GP11Attributes *attrs;
GP11Attribute *attr;
@@ -1578,7 +1578,7 @@ gkd_secrets_objects_handle_search_items (GkdSecretsObjects *self, DBusMessage *m
gp11_attributes_add_boolean (attrs, CKA_TOKEN, FALSE);
/* The session we're using to access the object */
- session = gkd_secrets_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
+ session = gkd_secret_service_get_pkcs11_session (self->service, dbus_message_get_sender (message));
g_return_val_if_fail (session, NULL);
/* Create the search object */
@@ -1622,20 +1622,20 @@ gkd_secrets_objects_handle_search_items (GkdSecretsObjects *self, DBusMessage *m
}
GP11Object*
-gkd_secrets_objects_lookup_collection (GkdSecretsObjects *self, const gchar *caller,
- const gchar *objpath)
+gkd_secret_objects_lookup_collection (GkdSecretObjects *self, const gchar *caller,
+ const gchar *objpath)
{
GP11Session *session;
GP11Object *coll;
gchar *coll_id;
gchar *item_id;
- g_return_val_if_fail (GKD_SECRETS_IS_OBJECTS (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_OBJECTS (self), NULL);
g_return_val_if_fail (objpath, NULL);
g_return_val_if_fail (caller, NULL);
/* The session we're using to access the object */
- session = gkd_secrets_service_get_pkcs11_session (self->service, caller);
+ session = gkd_secret_service_get_pkcs11_session (self->service, caller);
g_return_val_if_fail (session, NULL);
/* Figure out which collection or item we're talking about */
diff --git a/daemon/dbus/gkd-secrets-objects.h b/daemon/dbus/gkd-secret-objects.h
similarity index 53%
rename from daemon/dbus/gkd-secrets-objects.h
rename to daemon/dbus/gkd-secret-objects.h
index 0222b2f..012068b 100644
--- a/daemon/dbus/gkd-secrets-objects.h
+++ b/daemon/dbus/gkd-secret-objects.h
@@ -19,54 +19,54 @@
* 02111-1307, USA.
*/
-#ifndef __GKD_SECRETS_OBJECTS_H__
-#define __GKD_SECRETS_OBJECTS_H__
+#ifndef __GKD_SECRET_OBJECTS_H__
+#define __GKD_SECRET_OBJECTS_H__
-#include "gkd-secrets-types.h"
+#include "gkd-secret-types.h"
#include "gp11/gp11.h"
#include <glib-object.h>
-#define GKD_SECRETS_TYPE_OBJECTS (gkd_secrets_objects_get_type ())
-#define GKD_SECRETS_OBJECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRETS_TYPE_OBJECTS, GkdSecretsObjects))
-#define GKD_SECRETS_OBJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRETS_TYPE_OBJECTS, GkdSecretsObjectsClass))
-#define GKD_SECRETS_IS_OBJECTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRETS_TYPE_OBJECTS))
-#define GKD_SECRETS_IS_OBJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRETS_TYPE_OBJECTS))
-#define GKD_SECRETS_OBJECTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRETS_TYPE_OBJECTS, GkdSecretsObjectsClass))
+#define GKD_SECRET_TYPE_OBJECTS (gkd_secret_objects_get_type ())
+#define GKD_SECRET_OBJECTS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRET_TYPE_OBJECTS, GkdSecretObjects))
+#define GKD_SECRET_OBJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRET_TYPE_OBJECTS, GkdSecretObjectsClass))
+#define GKD_SECRET_IS_OBJECTS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRET_TYPE_OBJECTS))
+#define GKD_SECRET_IS_OBJECTS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRET_TYPE_OBJECTS))
+#define GKD_SECRET_OBJECTS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRET_TYPE_OBJECTS, GkdSecretObjectsClass))
-typedef struct _GkdSecretsObjectsClass GkdSecretsObjectsClass;
+typedef struct _GkdSecretObjectsClass GkdSecretObjectsClass;
-struct _GkdSecretsObjectsClass {
+struct _GkdSecretObjectsClass {
GObjectClass parent_class;
};
-GType gkd_secrets_objects_get_type (void);
+GType gkd_secret_objects_get_type (void);
-DBusMessage* gkd_secrets_objects_dispatch (GkdSecretsObjects *self,
+DBusMessage* gkd_secret_objects_dispatch (GkdSecretObjects *self,
DBusMessage *message);
-DBusMessage* gkd_secrets_objects_handle_search_items (GkdSecretsObjects *self,
+DBusMessage* gkd_secret_objects_handle_search_items (GkdSecretObjects *self,
DBusMessage *message,
const gchar *coll_id);
-void gkd_secrets_objects_append_collection_paths (GkdSecretsObjects *self,
+void gkd_secret_objects_append_collection_paths (GkdSecretObjects *self,
DBusMessageIter *iter,
DBusMessage *message);
-gboolean gkd_secrets_objects_parse_item_props (GkdSecretsObjects *self,
+gboolean gkd_secret_objects_parse_item_props (GkdSecretObjects *self,
DBusMessageIter *iter,
GP11Attributes *attrs);
-void gkd_secrets_objects_append_item_paths (GkdSecretsObjects *self,
+void gkd_secret_objects_append_item_paths (GkdSecretObjects *self,
DBusMessageIter *iter,
- DBusMessage *message,
+ DBusMessage *message,
const gchar *coll_id);
-GP11Slot* gkd_secrets_objects_get_pkcs11_slot (GkdSecretsObjects *self);
+GP11Slot* gkd_secret_objects_get_pkcs11_slot (GkdSecretObjects *self);
-GP11Object* gkd_secrets_objects_lookup_collection (GkdSecretsObjects *self,
+GP11Object* gkd_secret_objects_lookup_collection (GkdSecretObjects *self,
const gchar *caller,
const gchar *objpath);
-#endif /* __GKD_SECRETS_OBJECTS_H__ */
+#endif /* __GKD_SECRET_OBJECTS_H__ */
diff --git a/daemon/dbus/gkd-secrets-prompt.c b/daemon/dbus/gkd-secret-prompt.c
similarity index 60%
rename from daemon/dbus/gkd-secrets-prompt.c
rename to daemon/dbus/gkd-secret-prompt.c
index c4596c8..7912c73 100644
--- a/daemon/dbus/gkd-secrets-prompt.c
+++ b/daemon/dbus/gkd-secret-prompt.c
@@ -21,10 +21,10 @@
#include "config.h"
-#include "gkd-secrets-service.h"
-#include "gkd-secrets-prompt.h"
-#include "gkd-secrets-objects.h"
-#include "gkd-secrets-types.h"
+#include "gkd-secret-service.h"
+#include "gkd-secret-prompt.h"
+#include "gkd-secret-objects.h"
+#include "gkd-secret-types.h"
#include "gkd-dbus-util.h"
#include "prompt/gkd-prompt.h"
@@ -38,10 +38,10 @@ enum {
PROP_SERVICE
};
-struct _GkdSecretsPromptPrivate {
+struct _GkdSecretPromptPrivate {
GkdPrompt parent;
gchar *object_path;
- GkdSecretsService *service;
+ GkdSecretService *service;
gboolean prompted;
gboolean completed;
gchar *caller;
@@ -49,7 +49,7 @@ struct _GkdSecretsPromptPrivate {
GList *objects;
};
-G_DEFINE_TYPE (GkdSecretsPrompt, gkd_secrets_prompt, GKD_TYPE_PROMPT);
+G_DEFINE_TYPE (GkdSecretPrompt, gkd_secret_prompt, GKD_TYPE_PROMPT);
static guint unique_prompt_number = 0;
@@ -60,11 +60,11 @@ static guint unique_prompt_number = 0;
static GkdPrompt*
on_prompt_attention (gpointer user_data)
{
- GkdSecretsPrompt *self = user_data;
+ GkdSecretPrompt *self = user_data;
/* Check with the derived class */
- g_return_val_if_fail (GKD_SECRETS_PROMPT_GET_CLASS (self)->prompt_ready, NULL);
- GKD_SECRETS_PROMPT_GET_CLASS (self)->prompt_ready (self);
+ g_return_val_if_fail (GKD_SECRET_PROMPT_GET_CLASS (self)->prompt_ready, NULL);
+ GKD_SECRET_PROMPT_GET_CLASS (self)->prompt_ready (self);
if (self->pv->completed)
return NULL;
@@ -72,24 +72,24 @@ on_prompt_attention (gpointer user_data)
}
static void
-emit_completed (GkdSecretsPrompt *self, gboolean dismissed)
+emit_completed (GkdSecretPrompt *self, gboolean dismissed)
{
DBusMessage *signal;
DBusMessageIter iter;
dbus_bool_t bval;
- signal = dbus_message_new_signal (self->pv->object_path, SECRETS_PROMPT_INTERFACE,
+ signal = dbus_message_new_signal (self->pv->object_path, SECRET_PROMPT_INTERFACE,
"Completed");
dbus_message_set_destination (signal, self->pv->caller);
dbus_message_iter_init_append (signal, &iter);
- g_return_if_fail (GKD_SECRETS_PROMPT_GET_CLASS (self)->encode_result);
- GKD_SECRETS_PROMPT_GET_CLASS (self)->encode_result (self, &iter);
+ g_return_if_fail (GKD_SECRET_PROMPT_GET_CLASS (self)->encode_result);
+ GKD_SECRET_PROMPT_GET_CLASS (self)->encode_result (self, &iter);
bval = dismissed;
dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &bval);
- gkd_secrets_service_send (self->pv->service, signal);
+ gkd_secret_service_send (self->pv->service, signal);
dbus_message_unref (signal);
}
@@ -98,7 +98,7 @@ emit_completed (GkdSecretsPrompt *self, gboolean dismissed)
*/
static DBusMessage*
-prompt_method_prompt (GkdSecretsPrompt *self, DBusMessage *message)
+prompt_method_prompt (GkdSecretPrompt *self, DBusMessage *message)
{
DBusMessage *reply;
const char *window_id;
@@ -113,7 +113,7 @@ prompt_method_prompt (GkdSecretsPrompt *self, DBusMessage *message)
/* Prompt can only be called once */
if (self->pv->prompted)
- return dbus_message_new_error (message, SECRETS_ERROR_ALREADY_EXISTS,
+ return dbus_message_new_error (message, SECRET_ERROR_ALREADY_EXISTS,
"This prompt has already been shown.");
gkd_prompt_set_window_id (GKD_PROMPT (self), window_id);
@@ -127,7 +127,7 @@ prompt_method_prompt (GkdSecretsPrompt *self, DBusMessage *message)
}
static DBusMessage*
-prompt_method_dismiss (GkdSecretsPrompt *self, DBusMessage *message)
+prompt_method_dismiss (GkdSecretPrompt *self, DBusMessage *message)
{
DBusMessage *reply;
@@ -138,7 +138,7 @@ prompt_method_dismiss (GkdSecretsPrompt *self, DBusMessage *message)
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INVALID))
return NULL;
- gkd_secrets_prompt_dismiss (self);
+ gkd_secret_prompt_dismiss (self);
reply = dbus_message_new_method_return (message);
dbus_message_append_args (reply, DBUS_TYPE_INVALID);
@@ -150,62 +150,62 @@ prompt_method_dismiss (GkdSecretsPrompt *self, DBusMessage *message)
*/
static gboolean
-gkd_secrets_prompt_responded (GkdPrompt *base)
+gkd_secret_prompt_responded (GkdPrompt *base)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (base);
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (base);
gint res;
res = gkd_prompt_get_response (GKD_PROMPT (self));
if (res <= GKD_RESPONSE_NO) {
- gkd_secrets_prompt_dismiss (self);
+ gkd_secret_prompt_dismiss (self);
return FALSE;
}
/* Check with the prompt ready guys */
- g_return_val_if_fail (GKD_SECRETS_PROMPT_GET_CLASS (self)->prompt_ready, TRUE);
- GKD_SECRETS_PROMPT_GET_CLASS (self)->prompt_ready (self);
+ g_return_val_if_fail (GKD_SECRET_PROMPT_GET_CLASS (self)->prompt_ready, TRUE);
+ GKD_SECRET_PROMPT_GET_CLASS (self)->prompt_ready (self);
return !self->pv->completed;
}
static void
-gkd_secrets_prompt_ready (GkdSecretsPrompt *self)
+gkd_secret_prompt_ready (GkdSecretPrompt *self)
{
/* Default implementation, unused */
g_return_if_reached ();
}
static void
-gkd_secrets_prompt_encode_result (GkdSecretsPrompt *self, DBusMessageIter *iter)
+gkd_secret_prompt_encode_result (GkdSecretPrompt *self, DBusMessageIter *iter)
{
/* Default implementation, unused */
g_return_if_reached ();
}
static GObject*
-gkd_secrets_prompt_constructor (GType type, guint n_props, GObjectConstructParam *props)
+gkd_secret_prompt_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (G_OBJECT_CLASS (gkd_secrets_prompt_parent_class)->constructor(type, n_props, props));
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (G_OBJECT_CLASS (gkd_secret_prompt_parent_class)->constructor(type, n_props, props));
g_return_val_if_fail (self, NULL);
g_return_val_if_fail (self->pv->caller, NULL);
g_return_val_if_fail (self->pv->service, NULL);
/* Setup the path for the object */
- self->pv->object_path = g_strdup_printf (SECRETS_PROMPT_PREFIX "/p%d", ++unique_prompt_number);
+ self->pv->object_path = g_strdup_printf (SECRET_PROMPT_PREFIX "/p%d", ++unique_prompt_number);
return G_OBJECT (self);
}
static void
-gkd_secrets_prompt_init (GkdSecretsPrompt *self)
+gkd_secret_prompt_init (GkdSecretPrompt *self)
{
- self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GKD_SECRETS_TYPE_PROMPT, GkdSecretsPromptPrivate);
+ self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GKD_SECRET_TYPE_PROMPT, GkdSecretPromptPrivate);
}
static void
-gkd_secrets_prompt_dispose (GObject *obj)
+gkd_secret_prompt_dispose (GObject *obj)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (obj);
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (obj);
g_free (self->pv->object_path);
self->pv->object_path = NULL;
@@ -216,13 +216,13 @@ gkd_secrets_prompt_dispose (GObject *obj)
self->pv->service = NULL;
}
- G_OBJECT_CLASS (gkd_secrets_prompt_parent_class)->dispose (obj);
+ G_OBJECT_CLASS (gkd_secret_prompt_parent_class)->dispose (obj);
}
static void
-gkd_secrets_prompt_finalize (GObject *obj)
+gkd_secret_prompt_finalize (GObject *obj)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (obj);
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (obj);
g_assert (!self->pv->object_path);
g_assert (!self->pv->service);
@@ -230,14 +230,14 @@ gkd_secrets_prompt_finalize (GObject *obj)
g_free (self->pv->caller);
self->pv->caller = NULL;
- G_OBJECT_CLASS (gkd_secrets_prompt_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (gkd_secret_prompt_parent_class)->finalize (obj);
}
static void
-gkd_secrets_prompt_set_property (GObject *obj, guint prop_id, const GValue *value,
- GParamSpec *pspec)
+gkd_secret_prompt_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (obj);
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (obj);
switch (prop_id) {
case PROP_CALLER:
@@ -258,17 +258,17 @@ gkd_secrets_prompt_set_property (GObject *obj, guint prop_id, const GValue *valu
}
static void
-gkd_secrets_prompt_get_property (GObject *obj, guint prop_id, GValue *value,
- GParamSpec *pspec)
+gkd_secret_prompt_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsPrompt *self = GKD_SECRETS_PROMPT (obj);
+ GkdSecretPrompt *self = GKD_SECRET_PROMPT (obj);
switch (prop_id) {
case PROP_CALLER:
- g_value_set_string (value, gkd_secrets_prompt_get_caller (self));
+ g_value_set_string (value, gkd_secret_prompt_get_caller (self));
break;
case PROP_OBJECT_PATH:
- g_value_set_boxed (value, gkd_secrets_prompt_get_object_path (self));
+ g_value_set_boxed (value, gkd_secret_prompt_get_object_path (self));
break;
case PROP_SERVICE:
g_value_set_object (value, self->pv->service);
@@ -280,23 +280,23 @@ gkd_secrets_prompt_get_property (GObject *obj, guint prop_id, GValue *value,
}
static void
-gkd_secrets_prompt_class_init (GkdSecretsPromptClass *klass)
+gkd_secret_prompt_class_init (GkdSecretPromptClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GkdPromptClass *prompt_class = GKD_PROMPT_CLASS (klass);
- gobject_class->constructor = gkd_secrets_prompt_constructor;
- gobject_class->dispose = gkd_secrets_prompt_dispose;
- gobject_class->finalize = gkd_secrets_prompt_finalize;
- gobject_class->set_property = gkd_secrets_prompt_set_property;
- gobject_class->get_property = gkd_secrets_prompt_get_property;
+ gobject_class->constructor = gkd_secret_prompt_constructor;
+ gobject_class->dispose = gkd_secret_prompt_dispose;
+ gobject_class->finalize = gkd_secret_prompt_finalize;
+ gobject_class->set_property = gkd_secret_prompt_set_property;
+ gobject_class->get_property = gkd_secret_prompt_get_property;
- prompt_class->responded = gkd_secrets_prompt_responded;
+ prompt_class->responded = gkd_secret_prompt_responded;
- klass->encode_result = gkd_secrets_prompt_encode_result;
- klass->prompt_ready = gkd_secrets_prompt_ready;
+ klass->encode_result = gkd_secret_prompt_encode_result;
+ klass->prompt_ready = gkd_secret_prompt_ready;
- g_type_class_add_private (klass, sizeof (GkdSecretsPromptPrivate));
+ g_type_class_add_private (klass, sizeof (GkdSecretPromptPrivate));
g_object_class_install_property (gobject_class, PROP_CALLER,
g_param_spec_string ("caller", "Caller", "DBus caller name",
@@ -308,7 +308,7 @@ gkd_secrets_prompt_class_init (GkdSecretsPromptClass *klass)
g_object_class_install_property (gobject_class, PROP_SERVICE,
g_param_spec_object ("service", "Service", "Service which owns this prompt",
- GKD_SECRETS_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ GKD_SECRET_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
/* -----------------------------------------------------------------------------
@@ -316,13 +316,13 @@ gkd_secrets_prompt_class_init (GkdSecretsPromptClass *klass)
*/
DBusMessage*
-gkd_secrets_prompt_dispatch (GkdSecretsPrompt *self, DBusMessage *message)
+gkd_secret_prompt_dispatch (GkdSecretPrompt *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
const gchar *caller;
g_return_val_if_fail (message, NULL);
- g_return_val_if_fail (GKD_SECRETS_IS_PROMPT (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_PROMPT (self), NULL);
/* This should already have been caught elsewhere */
caller = dbus_message_get_sender (message);
@@ -330,11 +330,11 @@ gkd_secrets_prompt_dispatch (GkdSecretsPrompt *self, DBusMessage *message)
g_return_val_if_reached (NULL);
/* org.freedesktop.Secrets.Prompt.Prompt() */
- else if (dbus_message_is_method_call (message, SECRETS_PROMPT_INTERFACE, "Prompt"))
+ else if (dbus_message_is_method_call (message, SECRET_PROMPT_INTERFACE, "Prompt"))
reply = prompt_method_prompt (self, message);
/* org.freedesktop.Secrets.Prompt.Negotiate() */
- else if (dbus_message_is_method_call (message, SECRETS_PROMPT_INTERFACE, "Dismiss"))
+ else if (dbus_message_is_method_call (message, SECRET_PROMPT_INTERFACE, "Dismiss"))
reply = prompt_method_dismiss (self, message);
else if (dbus_message_has_interface (message, DBUS_INTERFACE_INTROSPECTABLE))
@@ -344,47 +344,47 @@ gkd_secrets_prompt_dispatch (GkdSecretsPrompt *self, DBusMessage *message)
}
const gchar*
-gkd_secrets_prompt_get_caller (GkdSecretsPrompt *self)
+gkd_secret_prompt_get_caller (GkdSecretPrompt *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_PROMPT (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_PROMPT (self), NULL);
return self->pv->caller;
}
const gchar*
-gkd_secrets_prompt_get_object_path (GkdSecretsPrompt *self)
+gkd_secret_prompt_get_object_path (GkdSecretPrompt *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_PROMPT (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_PROMPT (self), NULL);
return self->pv->object_path;
}
void
-gkd_secrets_prompt_complete (GkdSecretsPrompt *self)
+gkd_secret_prompt_complete (GkdSecretPrompt *self)
{
- g_return_if_fail (GKD_SECRETS_IS_PROMPT (self));
+ g_return_if_fail (GKD_SECRET_IS_PROMPT (self));
g_return_if_fail (!self->pv->completed);
self->pv->completed = TRUE;
emit_completed (self, FALSE);
}
void
-gkd_secrets_prompt_dismiss (GkdSecretsPrompt *self)
+gkd_secret_prompt_dismiss (GkdSecretPrompt *self)
{
- g_return_if_fail (GKD_SECRETS_IS_PROMPT (self));
+ g_return_if_fail (GKD_SECRET_IS_PROMPT (self));
g_return_if_fail (!self->pv->completed);
self->pv->completed = TRUE;
emit_completed (self, TRUE);
}
GP11Object*
-gkd_secrets_prompt_lookup_collection (GkdSecretsPrompt *self, const gchar *objpath)
+gkd_secret_prompt_lookup_collection (GkdSecretPrompt *self, const gchar *objpath)
{
- GkdSecretsObjects *objects;
+ GkdSecretObjects *objects;
- g_return_val_if_fail (GKD_SECRETS_IS_PROMPT (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_PROMPT (self), NULL);
g_return_val_if_fail (self->pv->service, NULL);
- objects = gkd_secrets_service_get_objects (self->pv->service);
+ objects = gkd_secret_service_get_objects (self->pv->service);
g_return_val_if_fail (objects, NULL);
- return gkd_secrets_objects_lookup_collection (objects, self->pv->caller, objpath);
+ return gkd_secret_objects_lookup_collection (objects, self->pv->caller, objpath);
}
diff --git a/daemon/dbus/gkd-secret-prompt.h b/daemon/dbus/gkd-secret-prompt.h
new file mode 100644
index 0000000..fa29730
--- /dev/null
+++ b/daemon/dbus/gkd-secret-prompt.h
@@ -0,0 +1,70 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2009 Stefan Walter
+ *
+ * This program 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 version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GKD_SECRET_PROMPT_H__
+#define __GKD_SECRET_PROMPT_H__
+
+#include <glib-object.h>
+
+#include "gkd-secret-types.h"
+
+#include "prompt/gkd-prompt.h"
+
+#define GKD_SECRET_TYPE_PROMPT (gkd_secret_prompt_get_type ())
+#define GKD_SECRET_PROMPT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRET_TYPE_PROMPT, GkdSecretPrompt))
+#define GKD_SECRET_PROMPT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRET_TYPE_PROMPT, GkdSecretPromptClass))
+#define GKD_SECRET_IS_PROMPT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRET_TYPE_PROMPT))
+#define GKD_SECRET_IS_PROMPT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRET_TYPE_PROMPT))
+#define GKD_SECRET_PROMPT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRET_TYPE_PROMPT, GkdSecretPromptClass))
+
+typedef struct _GkdSecretPromptClass GkdSecretPromptClass;
+typedef struct _GkdSecretPromptPrivate GkdSecretPromptPrivate;
+
+struct _GkdSecretPrompt {
+ GkdPrompt parent;
+ GkdSecretPromptPrivate *pv;
+};
+
+struct _GkdSecretPromptClass {
+ GkdPromptClass parent_class;
+
+ /* virtual methods */
+ void (*prompt_ready) (GkdSecretPrompt *self);
+ void (*encode_result) (GkdSecretPrompt *self, DBusMessageIter *iter);
+};
+
+GType gkd_secret_prompt_get_type (void);
+
+DBusMessage* gkd_secret_prompt_dispatch (GkdSecretPrompt *self,
+ DBusMessage *message);
+
+const gchar* gkd_secret_prompt_get_caller (GkdSecretPrompt *self);
+
+const gchar* gkd_secret_prompt_get_object_path (GkdSecretPrompt *self);
+
+GP11Object* gkd_secret_prompt_lookup_collection (GkdSecretPrompt *self,
+ const gchar *objpath);
+
+void gkd_secret_prompt_complete (GkdSecretPrompt *self);
+
+void gkd_secret_prompt_dismiss (GkdSecretPrompt *self);
+
+#endif /* __GKD_SECRET_PROMPT_H__ */
diff --git a/daemon/dbus/gkd-secrets-service.c b/daemon/dbus/gkd-secret-service.c
similarity index 74%
rename from daemon/dbus/gkd-secrets-service.c
rename to daemon/dbus/gkd-secret-service.c
index 230535a..8cd42a8 100644
--- a/daemon/dbus/gkd-secrets-service.c
+++ b/daemon/dbus/gkd-secret-service.c
@@ -22,12 +22,12 @@
#include "config.h"
#include "gkd-dbus-util.h"
-#include "gkd-secrets-objects.h"
-#include "gkd-secrets-prompt.h"
-#include "gkd-secrets-service.h"
-#include "gkd-secrets-session.h"
-#include "gkd-secrets-types.h"
-#include "gkd-secrets-unlock.h"
+#include "gkd-secret-objects.h"
+#include "gkd-secret-prompt.h"
+#include "gkd-secret-service.h"
+#include "gkd-secret-session.h"
+#include "gkd-secret-types.h"
+#include "gkd-secret-unlock.h"
#include "egg/egg-unix-credentials.h"
@@ -48,12 +48,12 @@ enum {
#endif
};
-struct _GkdSecretsService {
+struct _GkdSecretService {
GObject parent;
DBusConnection *connection;
GHashTable *clients;
gchar *match_rule;
- GkdSecretsObjects *objects;
+ GkdSecretObjects *objects;
#if 0
gchar *default_collection;
#endif
@@ -74,9 +74,9 @@ typedef struct _ServiceClient {
} ServiceClient;
/* Forward declaration */
-static void service_dispatch_message (GkdSecretsService *, DBusMessage *);
+static void service_dispatch_message (GkdSecretService *, DBusMessage *);
-G_DEFINE_TYPE (GkdSecretsService, gkd_secrets_service, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GkdSecretService, gkd_secret_service, G_TYPE_OBJECT);
/* -----------------------------------------------------------------------------
* INTERNAL
@@ -84,7 +84,7 @@ G_DEFINE_TYPE (GkdSecretsService, gkd_secrets_service, G_TYPE_OBJECT);
#if 0
static void
-update_default (GkdSecretsService *self)
+update_default (GkdSecretService *self)
{
gchar *contents;
@@ -151,7 +151,7 @@ free_client (gpointer data)
}
typedef struct _on_get_connection_unix_process_id_args {
- GkdSecretsService *self;
+ GkdSecretService *self;
DBusMessage *message;
} on_get_connection_unix_process_id_args;
@@ -173,11 +173,11 @@ on_get_connection_unix_process_id (DBusPendingCall *pending, gpointer user_data)
DBusMessage *reply = NULL;
DBusError error = DBUS_ERROR_INIT;
dbus_uint32_t caller_pid = 0;
- GkdSecretsService *self;
+ GkdSecretService *self;
ServiceClient *client;
const gchar *caller;
- g_return_if_fail (GKD_SECRETS_IS_SERVICE (args->self));
+ g_return_if_fail (GKD_SECRET_IS_SERVICE (args->self));
self = args->self;
/* Get the resulting process ID */
@@ -222,14 +222,14 @@ on_get_connection_unix_process_id (DBusPendingCall *pending, gpointer user_data)
}
static void
-initialize_service_client (GkdSecretsService *self, DBusMessage *message)
+initialize_service_client (GkdSecretService *self, DBusMessage *message)
{
on_get_connection_unix_process_id_args *args;
DBusMessage *request;
DBusPendingCall *pending;
const gchar *caller;
- g_assert (GKD_SECRETS_IS_SERVICE (self));
+ g_assert (GKD_SECRET_IS_SERVICE (self));
g_assert (message);
args = g_new0 (on_get_connection_unix_process_id_args, 1);
@@ -266,27 +266,27 @@ initialize_service_client (GkdSecretsService *self, DBusMessage *message)
*/
static DBusMessage*
-service_property_get (GkdSecretsService *self, DBusMessage *message)
+service_property_get (GkdSecretService *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
DBusMessageIter iter;
const gchar *interface;
const gchar *name;
- if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
+ if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface,
DBUS_TYPE_STRING, &name, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_SERVICE_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_SERVICE_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
/* The "Collections" property */
if (g_str_equal (name, "Collections")) {
reply = dbus_message_new_method_return (message);
dbus_message_iter_init_append (reply, &iter);
- gkd_secrets_objects_append_collection_paths (self->objects, &iter, message);
+ gkd_secret_objects_append_collection_paths (self->objects, &iter, message);
/* No such property */
} else {
@@ -298,13 +298,13 @@ service_property_get (GkdSecretsService *self, DBusMessage *message)
}
static DBusMessage*
-service_property_set (GkdSecretsService *self, DBusMessage *message)
+service_property_set (GkdSecretService *self, DBusMessage *message)
{
return NULL; /* TODO: Need to implement */
}
static DBusMessage*
-service_property_getall (GkdSecretsService *self, DBusMessage *message)
+service_property_getall (GkdSecretService *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
DBusMessageIter array;
@@ -316,9 +316,9 @@ service_property_getall (GkdSecretsService *self, DBusMessage *message)
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &interface, DBUS_TYPE_INVALID))
return NULL;
- if (!gkd_dbus_interface_match (SECRETS_SERVICE_INTERFACE, interface))
- return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
- "Object does not have properties on interface '%s'",
+ if (!gkd_dbus_interface_match (SECRET_SERVICE_INTERFACE, interface))
+ return dbus_message_new_error_printf (message, DBUS_ERROR_FAILED,
+ "Object does not have properties on interface '%s'",
interface);
reply = dbus_message_new_method_return (message);
@@ -328,7 +328,7 @@ service_property_getall (GkdSecretsService *self, DBusMessage *message)
name = "Collections";
dbus_message_iter_open_container (&array, DBUS_TYPE_DICT_ENTRY, NULL, &dict);
dbus_message_iter_append_basic (&dict, DBUS_TYPE_STRING, &name);
- gkd_secrets_objects_append_collection_paths (self->objects, &dict, message);
+ gkd_secret_objects_append_collection_paths (self->objects, &dict, message);
dbus_message_iter_close_container (&array, &dict);
dbus_message_iter_close_container (&iter, &array);
@@ -337,9 +337,9 @@ service_property_getall (GkdSecretsService *self, DBusMessage *message)
}
static DBusMessage*
-service_method_open_session (GkdSecretsService *self, DBusMessage *message)
+service_method_open_session (GkdSecretService *self, DBusMessage *message)
{
- GkdSecretsSession *session;
+ GkdSecretSession *session;
ServiceClient *client;
DBusMessage *reply;
const gchar *caller;
@@ -351,7 +351,7 @@ service_method_open_session (GkdSecretsService *self, DBusMessage *message)
caller = dbus_message_get_sender (message);
/* Now we can create a session with this information */
- session = g_object_new (GKD_SECRETS_TYPE_SESSION,
+ session = g_object_new (GKD_SECRET_TYPE_SESSION,
"caller", caller,
"service", self,
NULL);
@@ -359,7 +359,7 @@ service_method_open_session (GkdSecretsService *self, DBusMessage *message)
/* Take ownership of the session */
client = g_hash_table_lookup (self->clients, caller);
g_return_val_if_fail (client, NULL);
- path = gkd_secrets_session_get_object_path (session);
+ path = gkd_secret_session_get_object_path (session);
g_return_val_if_fail (!g_hash_table_lookup (client->sessions, path), NULL);
g_hash_table_replace (client->sessions, (gpointer)path, session);
@@ -370,9 +370,9 @@ service_method_open_session (GkdSecretsService *self, DBusMessage *message)
}
static DBusMessage*
-service_method_unlock (GkdSecretsService *self, DBusMessage *message)
+service_method_unlock (GkdSecretService *self, DBusMessage *message)
{
- GkdSecretsUnlock *unlock;
+ GkdSecretUnlock *unlock;
ServiceClient *client;
DBusMessage *reply;
const char *caller;
@@ -386,16 +386,16 @@ service_method_unlock (GkdSecretsService *self, DBusMessage *message)
return NULL;
caller = dbus_message_get_sender (message);
- unlock = gkd_secrets_unlock_new (self, caller);
+ unlock = gkd_secret_unlock_new (self, caller);
for (i = 0; i < n_objpaths; ++i)
- gkd_secrets_unlock_queue (unlock, objpaths[i]);
+ gkd_secret_unlock_queue (unlock, objpaths[i]);
dbus_free_string_array (objpaths);
/* So do we need to prompt? */
- if (gkd_secrets_unlock_have_queued (unlock)) {
+ if (gkd_secret_unlock_have_queued (unlock)) {
client = g_hash_table_lookup (self->clients, caller);
g_return_val_if_fail (client, NULL);
- path = gkd_secrets_prompt_get_object_path (GKD_SECRETS_PROMPT (unlock));
+ path = gkd_secret_prompt_get_object_path (GKD_SECRET_PROMPT (unlock));
g_hash_table_replace (client->prompts, (gpointer)path, g_object_ref (unlock));
/* No need to prompt */
@@ -404,48 +404,48 @@ service_method_unlock (GkdSecretsService *self, DBusMessage *message)
}
reply = dbus_message_new_method_return (message);
- objpaths = gkd_secrets_unlock_get_results (unlock, &n_objpaths);
+ objpaths = gkd_secret_unlock_get_results (unlock, &n_objpaths);
dbus_message_append_args (reply,
DBUS_TYPE_ARRAY, DBUS_TYPE_OBJECT_PATH, &objpaths, n_objpaths,
DBUS_TYPE_OBJECT_PATH, &path,
DBUS_TYPE_INVALID);
- gkd_secrets_unlock_reset_results (unlock);
+ gkd_secret_unlock_reset_results (unlock);
g_object_unref (unlock);
return reply;
}
static DBusMessage*
-service_message_handler (GkdSecretsService *self, DBusMessage *message)
+service_message_handler (GkdSecretService *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
g_return_val_if_fail (message, NULL);
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
/* org.freedesktop.Secrets.Service.OpenSession() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "OpenSession"))
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "OpenSession"))
reply = service_method_open_session (self, message);
/* org.freedesktop.Secrets.Service.CreateCollection() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "CreateCollection"))
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "CreateCollection"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Service.LockService() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "LockService"))
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "LockService"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Service.SearchItems() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "SearchItems"))
- return gkd_secrets_objects_handle_search_items (self->objects, message, NULL);
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "SearchItems"))
+ return gkd_secret_objects_handle_search_items (self->objects, message, NULL);
/* org.freedesktop.Secrets.Service.Unlock() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "Unlock"))
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "Unlock"))
reply = service_method_unlock (self, message);
/* org.freedesktop.Secrets.Service.CompleteAuthenticate() */
- if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "CompleteAuthenticate"))
+ if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "CompleteAuthenticate"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.DBus.Properties.Get() */
@@ -467,7 +467,7 @@ service_message_handler (GkdSecretsService *self, DBusMessage *message)
}
static void
-service_dispatch_message (GkdSecretsService *self, DBusMessage *message)
+service_dispatch_message (GkdSecretService *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
const gchar *caller;
@@ -475,7 +475,7 @@ service_dispatch_message (GkdSecretsService *self, DBusMessage *message)
const gchar *path;
gpointer object;
- g_assert (GKD_SECRETS_IS_SERVICE (self));
+ g_assert (GKD_SECRET_IS_SERVICE (self));
g_assert (message);
/* The first thing we do is try to allocate a client context */
@@ -498,30 +498,30 @@ service_dispatch_message (GkdSecretsService *self, DBusMessage *message)
g_return_if_fail (path);
/* Dispatched to a session, find a session in this client */
- if (object_path_has_prefix (path, SECRETS_SESSION_PREFIX)) {
+ if (object_path_has_prefix (path, SECRET_SESSION_PREFIX)) {
object = g_hash_table_lookup (client->sessions, path);
if (object != NULL)
- reply = gkd_secrets_session_dispatch (object, message);
+ reply = gkd_secret_session_dispatch (object, message);
/* Dispatched to a prompt, find a prompt in this client */
- } else if (object_path_has_prefix (path, SECRETS_PROMPT_PREFIX)) {
+ } else if (object_path_has_prefix (path, SECRET_PROMPT_PREFIX)) {
object = g_hash_table_lookup (client->prompts, path);
if (object != NULL)
- reply = gkd_secrets_prompt_dispatch (object, message);
+ reply = gkd_secret_prompt_dispatch (object, message);
/* Dispatched to a collection, off it goes */
- } else if (object_path_has_prefix (path, SECRETS_COLLECTION_PREFIX)) {
- reply = gkd_secrets_objects_dispatch (self->objects, message);
+ } else if (object_path_has_prefix (path, SECRET_COLLECTION_PREFIX)) {
+ reply = gkd_secret_objects_dispatch (self->objects, message);
/* Addressed to the service */
- } else if (g_str_equal (path, SECRETS_SERVICE_PATH)) {
+ } else if (g_str_equal (path, SECRET_SERVICE_PATH)) {
reply = service_message_handler (self, message);
}
/* Should we send an error? */
if (!reply && dbus_message_get_type (message) == DBUS_MESSAGE_TYPE_METHOD_CALL) {
if (!dbus_message_get_no_reply (message) && !gkd_dbus_message_is_handled (message)) {
- reply = dbus_message_new_error_printf (message, DBUS_ERROR_UNKNOWN_METHOD,
+ reply = dbus_message_new_error_printf (message, DBUS_ERROR_UNKNOWN_METHOD,
"Method \"%s\" with signature \"%s\" on interface \"%s\" doesn't exist\n",
dbus_message_get_member (message),
dbus_message_get_signature (message),
@@ -536,9 +536,9 @@ service_dispatch_message (GkdSecretsService *self, DBusMessage *message)
}
static DBusHandlerResult
-gkd_secrets_service_filter_handler (DBusConnection *conn, DBusMessage *message, gpointer user_data)
+gkd_secret_service_filter_handler (DBusConnection *conn, DBusMessage *message, gpointer user_data)
{
- GkdSecretsService *self = user_data;
+ GkdSecretService *self = user_data;
const gchar *object_name;
const gchar *old_owner;
const gchar *new_owner;
@@ -546,11 +546,11 @@ gkd_secrets_service_filter_handler (DBusConnection *conn, DBusMessage *message,
const gchar *interface;
g_return_val_if_fail (conn && message, DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
/* org.freedesktop.DBus.NameOwnerChanged(STRING name, STRING old_owner, STRING new_owner) */
- if (dbus_message_is_signal (message, BUS_INTERFACE, "NameOwnerChanged") &&
- dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &object_name,
+ if (dbus_message_is_signal (message, BUS_INTERFACE, "NameOwnerChanged") &&
+ dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &object_name,
DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner,
DBUS_TYPE_INVALID)) {
@@ -574,10 +574,10 @@ gkd_secrets_service_filter_handler (DBusConnection *conn, DBusMessage *message,
/* Dispatch any method call on our interfaces, for our objects */
case DBUS_MESSAGE_TYPE_METHOD_CALL:
- if (object_path_has_prefix (path, SECRETS_SERVICE_PATH)) {
+ if (object_path_has_prefix (path, SECRET_SERVICE_PATH)) {
interface = dbus_message_get_interface (message);
if (interface == NULL ||
- g_str_has_prefix (interface, SECRETS_INTERFACE_PREFIX) ||
+ g_str_has_prefix (interface, SECRET_INTERFACE_PREFIX) ||
g_str_equal (interface, DBUS_INTERFACE_PROPERTIES) ||
g_str_equal (interface, DBUS_INTERFACE_INTROSPECTABLE)) {
service_dispatch_message (self, message);
@@ -588,7 +588,7 @@ gkd_secrets_service_filter_handler (DBusConnection *conn, DBusMessage *message,
/* Dispatch any signal for one of our objects */
case DBUS_MESSAGE_TYPE_SIGNAL:
- if (object_path_has_prefix (path, SECRETS_SERVICE_PATH)) {
+ if (object_path_has_prefix (path, SECRET_SERVICE_PATH)) {
service_dispatch_message (self, message);
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -606,9 +606,9 @@ gkd_secrets_service_filter_handler (DBusConnection *conn, DBusMessage *message,
*/
static GObject*
-gkd_secrets_service_constructor (GType type, guint n_props, GObjectConstructParam *props)
+gkd_secret_service_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- GkdSecretsService *self = GKD_SECRETS_SERVICE (G_OBJECT_CLASS (gkd_secrets_service_parent_class)->constructor(type, n_props, props));
+ GkdSecretService *self = GKD_SECRET_SERVICE (G_OBJECT_CLASS (gkd_secret_service_parent_class)->constructor(type, n_props, props));
DBusError error = DBUS_ERROR_INIT;
GP11Slot *slot = NULL;
guint i;
@@ -624,7 +624,7 @@ gkd_secrets_service_constructor (GType type, guint n_props, GObjectConstructPara
/* Create our objects proxy */
g_return_val_if_fail (GP11_IS_SLOT (slot), NULL);
- self->objects = g_object_new (GKD_SECRETS_TYPE_OBJECTS,
+ self->objects = g_object_new (GKD_SECRET_TYPE_OBJECTS,
"pkcs11-slot", slot, "service", self, NULL);
/* Register for signals that let us know when clients leave the bus */
@@ -638,22 +638,22 @@ gkd_secrets_service_constructor (GType type, guint n_props, GObjectConstructPara
self->match_rule = NULL;
}
- if (!dbus_connection_add_filter (self->connection, gkd_secrets_service_filter_handler, self, NULL))
+ if (!dbus_connection_add_filter (self->connection, gkd_secret_service_filter_handler, self, NULL))
g_return_val_if_reached (NULL);
return G_OBJECT (self);
}
static void
-gkd_secrets_service_init (GkdSecretsService *self)
+gkd_secret_service_init (GkdSecretService *self)
{
self->clients = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, free_client);
}
static void
-gkd_secrets_service_dispose (GObject *obj)
+gkd_secret_service_dispose (GObject *obj)
{
- GkdSecretsService *self = GKD_SECRETS_SERVICE (obj);
+ GkdSecretService *self = GKD_SECRET_SERVICE (obj);
if (self->match_rule) {
g_return_if_fail (self->connection);
@@ -673,18 +673,18 @@ gkd_secrets_service_dispose (GObject *obj)
}
if (self->connection) {
- dbus_connection_remove_filter (self->connection, gkd_secrets_service_filter_handler, self);
+ dbus_connection_remove_filter (self->connection, gkd_secret_service_filter_handler, self);
dbus_connection_unref (self->connection);
self->connection = NULL;
}
- G_OBJECT_CLASS (gkd_secrets_service_parent_class)->dispose (obj);
+ G_OBJECT_CLASS (gkd_secret_service_parent_class)->dispose (obj);
}
static void
-gkd_secrets_service_finalize (GObject *obj)
+gkd_secret_service_finalize (GObject *obj)
{
- GkdSecretsService *self = GKD_SECRETS_SERVICE (obj);
+ GkdSecretService *self = GKD_SECRET_SERVICE (obj);
g_assert (g_hash_table_size (self->clients) == 0);
g_hash_table_destroy (self->clients);
@@ -695,14 +695,14 @@ gkd_secrets_service_finalize (GObject *obj)
self->pv->default_collection = NULL;
#endif
- G_OBJECT_CLASS (gkd_secrets_service_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (gkd_secret_service_parent_class)->finalize (obj);
}
static void
-gkd_secrets_service_set_property (GObject *obj, guint prop_id, const GValue *value,
- GParamSpec *pspec)
+gkd_secret_service_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsService *self = GKD_SECRETS_SERVICE (obj);
+ GkdSecretService *self = GKD_SECRET_SERVICE (obj);
switch (prop_id) {
case PROP_CONNECTION:
@@ -720,17 +720,17 @@ gkd_secrets_service_set_property (GObject *obj, guint prop_id, const GValue *val
}
static void
-gkd_secrets_service_get_property (GObject *obj, guint prop_id, GValue *value,
- GParamSpec *pspec)
+gkd_secret_service_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsService *self = GKD_SECRETS_SERVICE (obj);
+ GkdSecretService *self = GKD_SECRET_SERVICE (obj);
switch (prop_id) {
case PROP_CONNECTION:
- g_value_set_boxed (value, gkd_secrets_service_get_connection (self));
+ g_value_set_boxed (value, gkd_secret_service_get_connection (self));
break;
case PROP_PKCS11_SLOT:
- g_value_set_object (value, gkd_secrets_service_get_pkcs11_slot (self));
+ g_value_set_object (value, gkd_secret_service_get_pkcs11_slot (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
@@ -739,15 +739,15 @@ gkd_secrets_service_get_property (GObject *obj, guint prop_id, GValue *value,
}
static void
-gkd_secrets_service_class_init (GkdSecretsServiceClass *klass)
+gkd_secret_service_class_init (GkdSecretServiceClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->constructor = gkd_secrets_service_constructor;
- gobject_class->dispose = gkd_secrets_service_dispose;
- gobject_class->finalize = gkd_secrets_service_finalize;
- gobject_class->set_property = gkd_secrets_service_set_property;
- gobject_class->get_property = gkd_secrets_service_get_property;
+ gobject_class->constructor = gkd_secret_service_constructor;
+ gobject_class->dispose = gkd_secret_service_dispose;
+ gobject_class->finalize = gkd_secret_service_finalize;
+ gobject_class->set_property = gkd_secret_service_set_property;
+ gobject_class->get_property = gkd_secret_service_get_property;
g_object_class_install_property (gobject_class, PROP_CONNECTION,
g_param_spec_boxed ("connection", "Connection", "DBus Connection",
@@ -763,35 +763,35 @@ gkd_secrets_service_class_init (GkdSecretsServiceClass *klass)
*/
void
-gkd_secrets_service_send (GkdSecretsService *self, DBusMessage *message)
+gkd_secret_service_send (GkdSecretService *self, DBusMessage *message)
{
- g_return_if_fail (GKD_SECRETS_IS_SERVICE (self));
+ g_return_if_fail (GKD_SECRET_IS_SERVICE (self));
dbus_connection_send (self->connection, message, NULL);
}
-GkdSecretsObjects*
-gkd_secrets_service_get_objects (GkdSecretsService *self)
+GkdSecretObjects*
+gkd_secret_service_get_objects (GkdSecretService *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
return self->objects;
}
DBusConnection*
-gkd_secrets_service_get_connection (GkdSecretsService *self)
+gkd_secret_service_get_connection (GkdSecretService *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
return self->connection;
}
GP11Slot*
-gkd_secrets_service_get_pkcs11_slot (GkdSecretsService *self)
+gkd_secret_service_get_pkcs11_slot (GkdSecretService *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
- return gkd_secrets_objects_get_pkcs11_slot (self->objects);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
+ return gkd_secret_objects_get_pkcs11_slot (self->objects);
}
GP11Session*
-gkd_secrets_service_get_pkcs11_session (GkdSecretsService *self, const gchar *caller)
+gkd_secret_service_get_pkcs11_session (GkdSecretService *self, const gchar *caller)
{
ServiceClient *client;
GError *error = NULL;
@@ -800,7 +800,7 @@ gkd_secrets_service_get_pkcs11_session (GkdSecretsService *self, const gchar *ca
gulong flags;
gboolean login;
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
g_return_val_if_fail (caller, NULL);
client = g_hash_table_lookup (self->clients, caller);
@@ -809,11 +809,11 @@ gkd_secrets_service_get_pkcs11_session (GkdSecretsService *self, const gchar *ca
/* Open a new session if necessary */
if (!client->pkcs11_session) {
flags = CKF_RW_SESSION | CKF_G_APPLICATION_SESSION;
- slot = gkd_secrets_service_get_pkcs11_slot (self);
+ slot = gkd_secret_service_get_pkcs11_slot (self);
client->pkcs11_session = gp11_slot_open_session_full (slot, flags, &client->app,
NULL, NULL, &error);
if (!client->pkcs11_session) {
- g_warning ("couldn't open pkcs11 session for secrets service: %s",
+ g_warning ("couldn't open pkcs11 session for secret service: %s",
error->message);
g_clear_error (&error);
return NULL;
@@ -824,7 +824,7 @@ gkd_secrets_service_get_pkcs11_session (GkdSecretsService *self, const gchar *ca
login = info && (info->flags & CKF_LOGIN_REQUIRED);
gp11_token_info_free (info);
if (login && !gp11_session_login (client->pkcs11_session, CKU_USER, NULL, 0, &error)) {
- g_warning ("couldn't log into pkcs11 session for secrets service: %s",
+ g_warning ("couldn't log into pkcs11 session for secret service: %s",
error->message);
g_clear_error (&error);
g_object_unref (client->pkcs11_session);
@@ -837,43 +837,43 @@ gkd_secrets_service_get_pkcs11_session (GkdSecretsService *self, const gchar *ca
}
void
-gkd_secrets_service_close_session (GkdSecretsService *self, GkdSecretsSession *session)
+gkd_secret_service_close_session (GkdSecretService *self, GkdSecretSession *session)
{
ServiceClient *client;
const gchar *caller;
const gchar *path;
- g_return_if_fail (GKD_SECRETS_IS_SERVICE (self));
- g_return_if_fail (GKD_SECRETS_IS_SESSION (session));
+ g_return_if_fail (GKD_SECRET_IS_SERVICE (self));
+ g_return_if_fail (GKD_SECRET_IS_SESSION (session));
- caller = gkd_secrets_session_get_caller (session);
+ caller = gkd_secret_session_get_caller (session);
client = g_hash_table_lookup (self->clients, caller);
g_return_if_fail (client);
- path = gkd_secrets_session_get_object_path (session);
+ path = gkd_secret_session_get_object_path (session);
g_hash_table_remove (client->sessions, path);
}
#if 0
-GkdSecretsCollection*
-gkd_secrets_service_get_default_collection (GkdSecretsService *self)
+GkdSecretCollection*
+gkd_secret_service_get_default_collection (GkdSecretService *self)
{
- GkdSecretsCollection *collection = NULL;
+ GkdSecretCollection *collection = NULL;
- g_return_val_if_fail (GKD_SECRETS_IS_SERVICE (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), NULL);
if (!self->pv->default_collection)
update_default (self);
if (self->pv->default_collection != NULL)
- collection = gkd_secrets_service_get_collection (self, self->pv->default_collection);
+ collection = gkd_secret_service_get_collection (self, self->pv->default_collection);
/*
* We prefer to make the 'login' keyring the default
* keyring when nothing else is setup.
*/
if (collection == NULL)
- collection = gkd_secrets_service_get_collection (self, "login");
+ collection = gkd_secret_service_get_collection (self, "login");
/*
* Otherwise fall back to the 'default' keyring setup
@@ -881,7 +881,7 @@ gkd_secrets_service_get_default_collection (GkdSecretsService *self)
* create a new keyring.
*/
if (collection == NULL)
- collection = gkd_secrets_service_get_collection (self, "default");
+ collection = gkd_secret_service_get_collection (self, "default");
return collection;
}
diff --git a/daemon/dbus/gkd-secret-service.h b/daemon/dbus/gkd-secret-service.h
new file mode 100644
index 0000000..edd67ff
--- /dev/null
+++ b/daemon/dbus/gkd-secret-service.h
@@ -0,0 +1,76 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2009 Stefan Walter
+ *
+ * This program 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 version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GKD_SECRET_SERVICE_H__
+#define __GKD_SECRET_SERVICE_H__
+
+#include "gkd-secret-types.h"
+
+#include "gp11/gp11.h"
+
+#include <dbus/dbus.h>
+
+#include <glib-object.h>
+
+#define GKD_SECRET_TYPE_SERVICE (gkd_secret_service_get_type ())
+#define GKD_SECRET_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRET_TYPE_SERVICE, GkdSecretService))
+#define GKD_SECRET_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRET_TYPE_SERVICE, GkdSecretServiceClass))
+#define GKD_SECRET_IS_SERVICE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRET_TYPE_SERVICE))
+#define GKD_SECRET_IS_SERVICE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRET_TYPE_SERVICE))
+#define GKD_SECRET_SERVICE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRET_TYPE_SERVICE, GkdSecretServiceClass))
+
+typedef struct _GkdSecretServiceClass GkdSecretServiceClass;
+
+struct _GkdSecretServiceClass {
+ GObjectClass parent_class;
+#if 0
+ /* signals --------------------------------------------------------- */
+
+ void (*signal) (GkdSecretService *self);
+#endif
+};
+
+GType gkd_secret_service_get_type (void);
+
+DBusConnection* gkd_secret_service_get_connection (GkdSecretService *self);
+
+GP11Slot* gkd_secret_service_get_pkcs11_slot (GkdSecretService *self);
+
+GP11Session* gkd_secret_service_get_pkcs11_session (GkdSecretService *self,
+ const gchar *caller);
+
+GkdSecretObjects* gkd_secret_service_get_objects (GkdSecretService *self);
+
+#if 0
+void gkd_secret_service_refresh (GkdSecretService *self);
+#endif
+
+void gkd_secret_service_close_session (GkdSecretService *self,
+ GkdSecretSession *sess);
+
+void gkd_secret_service_send (GkdSecretService *self,
+ DBusMessage *message);
+
+#if 0
+GkdSecretCollection* gkd_secret_service_get_default_collection (GkdSecretService *self);
+#endif
+
+#endif /* ___SECRET_SERVICE_H__ */
diff --git a/daemon/dbus/gkd-secrets-session.c b/daemon/dbus/gkd-secret-session.c
similarity index 66%
rename from daemon/dbus/gkd-secrets-session.c
rename to daemon/dbus/gkd-secret-session.c
index 4729a73..127be61 100644
--- a/daemon/dbus/gkd-secrets-session.c
+++ b/daemon/dbus/gkd-secret-session.c
@@ -21,9 +21,9 @@
#include "config.h"
-#include "gkd-secrets-service.h"
-#include "gkd-secrets-session.h"
-#include "gkd-secrets-types.h"
+#include "gkd-secret-service.h"
+#include "gkd-secret-session.h"
+#include "gkd-secret-types.h"
#include "gkd-dbus-util.h"
#include <string.h>
@@ -36,15 +36,15 @@ enum {
PROP_SERVICE
};
-struct _GkdSecretsSession {
+struct _GkdSecretSession {
GObject parent;
gchar *object_path;
- GkdSecretsService *service;
+ GkdSecretService *service;
gchar *caller_exec;
gchar *caller;
};
-G_DEFINE_TYPE (GkdSecretsSession, gkd_secrets_session, G_TYPE_OBJECT);
+G_DEFINE_TYPE (GkdSecretSession, gkd_secret_session, G_TYPE_OBJECT);
static guint unique_session_number = 0;
@@ -57,7 +57,7 @@ static guint unique_session_number = 0;
*/
static DBusMessage*
-session_method_close (GkdSecretsSession *self, DBusMessage *message)
+session_method_close (GkdSecretSession *self, DBusMessage *message)
{
DBusMessage *reply;
@@ -66,7 +66,7 @@ session_method_close (GkdSecretsSession *self, DBusMessage *message)
if (!dbus_message_get_args (message, NULL, DBUS_TYPE_INVALID))
return NULL;
- gkd_secrets_service_close_session (self->service, self);
+ gkd_secret_service_close_session (self->service, self);
reply = dbus_message_new_method_return (message);
dbus_message_append_args (reply, DBUS_TYPE_INVALID);
@@ -74,7 +74,7 @@ session_method_close (GkdSecretsSession *self, DBusMessage *message)
}
static DBusMessage*
-session_property_handler (GkdSecretsSession *self, DBusMessage *message)
+session_property_handler (GkdSecretSession *self, DBusMessage *message)
{
g_return_val_if_reached (NULL); /* TODO: Need to implement */
#if 0
@@ -101,30 +101,30 @@ session_property_handler (GkdSecretsSession *self, DBusMessage *message)
*/
static GObject*
-gkd_secrets_session_constructor (GType type, guint n_props, GObjectConstructParam *props)
+gkd_secret_session_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
- GkdSecretsSession *self = GKD_SECRETS_SESSION (G_OBJECT_CLASS (gkd_secrets_session_parent_class)->constructor(type, n_props, props));
+ GkdSecretSession *self = GKD_SECRET_SESSION (G_OBJECT_CLASS (gkd_secret_session_parent_class)->constructor(type, n_props, props));
g_return_val_if_fail (self, NULL);
g_return_val_if_fail (self->caller, NULL);
g_return_val_if_fail (self->service, NULL);
/* Setup the path for the object */
- self->object_path = g_strdup_printf (SECRETS_SESSION_PREFIX "/s%d", ++unique_session_number);
+ self->object_path = g_strdup_printf (SECRET_SESSION_PREFIX "/s%d", ++unique_session_number);
return G_OBJECT (self);
}
static void
-gkd_secrets_session_init (GkdSecretsSession *self)
+gkd_secret_session_init (GkdSecretSession *self)
{
}
static void
-gkd_secrets_session_dispose (GObject *obj)
+gkd_secret_session_dispose (GObject *obj)
{
- GkdSecretsSession *self = GKD_SECRETS_SESSION (obj);
+ GkdSecretSession *self = GKD_SECRET_SESSION (obj);
g_free (self->object_path);
self->object_path = NULL;
@@ -135,13 +135,13 @@ gkd_secrets_session_dispose (GObject *obj)
self->service = NULL;
}
- G_OBJECT_CLASS (gkd_secrets_session_parent_class)->dispose (obj);
+ G_OBJECT_CLASS (gkd_secret_session_parent_class)->dispose (obj);
}
static void
-gkd_secrets_session_finalize (GObject *obj)
+gkd_secret_session_finalize (GObject *obj)
{
- GkdSecretsSession *self = GKD_SECRETS_SESSION (obj);
+ GkdSecretSession *self = GKD_SECRET_SESSION (obj);
g_assert (!self->object_path);
g_assert (!self->service);
@@ -152,14 +152,14 @@ gkd_secrets_session_finalize (GObject *obj)
g_free (self->caller);
self->caller = NULL;
- G_OBJECT_CLASS (gkd_secrets_session_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (gkd_secret_session_parent_class)->finalize (obj);
}
static void
-gkd_secrets_session_set_property (GObject *obj, guint prop_id, const GValue *value,
- GParamSpec *pspec)
+gkd_secret_session_set_property (GObject *obj, guint prop_id, const GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsSession *self = GKD_SECRETS_SESSION (obj);
+ GkdSecretSession *self = GKD_SECRET_SESSION (obj);
switch (prop_id) {
case PROP_CALLER:
@@ -184,20 +184,20 @@ gkd_secrets_session_set_property (GObject *obj, guint prop_id, const GValue *val
}
static void
-gkd_secrets_session_get_property (GObject *obj, guint prop_id, GValue *value,
- GParamSpec *pspec)
+gkd_secret_session_get_property (GObject *obj, guint prop_id, GValue *value,
+ GParamSpec *pspec)
{
- GkdSecretsSession *self = GKD_SECRETS_SESSION (obj);
+ GkdSecretSession *self = GKD_SECRET_SESSION (obj);
switch (prop_id) {
case PROP_CALLER:
- g_value_set_string (value, gkd_secrets_session_get_caller (self));
+ g_value_set_string (value, gkd_secret_session_get_caller (self));
break;
case PROP_CALLER_EXECUTABLE:
- g_value_set_string (value, gkd_secrets_session_get_caller_executable (self));
+ g_value_set_string (value, gkd_secret_session_get_caller_executable (self));
break;
case PROP_OBJECT_PATH:
- g_value_set_boxed (value, gkd_secrets_session_get_object_path (self));
+ g_value_set_boxed (value, gkd_secret_session_get_object_path (self));
break;
case PROP_SERVICE:
g_value_set_object (value, self->service);
@@ -209,15 +209,15 @@ gkd_secrets_session_get_property (GObject *obj, guint prop_id, GValue *value,
}
static void
-gkd_secrets_session_class_init (GkdSecretsSessionClass *klass)
+gkd_secret_session_class_init (GkdSecretSessionClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- gobject_class->constructor = gkd_secrets_session_constructor;
- gobject_class->dispose = gkd_secrets_session_dispose;
- gobject_class->finalize = gkd_secrets_session_finalize;
- gobject_class->set_property = gkd_secrets_session_set_property;
- gobject_class->get_property = gkd_secrets_session_get_property;
+ gobject_class->constructor = gkd_secret_session_constructor;
+ gobject_class->dispose = gkd_secret_session_dispose;
+ gobject_class->finalize = gkd_secret_session_finalize;
+ gobject_class->set_property = gkd_secret_session_set_property;
+ gobject_class->get_property = gkd_secret_session_get_property;
g_object_class_install_property (gobject_class, PROP_CALLER,
g_param_spec_string ("caller", "Caller", "DBus caller name",
@@ -233,7 +233,7 @@ gkd_secrets_session_class_init (GkdSecretsSessionClass *klass)
g_object_class_install_property (gobject_class, PROP_SERVICE,
g_param_spec_object ("service", "Service", "Service which owns this session",
- GKD_SECRETS_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+ GKD_SECRET_TYPE_SERVICE, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
}
/* -----------------------------------------------------------------------------
@@ -241,13 +241,13 @@ gkd_secrets_session_class_init (GkdSecretsSessionClass *klass)
*/
DBusMessage*
-gkd_secrets_session_dispatch (GkdSecretsSession *self, DBusMessage *message)
+gkd_secret_session_dispatch (GkdSecretSession *self, DBusMessage *message)
{
DBusMessage *reply = NULL;
const gchar *caller;
g_return_val_if_fail (message, NULL);
- g_return_val_if_fail (GKD_SECRETS_IS_SESSION (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SESSION (self), NULL);
/* This should already have been caught elsewhere */
caller = dbus_message_get_sender (message);
@@ -259,27 +259,27 @@ gkd_secrets_session_dispatch (GkdSecretsSession *self, DBusMessage *message)
reply = session_property_handler (self, message);
/* org.freedesktop.Secrets.Session.Close() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "Close"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "Close"))
reply = session_method_close (self, message);
/* org.freedesktop.Secrets.Session.Negotiate() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "Negotiate"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "Negotiate"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Session.GetSecret() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "GetSecret"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "GetSecret"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Session.SetSecret() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "SetSecret"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "SetSecret"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Session.GetSecrets() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "GetSecrets"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "GetSecrets"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
/* org.freedesktop.Secrets.Session.GetSecret() */
- else if (dbus_message_is_method_call (message, SECRETS_SERVICE_INTERFACE, "GetSecret"))
+ else if (dbus_message_is_method_call (message, SECRET_SERVICE_INTERFACE, "GetSecret"))
g_return_val_if_reached (NULL); /* TODO: Need to implement */
else if (dbus_message_has_interface (message, DBUS_INTERFACE_INTROSPECTABLE))
@@ -289,22 +289,22 @@ gkd_secrets_session_dispatch (GkdSecretsSession *self, DBusMessage *message)
}
const gchar*
-gkd_secrets_session_get_caller (GkdSecretsSession *self)
+gkd_secret_session_get_caller (GkdSecretSession *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SESSION (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SESSION (self), NULL);
return self->caller;
}
const gchar*
-gkd_secrets_session_get_caller_executable (GkdSecretsSession *self)
+gkd_secret_session_get_caller_executable (GkdSecretSession *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SESSION (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SESSION (self), NULL);
return self->caller_exec;
}
const gchar*
-gkd_secrets_session_get_object_path (GkdSecretsSession *self)
+gkd_secret_session_get_object_path (GkdSecretSession *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_SESSION (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_SESSION (self), NULL);
return self->object_path;
}
diff --git a/daemon/dbus/gkd-secret-session.h b/daemon/dbus/gkd-secret-session.h
new file mode 100644
index 0000000..6c13d76
--- /dev/null
+++ b/daemon/dbus/gkd-secret-session.h
@@ -0,0 +1,53 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2009 Stefan Walter
+ *
+ * This program 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 version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GKD_SECRET_SESSION_H__
+#define __GKD_SECRET_SESSION_H__
+
+#include <glib-object.h>
+
+#include "gkd-secret-types.h"
+
+#define GKD_SECRET_TYPE_SESSION (gkd_secret_session_get_type ())
+#define GKD_SECRET_SESSION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRET_TYPE_SESSION, GkdSecretSession))
+#define GKD_SECRET_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRET_TYPE_SESSION, GkdSecretSessionClass))
+#define GKD_SECRET_IS_SESSION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRET_TYPE_SESSION))
+#define GKD_SECRET_IS_SESSION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRET_TYPE_SESSION))
+#define GKD_SECRET_SESSION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRET_TYPE_SESSION, GkdSecretSessionClass))
+
+typedef struct _GkdSecretSessionClass GkdSecretSessionClass;
+
+struct _GkdSecretSessionClass {
+ GObjectClass parent_class;
+};
+
+GType gkd_secret_session_get_type (void);
+
+DBusMessage* gkd_secret_session_dispatch (GkdSecretSession *self,
+ DBusMessage *message);
+
+const gchar* gkd_secret_session_get_caller (GkdSecretSession *self);
+
+const gchar* gkd_secret_session_get_caller_executable (GkdSecretSession *self);
+
+const gchar* gkd_secret_session_get_object_path (GkdSecretSession *self);
+
+#endif /* __GKD_SECRET_SESSION_H__ */
diff --git a/daemon/dbus/gkd-secret-types.h b/daemon/dbus/gkd-secret-types.h
new file mode 100644
index 0000000..426e31a
--- /dev/null
+++ b/daemon/dbus/gkd-secret-types.h
@@ -0,0 +1,54 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2009 Stefan Walter
+ *
+ * This program 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 version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GKD_SECRET_TYPES_H__
+#define __GKD_SECRET_TYPES_H__
+
+#define BUS_INTERFACE "org.freedesktop.DBus"
+#define PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
+
+#define SECRET_COLLECTION_INTERFACE "org.freedesktop.Secrets.Collection"
+#define SECRET_ITEM_INTERFACE "org.freedesktop.Secrets.Item"
+#define SECRET_PROMPT_INTERFACE "org.freedesktop.Secrets.Prompt"
+#define SECRET_SERVICE_INTERFACE "org.freedesktop.Secrets.Service"
+
+#define SECRET_SERVICE_PATH "/org/freedesktop/secrets"
+#define SECRET_SERVICE "org.freedesktop.secrets"
+
+#define SECRET_INTERFACE_PREFIX "org.freedesktop.Secrets"
+#define SECRET_COLLECTION_PREFIX "/org/freedesktop/secrets/collection"
+#define SECRET_SESSION_PREFIX "/org/freedesktop/secrets/session"
+#define SECRET_PROMPT_PREFIX "/org/freedesktop/secrets/prompt"
+
+#define SECRET_ERROR_ALREADY_EXISTS "org.freedesktop.Secrets.Error.AlreadyExists"
+#define SECRET_ERROR_IS_LOCKED "org.freedesktop.Secrets.Error.IsLocked"
+#define SECRET_ERROR_NOT_SUPPORTED "org.freedesktop.Secrets.Error.NotSupported"
+#define SECRET_ERROR_NO_SESSION "org.freedesktop.Secrets.Error.NoSession"
+
+typedef struct _GkdSecretCollection GkdSecretCollection;
+typedef struct _GkdSecretItem GkdSecretItem;
+typedef struct _GkdSecretObjects GkdSecretObjects;
+typedef struct _GkdSecretPrompt GkdSecretPrompt;
+typedef struct _GkdSecretService GkdSecretService;
+typedef struct _GkdSecretSession GkdSecretSession;
+typedef struct _GkdSecretUnlock GkdSecretUnlock;
+
+#endif /* __GKD_SECRET_TYPES_H__ */
diff --git a/daemon/dbus/gkd-secrets-unlock.c b/daemon/dbus/gkd-secret-unlock.c
similarity index 76%
rename from daemon/dbus/gkd-secrets-unlock.c
rename to daemon/dbus/gkd-secret-unlock.c
index f353285..c416587 100644
--- a/daemon/dbus/gkd-secrets-unlock.c
+++ b/daemon/dbus/gkd-secret-unlock.c
@@ -21,10 +21,10 @@
#include "config.h"
-#include "gkd-secrets-service.h"
-#include "gkd-secrets-prompt.h"
-#include "gkd-secrets-types.h"
-#include "gkd-secrets-unlock.h"
+#include "gkd-secret-service.h"
+#include "gkd-secret-prompt.h"
+#include "gkd-secret-types.h"
+#include "gkd-secret-unlock.h"
#include "egg/egg-secure-memory.h"
@@ -36,21 +36,21 @@
#include <string.h>
-struct _GkdSecretsUnlock {
- GkdSecretsPrompt parent;
+struct _GkdSecretUnlock {
+ GkdSecretPrompt parent;
GQueue *queued;
gchar *current;
GArray *results;
};
-G_DEFINE_TYPE (GkdSecretsUnlock, gkd_secrets_unlock, GKD_SECRETS_TYPE_PROMPT);
+G_DEFINE_TYPE (GkdSecretUnlock, gkd_secret_unlock, GKD_SECRET_TYPE_PROMPT);
/* -----------------------------------------------------------------------------
* INTERNAL
*/
static void
-prepare_unlock_prompt (GkdSecretsUnlock *self, GP11Object *coll)
+prepare_unlock_prompt (GkdSecretUnlock *self, GP11Object *coll)
{
GError *error = NULL;
GkdPrompt *prompt;
@@ -59,7 +59,7 @@ prepare_unlock_prompt (GkdSecretsUnlock *self, GP11Object *coll)
gchar *label;
gchar *text;
- g_assert (GKD_SECRETS_IS_UNLOCK (self));
+ g_assert (GKD_SECRET_IS_UNLOCK (self));
g_assert (coll);
prompt = GKD_PROMPT (self);
@@ -96,14 +96,14 @@ prepare_unlock_prompt (GkdSecretsUnlock *self, GP11Object *coll)
}
static void
-set_warning_wrong (GkdSecretsUnlock *self)
+set_warning_wrong (GkdSecretUnlock *self)
{
- g_assert (GKD_SECRETS_IS_UNLOCK (self));
+ g_assert (GKD_SECRET_IS_UNLOCK (self));
gkd_prompt_set_warning (GKD_PROMPT (self), _("The unlock password was incorrect"));
}
static gboolean
-authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *locked)
+authenticate_collection (GkdSecretUnlock *self, GP11Object *coll, gboolean *locked)
{
GError *error = NULL;
GP11Attributes *attrs;
@@ -112,7 +112,7 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
gchar *password;
gsize n_password;
- g_assert (GKD_SECRETS_IS_UNLOCK (self));
+ g_assert (GKD_SECRET_IS_UNLOCK (self));
g_assert (locked);
g_assert (coll);
@@ -173,16 +173,16 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
*/
static void
-gkd_secrets_unlock_prompt_ready (GkdSecretsPrompt *base)
+gkd_secret_unlock_prompt_ready (GkdSecretPrompt *base)
{
- GkdSecretsUnlock *self = GKD_SECRETS_UNLOCK (base);
+ GkdSecretUnlock *self = GKD_SECRET_UNLOCK (base);
GP11Object *coll;
gboolean locked;
gchar *objpath;
/* Already prompted for an item */
if (self->current) {
- coll = gkd_secrets_prompt_lookup_collection (base, self->current);
+ coll = gkd_secret_prompt_lookup_collection (base, self->current);
/* If the object or collection is gone, no need to unlock */
if (coll == NULL) {
@@ -216,12 +216,12 @@ gkd_secrets_unlock_prompt_ready (GkdSecretsPrompt *base)
/* Nothing more to prompt for? */
if (!objpath) {
- gkd_secrets_prompt_complete (base);
+ gkd_secret_prompt_complete (base);
break;
}
/* Find the collection, make sure it's still around */
- coll = gkd_secrets_prompt_lookup_collection (base, objpath);
+ coll = gkd_secret_prompt_lookup_collection (base, objpath);
if (coll == NULL) {
g_free (objpath);
continue;
@@ -245,9 +245,9 @@ gkd_secrets_unlock_prompt_ready (GkdSecretsPrompt *base)
}
static void
-gkd_secrets_unlock_encode_result (GkdSecretsPrompt *base, DBusMessageIter *iter)
+gkd_secret_unlock_encode_result (GkdSecretPrompt *base, DBusMessageIter *iter)
{
- GkdSecretsUnlock *self = GKD_SECRETS_UNLOCK (base);
+ GkdSecretUnlock *self = GKD_SECRET_UNLOCK (base);
DBusMessageIter variant;
DBusMessageIter array;
const char *value;
@@ -266,16 +266,16 @@ gkd_secrets_unlock_encode_result (GkdSecretsPrompt *base, DBusMessageIter *iter)
}
static void
-gkd_secrets_unlock_init (GkdSecretsUnlock *self)
+gkd_secret_unlock_init (GkdSecretUnlock *self)
{
self->queued = g_queue_new ();
self->results = g_array_new (TRUE, TRUE, sizeof (gchar*));
}
static void
-gkd_secrets_unlock_finalize (GObject *obj)
+gkd_secret_unlock_finalize (GObject *obj)
{
- GkdSecretsUnlock *self = GKD_SECRETS_UNLOCK (obj);
+ GkdSecretUnlock *self = GKD_SECRET_UNLOCK (obj);
if (self->queued) {
while (!g_queue_is_empty (self->queued))
@@ -285,7 +285,7 @@ gkd_secrets_unlock_finalize (GObject *obj)
}
if (self->results) {
- gkd_secrets_unlock_reset_results (self);
+ gkd_secret_unlock_reset_results (self);
g_array_free (self->results, TRUE);
self->results = NULL;
}
@@ -293,41 +293,41 @@ gkd_secrets_unlock_finalize (GObject *obj)
g_free (self->current);
self->current = NULL;
- G_OBJECT_CLASS (gkd_secrets_unlock_parent_class)->finalize (obj);
+ G_OBJECT_CLASS (gkd_secret_unlock_parent_class)->finalize (obj);
}
static void
-gkd_secrets_unlock_class_init (GkdSecretsUnlockClass *klass)
+gkd_secret_unlock_class_init (GkdSecretUnlockClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- GkdSecretsPromptClass *prompt_class = GKD_SECRETS_PROMPT_CLASS (klass);
+ GkdSecretPromptClass *prompt_class = GKD_SECRET_PROMPT_CLASS (klass);
- gobject_class->finalize = gkd_secrets_unlock_finalize;
- prompt_class->prompt_ready = gkd_secrets_unlock_prompt_ready;
- prompt_class->encode_result = gkd_secrets_unlock_encode_result;
+ gobject_class->finalize = gkd_secret_unlock_finalize;
+ prompt_class->prompt_ready = gkd_secret_unlock_prompt_ready;
+ prompt_class->encode_result = gkd_secret_unlock_encode_result;
}
/* -----------------------------------------------------------------------------
* PUBLIC
*/
-GkdSecretsUnlock*
-gkd_secrets_unlock_new (GkdSecretsService *service, const gchar *caller)
+GkdSecretUnlock*
+gkd_secret_unlock_new (GkdSecretService *service, const gchar *caller)
{
- return g_object_new (GKD_SECRETS_TYPE_UNLOCK, "service", service, "caller", caller, NULL);
+ return g_object_new (GKD_SECRET_TYPE_UNLOCK, "service", service, "caller", caller, NULL);
}
void
-gkd_secrets_unlock_queue (GkdSecretsUnlock *self, const gchar *objpath)
+gkd_secret_unlock_queue (GkdSecretUnlock *self, const gchar *objpath)
{
GP11Object *coll;
gboolean locked;
gchar *path;
- g_return_if_fail (GKD_SECRETS_IS_UNLOCK (self));
+ g_return_if_fail (GKD_SECRET_IS_UNLOCK (self));
g_return_if_fail (objpath);
- coll = gkd_secrets_prompt_lookup_collection (GKD_SECRETS_PROMPT (self), objpath);
+ coll = gkd_secret_prompt_lookup_collection (GKD_SECRET_PROMPT (self), objpath);
if (coll == NULL)
return;
@@ -343,27 +343,27 @@ gkd_secrets_unlock_queue (GkdSecretsUnlock *self, const gchar *objpath)
}
gboolean
-gkd_secrets_unlock_have_queued (GkdSecretsUnlock *self)
+gkd_secret_unlock_have_queued (GkdSecretUnlock *self)
{
- g_return_val_if_fail (GKD_SECRETS_IS_UNLOCK (self), FALSE);
+ g_return_val_if_fail (GKD_SECRET_IS_UNLOCK (self), FALSE);
return !g_queue_is_empty (self->queued) || self->current;
}
gchar**
-gkd_secrets_unlock_get_results (GkdSecretsUnlock *self, gint *n_results)
+gkd_secret_unlock_get_results (GkdSecretUnlock *self, gint *n_results)
{
- g_return_val_if_fail (GKD_SECRETS_IS_UNLOCK (self), NULL);
+ g_return_val_if_fail (GKD_SECRET_IS_UNLOCK (self), NULL);
g_return_val_if_fail (n_results, NULL);
*n_results = self->results->len;
return (gchar**)self->results->data;
}
void
-gkd_secrets_unlock_reset_results (GkdSecretsUnlock *self)
+gkd_secret_unlock_reset_results (GkdSecretUnlock *self)
{
gint i;
- g_return_if_fail (GKD_SECRETS_IS_UNLOCK (self));
+ g_return_if_fail (GKD_SECRET_IS_UNLOCK (self));
for (i = 0; i < self->results->len; ++i)
g_free (g_array_index (self->results, gchar*, i));
diff --git a/daemon/dbus/gkd-secret-unlock.h b/daemon/dbus/gkd-secret-unlock.h
new file mode 100644
index 0000000..bb345f6
--- /dev/null
+++ b/daemon/dbus/gkd-secret-unlock.h
@@ -0,0 +1,57 @@
+/*
+ * gnome-keyring
+ *
+ * Copyright (C) 2009 Stefan Walter
+ *
+ * This program 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 version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This program 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 Public
+ * License along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+ * 02111-1307, USA.
+ */
+
+#ifndef __GKD_SECRET_UNLOCK_H__
+#define __GKD_SECRET_UNLOCK_H__
+
+#include <glib-object.h>
+
+#include "gkd-secret-types.h"
+
+#define GKD_SECRET_TYPE_UNLOCK (gkd_secret_unlock_get_type ())
+#define GKD_SECRET_UNLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GKD_SECRET_TYPE_UNLOCK, GkdSecretUnlock))
+#define GKD_SECRET_UNLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GKD_SECRET_TYPE_UNLOCK, GkdSecretUnlockClass))
+#define GKD_SECRET_IS_UNLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GKD_SECRET_TYPE_UNLOCK))
+#define GKD_SECRET_IS_UNLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GKD_SECRET_TYPE_UNLOCK))
+#define GKD_SECRET_UNLOCK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GKD_SECRET_TYPE_UNLOCK, GkdSecretUnlockClass))
+
+typedef struct _GkdSecretUnlockClass GkdSecretUnlockClass;
+
+struct _GkdSecretUnlockClass {
+ GkdSecretPromptClass parent_class;
+};
+
+GType gkd_secret_unlock_get_type (void);
+
+GkdSecretUnlock* gkd_secret_unlock_new (GkdSecretService *service,
+ const gchar *caller);
+
+void gkd_secret_unlock_queue (GkdSecretUnlock *self,
+ const gchar *objpath);
+
+gboolean gkd_secret_unlock_have_queued (GkdSecretUnlock *self);
+
+gchar** gkd_secret_unlock_get_results (GkdSecretUnlock *self,
+ gint *n_results);
+
+void gkd_secret_unlock_reset_results (GkdSecretUnlock *self);
+
+#endif /* __GKD_SECRET_UNLOCK_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]