diff --git a/libedataserverui/e-passwords.c b/libedataserverui/e-passwords.c
index 5133b19..e7bf8f6 100644
--- a/libedataserverui/e-passwords.c
+++ b/libedataserverui/e-passwords.c
@@ -298,6 +298,112 @@ ep_keyring_validate (const gchar *user,
 	return TRUE;
 }
 
+static void
+ep_keyring_waitdone (gboolean *is_done, GMainLoop **loop)
+{
+	g_return_if_fail (is_done != NULL);
+	g_return_if_fail (loop != NULL);
+
+	if (*is_done)
+		return;
+
+	*loop = g_main_loop_new (NULL, FALSE);
+	g_main_loop_run (*loop);
+
+	g_main_loop_unref (*loop);
+	*loop = NULL;
+}
+
+static void
+ep_keyring_finish_op (gboolean *is_done, GMainLoop *loop)
+{
+	g_return_if_fail (is_done != NULL);
+
+	*is_done = TRUE;
+	if (loop && g_main_loop_is_running (loop))
+		g_main_loop_quit (loop);
+}
+
+struct op_done_data {
+	gboolean is_done;
+	GMainLoop *loop;
+
+	GnomeKeyringResult result;
+};
+
+static void
+ep_keyring_op_done_cb (GnomeKeyringResult result, gpointer data)
+{
+	struct op_done_data *odd = data;
+
+	g_return_if_fail (odd != NULL);
+
+	odd->result = result;
+
+	ep_keyring_finish_op (&odd->is_done, odd->loop);
+}
+
+struct op_get_int_data {
+	gboolean is_done;
+	GMainLoop *loop;
+
+	GnomeKeyringResult result;
+	guint32 ret_int;
+};
+
+static void
+ep_keyring_get_int_cb (GnomeKeyringResult result, guint32 val, gpointer data)
+{
+	struct op_get_int_data *ogid = data;
+
+	g_return_if_fail (ogid != NULL);
+
+	ogid->result = result;
+	ogid->ret_int = val;
+
+	ep_keyring_finish_op (&ogid->is_done, ogid->loop);
+}
+
+struct op_find_items_data
+{
+	gboolean is_done;
+	GMainLoop *loop;
+
+	GnomeKeyringResult result;
+	GList *passwords;
+};
+
+static void
+copy_passwords_cb (gpointer value, gpointer data)
+{
+	GList **dest = data;
+	GnomeKeyringFound *found = value, *copy;
+
+	g_return_if_fail (dest != NULL);
+	g_return_if_fail (found != NULL);
+
+	copy = g_new0 (GnomeKeyringFound, 1);
+	copy->keyring = g_strdup (found->keyring);
+	copy->item_id = found->item_id;
+	copy->attributes = gnome_keyring_attribute_list_copy (found->attributes);
+	copy->secret = g_strdup (found->secret);
+
+	*dest = g_list_append (*dest, copy);
+}
+
+static void
+ep_keyring_find_items_cb (GnomeKeyringResult result, GList *list, gpointer data)
+{
+	struct op_find_items_data *ofid = data;
+
+	g_return_if_fail (ofid != NULL);
+
+	ofid->result = result;
+	g_list_foreach (list, copy_passwords_cb, &ofid->passwords);
+
+	ep_keyring_finish_op (&ofid->is_done, ofid->loop);
+}
+
 static gboolean
 ep_keyring_delete_passwords (const gchar *user,
                              const gchar *server,
@@ -307,7 +413,7 @@ ep_keyring_delete_passwords (const gchar *user,
 {
 	while (passwords != NULL) {
 		GnomeKeyringFound *found = passwords->data;
-		GnomeKeyringResult result;
+		struct op_done_data odd;
 
 		/* Validate the item before deleting it. */
 		if (!ep_keyring_validate (user, server, protocol, found->attributes)) {
@@ -320,13 +426,20 @@ ep_keyring_delete_passwords (const gchar *user,
 			}
 		}
 
-		result = gnome_keyring_item_delete_sync (NULL, found->item_id);
-		if (result != GNOME_KEYRING_RESULT_OK) {
+		odd.is_done = FALSE;
+		odd.loop = NULL;
+		odd.result = GNOME_KEYRING_RESULT_BAD_ARGUMENTS;
+
+		if (gnome_keyring_item_delete (NULL, found->item_id, ep_keyring_op_done_cb, &odd, NULL)) {
+			ep_keyring_waitdone (&odd.is_done, &odd.loop);
+		}
+
+		if (odd.result != GNOME_KEYRING_RESULT_OK) {
 			g_set_error (
-				error, EP_KEYRING_ERROR, result,
+				error, EP_KEYRING_ERROR, odd.result,
 				"Unable to delete password in "
 				"keyring (Keyring reports: %s)",
-				gnome_keyring_result_to_message (result));
+				gnome_keyring_result_to_message (odd.result));
 			return FALSE;
 		}
 
@@ -345,8 +458,7 @@ ep_keyring_insert_password (const gchar *user,
                             GError **error)
 {
 	GnomeKeyringAttributeList *attributes;
-	GnomeKeyringResult result;
-	guint32 item_id;
+	struct op_get_int_data ogid;
 
 	g_return_val_if_fail (user != NULL, FALSE);
 	g_return_val_if_fail (server != NULL, FALSE);
@@ -364,22 +476,31 @@ ep_keyring_insert_password (const gchar *user,
 	gnome_keyring_attribute_list_append_string (
 		attributes, "protocol", protocol);
 
+	ogid.is_done = FALSE;
+	ogid.loop = NULL;
+	ogid.result = GNOME_KEYRING_RESULT_BAD_ARGUMENTS;
+	ogid.ret_int = 0;
+
 	/* XXX We don't use item_id but gnome-keyring doesn't allow
 	 *     for a NULL pointer.  In fact it doesn't even check! */
-	result = gnome_keyring_item_create_sync (
+	if (gnome_keyring_item_create (
 		NULL, GNOME_KEYRING_ITEM_NETWORK_PASSWORD,
-		display_name, attributes, password, TRUE, &item_id);
-	if (result != GNOME_KEYRING_RESULT_OK) {
+		display_name, attributes, password, TRUE,
+		ep_keyring_get_int_cb, &ogid, NULL)) {
+		ep_keyring_waitdone (&ogid.is_done, &ogid.loop);
+	}
+
+	if (ogid.result != GNOME_KEYRING_RESULT_OK) {
 		g_set_error (
-			error, EP_KEYRING_ERROR, result,
+			error, EP_KEYRING_ERROR, ogid.result,
 			"Unable to create password in "
 			"keyring (Keyring reports: %s)",
-			gnome_keyring_result_to_message (result));
+			gnome_keyring_result_to_message (ogid.result));
 	}
 
 	gnome_keyring_attribute_list_free (attributes);
 
-	return (result == GNOME_KEYRING_RESULT_OK);
+	return (ogid.result == GNOME_KEYRING_RESULT_OK);
 }
 
 static GList *
@@ -389,8 +510,7 @@ ep_keyring_lookup_passwords (const gchar *user,
                              GError **error)
 {
 	GnomeKeyringAttributeList *attributes;
-	GnomeKeyringResult result;
-	GList *passwords = NULL;
+	struct op_find_items_data ofid;
 
 	attributes = gnome_keyring_attribute_list_new ();
 	gnome_keyring_attribute_list_append_string (
@@ -405,19 +525,28 @@ ep_keyring_lookup_passwords (const gchar *user,
 		gnome_keyring_attribute_list_append_string (
 			attributes, "protocol", protocol);
 
-	result = gnome_keyring_find_items_sync (
-		GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes, &passwords);
-	if (result != GNOME_KEYRING_RESULT_OK) {
+	ofid.is_done = FALSE;
+	ofid.loop = NULL;
+	ofid.result = GNOME_KEYRING_RESULT_BAD_ARGUMENTS;
+	ofid.passwords = NULL;
+
+	if (gnome_keyring_find_items (
+		GNOME_KEYRING_ITEM_NETWORK_PASSWORD, attributes,
+		ep_keyring_find_items_cb, &ofid, NULL)) {
+		ep_keyring_waitdone (&ofid.is_done, &ofid.loop);
+	}
+
+	if (ofid.result != GNOME_KEYRING_RESULT_OK) {
 		g_set_error (
-			error, EP_KEYRING_ERROR, result,
+			error, EP_KEYRING_ERROR, ofid.result,
 			"Unable to find password(s) in "
 			"keyring (Keyring reports: %s)",
-			gnome_keyring_result_to_message (result));
+			gnome_keyring_result_to_message (ofid.result));
 	}
 
 	gnome_keyring_attribute_list_free (attributes);
 
-	return passwords;
+	return ofid.passwords;
 }
 #endif
 
