diff options
author | Stef Walter <stefw@gnome.org> | 2012-11-09 12:13:04 +0100 |
---|---|---|
committer | Stef Walter <stefw@gnome.org> | 2012-11-09 12:15:34 +0100 |
commit | ac2df1e5a7862fa9a9b838406472e2c75b8575b3 (patch) | |
tree | fd2c434e05a04595806800812f36f93ffda20a6c /daemon | |
parent | 370694b36f1ed6f26554ccc740da3b3e92aafded (diff) |
dbus: Handle empty secrets correctly
* Don't assume an error occurred when retrieving an empty
secret from the store.
https://bugzilla.gnome.org/show_bug.cgi?id=687979
Diffstat (limited to 'daemon')
-rw-r--r-- | daemon/dbus/gkd-secret-session.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/daemon/dbus/gkd-secret-session.c b/daemon/dbus/gkd-secret-session.c index 2b2e480b..91a041f8 100644 --- a/daemon/dbus/gkd-secret-session.c +++ b/daemon/dbus/gkd-secret-session.c @@ -605,7 +605,7 @@ gkd_secret_session_get_item_secret (GkdSecretSession *self, GckObject *item, g_assert (GCK_IS_OBJECT (self->key)); session = gck_object_get_session (item); - g_return_val_if_fail (session, FALSE); + g_return_val_if_fail (session, NULL); if (self->mech_type == CKM_AES_CBC_PAD) { n_iv = 16; @@ -623,7 +623,7 @@ gkd_secret_session_get_item_secret (GkdSecretSession *self, GckObject *item, value = gck_session_wrap_key_full (session, self->key, &mech, item, &n_value, NULL, &error); - if (value == NULL) { + if (error != NULL) { if (g_error_matches (error, GCK_ERROR, CKR_USER_NOT_LOGGED_IN)) { dbus_set_error_const (derr, SECRET_ERROR_IS_LOCKED, "Cannot get secret of a locked object"); |