[gnome-keyring] [wrap-layer] Fix saving of auto-unlock passwords.



commit eec3d69e22dedfcb5e19cdc9ecf377f91279dd22
Author: Stef Walter <stef memberwebs com>
Date:   Sun Sep 5 02:53:41 2010 +0000

    [wrap-layer] Fix saving of auto-unlock passwords.
    
    Fix saving of auto unlock passwords such as the ones in SSH
    prompts.

 pkcs11/wrap-layer/gkm-wrap-login.c  |    2 +-
 pkcs11/wrap-layer/gkm-wrap-prompt.c |    6 +++++-
 2 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/pkcs11/wrap-layer/gkm-wrap-login.c b/pkcs11/wrap-layer/gkm-wrap-login.c
index 88c4c48..7bef442 100644
--- a/pkcs11/wrap-layer/gkm-wrap-login.c
+++ b/pkcs11/wrap-layer/gkm-wrap-login.c
@@ -131,7 +131,7 @@ prepare_module_session_and_collection (CK_FUNCTION_LIST_PTR_PTR module,
 
 	for (i = 0; !ret && i < n_slots; ++i) {
 		/* Open a session with this module */
-		rv = (funcs->C_OpenSession) (slots[i], CKF_SERIAL_SESSION, NULL, NULL, session);
+		rv = (funcs->C_OpenSession) (slots[i], CKF_RW_SESSION | CKF_SERIAL_SESSION, NULL, NULL, session);
 		if (rv != CKR_OK)
 			continue;
 
diff --git a/pkcs11/wrap-layer/gkm-wrap-prompt.c b/pkcs11/wrap-layer/gkm-wrap-prompt.c
index b1c203f..5c858c5 100644
--- a/pkcs11/wrap-layer/gkm-wrap-prompt.c
+++ b/pkcs11/wrap-layer/gkm-wrap-prompt.c
@@ -725,7 +725,11 @@ prepare_unlock_object (GkmWrapPrompt *self, const gchar *label, CK_OBJECT_CLASS
 	gku_prompt_show_widget (prompt, "password_area");
 	gku_prompt_show_widget (prompt, "lock_area");
 	gku_prompt_show_widget (prompt, "options_area");
-	gku_prompt_hide_widget (prompt, "auto_unlock_check");
+
+	if (gkm_wrap_login_is_usable ())
+		gku_prompt_show_widget (prompt, "auto_unlock_check");
+	else
+		gku_prompt_hide_widget (prompt, "auto_unlock_check");
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]