33
33
/* TODO: canhas async? */
35
#include <gnome-keyring.h>
35
#include <secret/secret.h>
38
38
vino_keyring_get_password (void)
40
GnomeKeyringNetworkPasswordData *found_item;
41
GnomeKeyringResult result;
47
result = gnome_keyring_find_network_password_sync (
50
"vino.local", /* server */
53
"vnc-password", /* authtype */
57
if (result != GNOME_KEYRING_RESULT_OK || matches == NULL || matches->data == NULL)
60
found_item = (GnomeKeyringNetworkPasswordData *) matches->data;
62
password = g_strdup (found_item->password);
64
gnome_keyring_network_password_list_free (matches);
40
return secret_password_lookup (SECRET_SCHEMA_COMPAT_NETWORK,
42
"server", "vino.local",
44
"authtype", "vnc-password",
70
50
vino_keyring_set_password (const char *password)
72
GnomeKeyringResult result;
75
result = gnome_keyring_set_network_password_sync (
76
NULL, /* default keyring */
79
"vino.local", /* server */
82
"vnc-password", /* authtype */
84
password, /* password */
87
return result == GNOME_KEYRING_RESULT_OK;
52
return secret_password_store_sync (SECRET_SCHEMA_COMPAT_NETWORK,
53
SECRET_COLLECTION_DEFAULT,
54
_("Remote desktop sharing password"),
56
"server", "vino.local",
58
"authtype", "vnc-password",