diff --git a/CASA/gui/CasaMain.cs b/CASA/gui/CasaMain.cs
index 5cf8e440..2fc47a1e 100644
--- a/CASA/gui/CasaMain.cs
+++ b/CASA/gui/CasaMain.cs
@@ -114,29 +114,30 @@ namespace Novell.CASA.GUI
[Glade.Widget]
Gtk.Button okbuttonPersistentStorage,
- buttonChooseDirectory;
-
- [Glade.Widget]
- Gtk.MenuItem mmiNew,
- mmiNewKey,
- mmiImportSecrets,
- mmiExportSecrets,
- mmiView,
- mmiLink,
- mmiCopy,
- mmiDelete,
- mmiRefresh,
- mmiLockSecrets,
- mmiUnlockSecrets,
- mmiDestroySecrets,
- mmiEdit,
- mmiOptions,
- mmiDebug,
- mmiApplicationSSO,
- mmiKonquerer,
- mmiKopete,
- mmiNetworkManager,
- mmiGaim;
+ buttonChooseDirectory;
+
+ [Glade.Widget]
+ Gtk.MenuItem mmiNew,
+ mmiNewKey,
+ mmiImportSecrets,
+ mmiExportSecrets,
+ mmiView,
+ mmiLink,
+ mmiCopy,
+ mmiDelete,
+ mmiRefresh,
+ mmiLockSecrets,
+ mmiUnlockSecrets,
+ mmiDestroySecrets,
+ mmiEdit,
+ mmiOptions,
+ mmiDebug,
+ mmiApplicationSSO,
+ mmiKonquerer,
+ mmiKopete,
+ mmiNetworkManager,
+ mmiGaim,
+ mmiChangeMP;
[Glade.Widget]
Gtk.RadioButton radiobutton1,
@@ -365,7 +366,17 @@ namespace Novell.CASA.GUI
else
(notebookStores.GetNthPage(Common.STORE_GNOMEKEYRING)).Visible = Common.IS_GNOMEKEYRING;
- notebookStores.CurrentPage = Common.STORE_MICASA;
+ notebookStores.CurrentPage = Common.STORE_MICASA;
+
+ if (CommonGUI.UseMasterPassword())
+ {
+ mmiChangeMP.Visible = true;
+ }
+ else
+ {
+ mmiChangeMP.Visible = false;
+ }
+
if (MiCASAStore.IsLocked())
LockGUI();
@@ -439,7 +450,7 @@ namespace Novell.CASA.GUI
// did the daemon get restarted before the user created a master password?
// if so, let's ask the user for their desktop password and set it if there's a cache file
- if (true == DoPersistentFilesExist())
+ if ((false == miCASA.IsSecretPersistent(1,"")) && (true == DoPersistentFilesExist()))
{
Glade.XML gxmlTemp = new Glade.XML(Common.GladeFile, "dialogDesktopPassword", null);
gxmlTemp.Autoconnect(this);
@@ -479,7 +490,7 @@ namespace Novell.CASA.GUI
if (entryDesktopPassword1.Text.Equals(entryDesktopPassword2.Text))
{
- if (miCASA.ValidateDesktopPwd(entryDesktopPassword1.Text))
+ if (miCASA.ValidateDesktopPwd(entryDesktopPassword1.Text + '\0'))
{
// set the desktop password in micasa
try
@@ -498,9 +509,16 @@ namespace Novell.CASA.GUI
}
if (dialogDesktopPassword != null)
- dialogDesktopPassword.Destroy();
-
- MasterPasswordAuthentication();
+ dialogDesktopPassword.Destroy();
+
+ if (CommonGUI.UseMasterPassword())
+ {
+ MasterPasswordAuthentication();
+ }
+ else
+ {
+ InitializeGUI();
+ }
}
else
{
@@ -2213,10 +2231,8 @@ namespace Novell.CASA.GUI
public void on_exportSecrets_activate(object obj, EventArgs args)
{
-
ExportSecrets es = new ExportSecrets(config);
es.Run();
-
}
public void on_importSecrets_activate(object obj, EventArgs args)
diff --git a/CASA/gui/CommonGUI.cs b/CASA/gui/CommonGUI.cs
index 8681279a..3aff1603 100644
--- a/CASA/gui/CommonGUI.cs
+++ b/CASA/gui/CommonGUI.cs
@@ -43,10 +43,13 @@ namespace Novell.CASA.GUI
public static string HINT_DIR = "Export Directory";
public static string HINT_FILENAME = "Export Filename";
- public static string REMEMBER_SETTING = "Remember_Master_Password_Time";
+ public static string REMEMBER_SETTING = "Remember_Master_Password_Time";
+ private static string CASA_REG_KEY = "SOFTWARE\\Novell\\CASA";
[Glade.Widget]
- Gtk.Label label86,
+ Gtk.Label label85,
+ label86,
+ label87,
label88;
[Glade.Widget]
@@ -86,8 +89,21 @@ namespace Novell.CASA.GUI
gxmlTemp.Autoconnect (this);
- dialogLogin.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");;
- label86.Text = "Enter your Master Password to unlock your secrets.";
+ dialogLogin.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");
+ if (CommonGUI.UseMasterPassword())
+ {
+ dialogLogin.Title = "CASA - Master Password";
+ label85.Markup = "Master Password Authentication";
+ label86.Text = "Enter your Master Password to unlock your secrets.";
+ label87.Text = "Master Password:";
+ }
+ else
+ {
+ dialogLogin.Title = "CASA - Desktop Password";
+ label85.Markup = "Password Authentication";
+ label86.Text = "Enter your Desktop Password to unlock your secrets.";
+ label87.Text = "Desktop Password:";
+ }
entryMasterPassword3.Text="";
label88.Hide();
@@ -393,11 +409,36 @@ namespace Novell.CASA.GUI
internal static bool UseMasterPassword()
{
+#if W32
+ return IsRegKeySet(CASA_REG_KEY, "UseMasterPassword");
+#else
return true;
+#endif
}
-#if W32
+#if W32
+
+ private static bool IsRegKeySet(string sPath, string sValue)
+ {
+ Microsoft.Win32.RegistryKey key;
+
+ try
+ {
+ key = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(sPath);
+ int iValue = (int)key.GetValue(sValue);
+ key.Close();
+ if (iValue > 0)
+ {
+ return true;
+ }
+ }
+ catch (Exception e)
+ {
+
+ }
+ return false;
+ }
public static bool IsGTKSharpInstalled()
{
diff --git a/CASA/gui/ExportSecrets.cs b/CASA/gui/ExportSecrets.cs
index 7089606d..5ff66744 100644
--- a/CASA/gui/ExportSecrets.cs
+++ b/CASA/gui/ExportSecrets.cs
@@ -18,7 +18,10 @@ namespace Novell.CASA.GUI
private Config m_config = null;
[Glade.Widget]
- Gtk.Label label86,
+ Gtk.Label labelExportDialogDesc1,
+ labelExportDialogDesc2,
+ labelExportDialogPrompt,
+ label86,
label88;
[Glade.Widget]
@@ -49,13 +52,22 @@ namespace Novell.CASA.GUI
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogExport", null);
#endif
- gxmlTemp.Autoconnect (this);
- dialogExport.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");;
-
+ gxmlTemp.Autoconnect (this);
+
+ if (CommonGUI.UseMasterPassword())
+ {
+ labelExportDialogDesc1.Visible = true;
+ }
+ else
+ {
+ labelExportDialogDesc2.Visible = true;
+ labelExportDialogPrompt.Text = "Encryption string:";
+ }
+ dialogExport.TransientFor = (Gtk.Window)CasaMain.gxmlMain.GetWidget("windowMain");
dialogExport.Destroyed += new EventHandler(dialogExport_Destroyed);
- dialogExport.Modal = true;
- dialogExport.Show();
+ dialogExport.Modal = true;
+ dialogExport.Show();
}
private void dialogExport_Destroyed(object sender, EventArgs e)
{
@@ -77,14 +89,22 @@ namespace Novell.CASA.GUI
}
private void on_buttonOkExportSecrets_clicked(object sender, EventArgs args)
- {
- if( 0 == miCASA.SetMasterPassword(0, entryMasterPassword.Text) )
+ {
+ bool bUseMasterPassword = CommonGUI.UseMasterPassword();
+
+ if ( ((bUseMasterPassword) && (0 == miCASA.SetMasterPassword(0, entryMasterPassword.Text) ))
+ || (!bUseMasterPassword))
{
string sMasterPWD = entryMasterPassword.Text;
string sEncryptString = entryMasterPassword.Text;
if (checkbuttonNoEncrypt.Active)
- sEncryptString = null;
+ sEncryptString = null;
+
+ if (entryMasterPassword.Text.Length < 1)
+ {
+ sEncryptString = null;
+ }
if (dialogExport != null)
{
diff --git a/CASA/gui/images/casa.glade b/CASA/gui/images/casa.glade
index 09476592..b0332efb 100644
--- a/CASA/gui/images/casa.glade
+++ b/CASA/gui/images/casa.glade
@@ -56,7 +56,7 @@
True
-
+
True
gtk-new
1
@@ -78,7 +78,7 @@
-
+
True
gtk-new
1
@@ -99,7 +99,7 @@
-
+
True
gtk-new
1
@@ -125,7 +125,7 @@
-
+
True
gtk-refresh
1
@@ -152,7 +152,7 @@
-
+
True
gtk-dialog-authentication
1
@@ -173,7 +173,7 @@
-
+
True
gtk-open
1
@@ -194,7 +194,7 @@
-
+
True
gtk-delete
1
@@ -221,7 +221,7 @@
-
+
True
gtk-floppy
1
@@ -242,7 +242,7 @@
-
+
True
gtk-open
1
@@ -270,7 +270,7 @@
-
+
True
gtk-quit
1
@@ -306,7 +306,7 @@
-
+
True
gtk-zoom-fit
1
@@ -327,7 +327,7 @@
-
+
True
gtk-jump-to
1
@@ -348,7 +348,7 @@
-
+
True
gtk-copy
1
@@ -376,7 +376,7 @@
-
+
True
gtk-find-and-replace
1
@@ -404,7 +404,7 @@
-
+
True
gtk-delete
1
@@ -438,7 +438,7 @@
True
-
+
True
gtk-execute
1
@@ -460,7 +460,7 @@
-
+
True
gtk-execute
1
@@ -481,7 +481,7 @@
-
+
True
gtk-execute
1
@@ -502,7 +502,7 @@
-
+
True
gtk-execute
1
@@ -523,7 +523,7 @@
-
+
True
gtk-execute
1
@@ -541,14 +541,14 @@
-