diff --git a/CASA.changes b/CASA.changes index 763ff845..1cdd87e8 100644 --- a/CASA.changes +++ b/CASA.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 21 12:05:17 MST 2006 - jnorman@novell.com + +- Bug 148945. Handle the case were micasad is restarted, before + a user sets their master password + ------------------------------------------------------------------- Mon Feb 20 10:40:17 IST 2006 - smanojna@novell.com diff --git a/c_gui/CasaMain.cs b/c_gui/CasaMain.cs index 6d5d417a..8fe07d81 100644 --- a/c_gui/CasaMain.cs +++ b/c_gui/CasaMain.cs @@ -67,6 +67,7 @@ namespace Novell.CASA.GUI dialogAbout, dialogLogin, dialogLoginContinue, + dialogDesktopPassword, dialogConfirmRefresh, dialogSingleInstance, dialogLoginReprompt, @@ -79,6 +80,8 @@ namespace Novell.CASA.GUI entryMasterPassword2, entryMasterPassword3, entryMasterPassword4, + entryDesktopPassword1, + entryDesktopPassword2, entryOldMP, entryNewMP1, entryNewMP2; @@ -93,7 +96,8 @@ namespace Novell.CASA.GUI [Glade.Widget] Gtk.Label label88, labelLoginContinue1, - labelLoginContinue2; + labelLoginContinue2, + labelDesktopPasswordMessage; [Glade.Widget] Gtk.Button okbuttonPersistentStorage; @@ -344,17 +348,94 @@ namespace Novell.CASA.GUI else { Logger.DbgLog("GUI:CasaMain.Login() - IsMasterPasswordSet returned false"); - - Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogLogin", null); - gxmlTemp.Autoconnect(this); - entryMasterPassword3.Text=""; - entryMasterPassword4.Text=""; + + // did the daemon get restarted before the user created a master password? + // if so, let's ask the user for there desktop password and set it if there's a cache file + if (true == DoPersistentFilesExist()) + { + Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogDesktopPassword", null); + gxmlTemp.Autoconnect(this); + + } + else + { + Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogLogin", null); + gxmlTemp.Autoconnect(this); + entryMasterPassword3.Text = ""; + entryMasterPassword4.Text = ""; + } } Logger.DbgLog("GUI:CasaMain.Login() - END"); - } - - + } + + public void on_entryDesktopPassword1_activate(object obj, EventArgs args) + { + on_buttonPasswordOk_clicked(obj, args); + } + + public void on_entryDesktopPassword2_activate(object obj, EventArgs args) + { + on_buttonPasswordOk_clicked(obj, args); + } + + public void on_buttonPasswordOk_clicked(object obj, EventArgs args) + { + object o = obj; + if (entryDesktopPassword1 != null && entryDesktopPassword2.Text != null) + { + + if (entryDesktopPassword1.Text.Length < 1) + { + labelDesktopPasswordMessage.Text = "Please enter your desktop password"; + return; + } + + if (entryDesktopPassword1.Text.Equals(entryDesktopPassword2.Text)) + { + // set the desktop password in micasa + try + { + Novell.CASA.miCASA.SetCredential(0, + "Desktop", + null, + Novell.CASA.miCASA.USERNAME_TYPE_CN_F, + GetLocalUsername(), + entryDesktopPassword1.Text); + } + catch (Exception e) + { + Logger.DbgLog(e.ToString()); + } + + if (dialogDesktopPassword != null) + dialogDesktopPassword.Destroy(); + + MasterPasswordAuthentication(); + + } + else + { + labelDesktopPasswordMessage.Text = "Passwords do not match"; + entryDesktopPassword1.Text = ""; + entryDesktopPassword2.Text = ""; + } + } + } + + public void on_helpbuttonDesktopPassword_clicked(object obj, EventArgs args) + { + Common.ShowHelpUrl("CASADesktopPassword.htm"); + } + + + public void on_buttonPasswordClose_clicked(object obj, EventArgs args) + { + if (dialogDesktopPassword != null) + dialogDesktopPassword.Destroy(); + + closebuttonLogin_clicked(obj, args); + } public void okbuttonLogin_clicked(object abj, EventArgs args) { @@ -444,7 +525,9 @@ namespace Novell.CASA.GUI public void closebuttonLogin_clicked(object abj, EventArgs args) { - dialogLogin.Destroy(); + if (dialogLogin != null) + dialogLogin.Destroy(); + // close tray too if (mCasaTray != null) { @@ -494,7 +577,39 @@ namespace Novell.CASA.GUI Logger.DbgLog("GUI:CasaMain.IsMasterPasswordSet() - END"); return (File.Exists(fileName)); - } + } + + public bool DoPersistentFilesExist() + { + Logger.DbgLog("GUI:CasaMain.DoesPersistentFilesExist() - BEGIN"); + + // is the desktop password set already? + try + { + BasicCredential bc = Novell.CASA.miCASA.GetCredential(0, + "Desktop", + null, + Novell.CASA.miCASA.USERNAME_TYPE_CN_F); + return false; + } + catch + { + // check for existence of persistent files + string MICASA_PASSCODE_BY_DESKTOP_FILE = "/.miCASAPCByDesktop"; + string MICASA_KEY_FILE = "/.miCASAKey"; + string MICASA_PERSISTENCE_FILE = "/.miCASA"; + string MICASA_VALIDATION_FILE = "/.miCASAValidate"; + + string sHomeDir = GetUserHomeDir(); + + Logger.DbgLog("GUI:CasaMain.DoesPersistentFilesExist() - END"); + return (File.Exists(sHomeDir + MICASA_PERSISTENCE_FILE) + && File.Exists(sHomeDir + MICASA_KEY_FILE) + && File.Exists(sHomeDir + MICASA_PASSCODE_BY_DESKTOP_FILE) + && File.Exists(sHomeDir + MICASA_VALIDATION_FILE)); + } + } + private string GetUserHomeDir() { @@ -503,7 +618,13 @@ namespace Novell.CASA.GUI else return Environment.GetEnvironmentVariable("USERPROFILE"); - } + } + + private string GetLocalUsername() + { + return Environment.GetEnvironmentVariable("USERNAME"); + } + ///####################################################################### /// LOGIN WARNING DIALOG diff --git a/c_gui/help/en/CASADesktopPassword.htm b/c_gui/help/en/CASADesktopPassword.htm new file mode 100644 index 00000000..c8c367d4 --- /dev/null +++ b/c_gui/help/en/CASADesktopPassword.htm @@ -0,0 +1,45 @@ + + + + +Novell® CASA Manager + + + + + + +
+
+
+ + + +
Entering your workstation password
+ + +

You are prompted for your workstation password if the CASA + service is restarted and before you have set your master password.

+ +

Your desktop password and master password are used to encypt your secrets + and store them on your computer. When you login to the computer, CASA will decrypt + the saved secrets using your desktop password and make them available for + applications integrated with CASA. + If your desktop password changes, you must run CASA Manager and enter your master + password before CASA can decrypt your saved secrets.

+ + +

Important: To prevent unauthorized access to your credential stores, + always create confidential passwords that are not easily discovered.

+ + +
+
+ + \ No newline at end of file diff --git a/c_gui/images/casa.glade b/c_gui/images/casa.glade index dd35911f..5133aa6e 100644 --- a/c_gui/images/casa.glade +++ b/c_gui/images/casa.glade @@ -8244,4 +8244,353 @@ prompted for the Master Password at startup. + + True + Enter Workstation Password + GTK_WINDOW_TOPLEVEL + GTK_WIN_POS_CENTER_ALWAYS + True + False + True + CASAicons.ico + True + False + False + GDK_WINDOW_TYPE_HINT_DIALOG + GDK_GRAVITY_NORTH_WEST + True + + + + True + False + 0 + + + + True + GTK_BUTTONBOX_END + + + + True + True + True + gtk-help + True + GTK_RELIEF_NONE + True + -11 + + + + + + + True + True + True + gtk-close + True + GTK_RELIEF_NORMAL + True + -7 + + + + + + + True + True + True + gtk-ok + True + GTK_RELIEF_NORMAL + True + -5 + + + + + + 0 + False + True + GTK_PACK_END + + + + + + True + False + 0 + + + + True + False + 0 + + + + True + False + 0 + + + + True + gtk-dialog-question + 6 + 0.5 + 0.5 + 0 + 0 + + + 6 + False + True + + + + + 4 + True + True + + + + + + True + False + 0 + + + + True + <b>Enter Workstation Password</b> + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 5 + False + False + + + + + + True + CASA encypts your credentials +and writes them in your home directory. +To retrieve them, please enter your +workstation password. + + False + False + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + + + 4 + False + False + + + + + 0 + True + True + + + + + 0 + True + True + + + + + + True + + True + True + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + 6 + True + 0 + 0.5 + GTK_SHADOW_IN + + + + True + 0.5 + 0.5 + 1 + 1 + 0 + 0 + 12 + 0 + + + + 6 + True + 2 + 2 + False + 6 + 6 + + + + True + Workstation Password : + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + + + 0 + 1 + 0 + 1 + fill + + + + + + + True + Re-enter Password : + False + False + GTK_JUSTIFY_LEFT + False + False + 1 + 0.5 + 0 + 0 + + + 0 + 1 + 1 + 2 + fill + + + + + + + True + True + True + False + 0 + + True + * + False + + + + 1 + 2 + 0 + 1 + + + + + + + True + True + True + False + 0 + + True + * + False + + + + 1 + 2 + 1 + 2 + + + + + + + + + + 0 + True + True + + + + + 0 + True + True + + + + + +