- Added Firefox MasterPassword prompt into CASAManager.

CASAManager will now prompt for master password during aggregating
  the Firefox password manager if it is locked with a master password.
This commit is contained in:
smanojna 2006-03-08 10:58:28 +00:00
parent 45aec8c6de
commit 765907a49f
5 changed files with 394 additions and 26 deletions

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Mar 8 16:27:33 IST 2006 - smanojna@novell.com
- Added Firefox MasterPassword prompt into CASAManager.
CASAManager will now prompt for master password during aggregating
the Firefox password manager if it is locked with a master password.
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Mar 7 23:02:38 IST 2006 - lsreevatsa@novell.com Tue Mar 7 23:02:38 IST 2006 - lsreevatsa@novell.com

View File

@ -77,7 +77,8 @@ namespace Novell.CASA.GUI
dialogLoginReprompt, dialogLoginReprompt,
dialogShortPassword, dialogShortPassword,
dialogResetMP, dialogResetMP,
dialogStillRunning; dialogStillRunning,
dialogFirefoxMP;
[Glade.Widget] [Glade.Widget]
Gtk.Entry entryMasterPassword1, Gtk.Entry entryMasterPassword1,
@ -88,7 +89,8 @@ namespace Novell.CASA.GUI
entryDesktopPassword2, entryDesktopPassword2,
entryOldMP, entryOldMP,
entryNewMP1, entryNewMP1,
entryNewMP2; entryNewMP2,
entryFirefoxMP;
[Glade.Widget] [Glade.Widget]
Gtk.CheckButton checkbuttonFirefox, Gtk.CheckButton checkbuttonFirefox,
@ -660,8 +662,13 @@ namespace Novell.CASA.GUI
case Common.STORE_FIREFOX: case Common.STORE_FIREFOX:
if( false == objFirefox.IS_STORE_AGGREGATED ) if( false == objFirefox.IS_STORE_AGGREGATED )
{ {
objFirefox.AggregateStore(); if( StoreDataInterface.IsMasterPasswordSet(Common.STORE_FIREFOX) )
objFirefox.IS_STORE_AGGREGATED = true; {
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogFirefoxMP", null);
gxmlTemp.Autoconnect (this);
dialogFirefoxMP.SetPosition(Gtk.WindowPosition.CenterOnParent);
dialogFirefoxMP.TransientFor = windowMain;
}
} }
break; break;
@ -686,7 +693,31 @@ namespace Novell.CASA.GUI
} }
} }
public void on_buttonFirefoxMPok_clicked(object obj, EventArgs args)
{
if( "" != entryFirefoxMP.Text )
if( StoreDataInterface.VerifyMasterPassword(entryFirefoxMP.Text, Common.STORE_FIREFOX) )
{
dialogFirefoxMP.Destroy();
objFirefox.AggregateStore();
objFirefox.IS_STORE_AGGREGATED = true;
}
else
{
entryFirefoxMP.Text = "";
entryFirefoxMP.HasFocus();
}
}
public void on_buttonFirefoxMPclose_clicked(object obj, EventArgs args)
{
dialogFirefoxMP.Destroy();
}
public void on_buttonFirefoxMPhelp_clicked(object obj, EventArgs args)
{
}
/// <summary> /// <summary>
/// ******************************************************************** /// ********************************************************************
@ -919,7 +950,20 @@ namespace Novell.CASA.GUI
objMiCasa.AggregateStore(); objMiCasa.AggregateStore();
if( Common.IS_FIREFOX ) if( Common.IS_FIREFOX )
objFirefox.AggregateStore(); {
if( false == objFirefox.IS_STORE_AGGREGATED )
{
if( StoreDataInterface.IsMasterPasswordSet(Common.STORE_FIREFOX) )
{
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogFirefoxMP", null);
gxmlTemp.Autoconnect (this);
dialogFirefoxMP.SetPosition(Gtk.WindowPosition.CenterOnParent);
dialogFirefoxMP.TransientFor = windowMain;
}
}
else
objFirefox.AggregateStore();
}
if( Common.IS_MOZILLA ) if( Common.IS_MOZILLA )
objMozilla.AggregateStore(); objMozilla.AggregateStore();
@ -1430,14 +1474,24 @@ namespace Novell.CASA.GUI
if(Common.IS_FIREFOX) if(Common.IS_FIREFOX)
{ {
if( null == objFirefox ) if( null == objFirefox )
{
/*if( StoreDataInterface.IsMasterPasswordSet(Common.STORE_FIREFOX) )
{
Glade.XML gxmlTemp = new Glade.XML (Common.GladeFile, "dialogPreferences", null);
gxmlTemp.Autoconnect (this);
dialogFirefoxMP.SetPosition(Gtk.WindowPosition.CenterOnParent);
dialogFirefoxMP.TransientFor = windowMain;
}*/
objFirefox = new Firefox(); objFirefox = new Firefox();
objFirefox.AggregateStore(); }
//objFirefox.AggregateStore();
notebookStores.GetNthPage(Common.STORE_FIREFOX).Visible = true; notebookStores.GetNthPage(Common.STORE_FIREFOX).Visible = true;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_FIREFOX, true, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_FIREFOX, true, storeID, 1);
} }
else else
{ {
objFirefox = null; //objFirefox = null;
notebookStores.GetNthPage(Common.STORE_FIREFOX).Visible = false; notebookStores.GetNthPage(Common.STORE_FIREFOX).Visible = false;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_FIREFOX, false, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_FIREFOX, false, storeID, 1);
} }
@ -1447,13 +1501,13 @@ namespace Novell.CASA.GUI
{ {
if( null == objMozilla ) if( null == objMozilla )
objMozilla = new Mozilla(); objMozilla = new Mozilla();
objMozilla.AggregateStore(); //objMozilla.AggregateStore();
notebookStores.GetNthPage(Common.STORE_MOZILLA).Visible = true; notebookStores.GetNthPage(Common.STORE_MOZILLA).Visible = true;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_MOZILLA, true, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_MOZILLA, true, storeID, 1);
} }
else else
{ {
objMozilla = null; //objMozilla = null;
notebookStores.GetNthPage(Common.STORE_MOZILLA).Visible = false; notebookStores.GetNthPage(Common.STORE_MOZILLA).Visible = false;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_MOZILLA, false, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_MOZILLA, false, storeID, 1);
} }
@ -1463,13 +1517,13 @@ namespace Novell.CASA.GUI
{ {
if( null == objKdeWallet ) if( null == objKdeWallet )
objKdeWallet = new KdeWallet(); objKdeWallet = new KdeWallet();
objKdeWallet.AggregateStore(); //objKdeWallet.AggregateStore();
notebookStores.GetNthPage(Common.STORE_KDEWALLET).Visible = true; notebookStores.GetNthPage(Common.STORE_KDEWALLET).Visible = true;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_KDEWALLET, true, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_KDEWALLET, true, storeID, 1);
} }
else else
{ {
objKdeWallet = null; //objKdeWallet = null;
notebookStores.GetNthPage(Common.STORE_KDEWALLET).Visible = false; notebookStores.GetNthPage(Common.STORE_KDEWALLET).Visible = false;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_KDEWALLET, false, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_KDEWALLET, false, storeID, 1);
} }
@ -1479,13 +1533,13 @@ namespace Novell.CASA.GUI
{ {
if( null == objGnomeKeyring ) if( null == objGnomeKeyring )
objGnomeKeyring = new GnomeKeyring(); objGnomeKeyring = new GnomeKeyring();
objGnomeKeyring.AggregateStore(); //objGnomeKeyring.AggregateStore();
notebookStores.GetNthPage(Common.STORE_GNOMEKEYRING).Visible = true; notebookStores.GetNthPage(Common.STORE_GNOMEKEYRING).Visible = true;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_GNOMEKEYRING, true, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_GNOMEKEYRING, true, storeID, 1);
} }
else else
{ {
objGnomeKeyring = null; //objGnomeKeyring = null;
notebookStores.GetNthPage(Common.STORE_GNOMEKEYRING).Visible = false; notebookStores.GetNthPage(Common.STORE_GNOMEKEYRING).Visible = false;
StorePolicyInterface.SetAggregationPolicy(Common.STORE_GNOMEKEYRING, false, storeID, 1); StorePolicyInterface.SetAggregationPolicy(Common.STORE_GNOMEKEYRING, false, storeID, 1);
} }

View File

@ -249,7 +249,6 @@ public class Firefox : Store
{ {
if( (null != keys[i]) && (null != values[i]) ) if( (null != keys[i]) && (null != values[i]) )
tsKeyValue.AppendValues(keys[i], values[i], "********", false, "No"); tsKeyValue.AppendValues(keys[i], values[i], "********", false, "No");
//Console.WriteLine("Keys="+keys[i]+" , "+"Values="+values[i]);
} }
tvKeyValue.Model = tsKeyValue; tvKeyValue.Model = tsKeyValue;
//entryKey.HasFocus = true; //entryKey.HasFocus = true;

View File

@ -39,15 +39,15 @@ namespace Novell.CASA.GUI {
private static XmlDocument ccfDoc; private static XmlDocument ccfDoc;
private static AD ad; private static AD ad;
private const string CCFXML_ELEMENT_MICASA_KEYCHAIN = "Keychain", private const string CCFXML_ELEMENT_MICASA_KEYCHAIN = "Keychain",
CCFXML_ELEMENT_GKEYRING_KEYRING = "Keyring", CCFXML_ELEMENT_GKEYRING_KEYRING = "Keyring",
CCFXML_ELEMENT_KWALLET_WALLET = "Wallet", CCFXML_ELEMENT_KWALLET_WALLET = "Wallet",
CCFXML_ELEMENT_FIREFOX_PROFILE = "Profile", CCFXML_ELEMENT_FIREFOX_PROFILE = "Profile",
CCFXML_ELEMENT_SECRET = "Secret", CCFXML_ELEMENT_SECRET = "Secret",
CCFXML_ELEMENT_FOLDER = "Folder", CCFXML_ELEMENT_FOLDER = "Folder",
CCFXML_ATTRIBUTE_FOLDERNAME = "Name", CCFXML_ATTRIBUTE_FOLDERNAME = "Name",
CCFXML_ELEMENT_TYPE = "Type", CCFXML_ELEMENT_TYPE = "Type",
CCFXML_ELEMENT_KEY = "Key", CCFXML_ELEMENT_KEY = "Key",
CCFXML_ELEMENT_VALUE = "Value", CCFXML_ELEMENT_VALUE = "Value",
CCFXML_ELEMENT_TIME = "Time", CCFXML_ELEMENT_TIME = "Time",
CCFXML_ELEMENT_TIME_ZONE = "Zone", CCFXML_ELEMENT_TIME_ZONE = "Zone",
@ -56,8 +56,8 @@ namespace Novell.CASA.GUI {
CCFXML_ELEMENT_TIME_ACCESSED = "Accessed", CCFXML_ELEMENT_TIME_ACCESSED = "Accessed",
CCFXML_ATTRIBUTE_ID = "ID", CCFXML_ATTRIBUTE_ID = "ID",
CCFXML_ATTRIBUTE_MICASA_SYNCH = "Synch", CCFXML_ATTRIBUTE_MICASA_SYNCH = "Synch",
CCFXML_ATTRIBUTE_GKEYRING_TYPE = "Type", CCFXML_ATTRIBUTE_GKEYRING_TYPE = "Type",
CCFXML_ATTRIBUTE_WALLETLASTACCESSEDTIME="LastAcctime"; CCFXML_ATTRIBUTE_WALLETLASTACCESSEDTIME = "LastAcctime";
@ -139,10 +139,24 @@ namespace Novell.CASA.GUI {
} }
///#######################################################################
/// MASTER PASSWORD
/// <summary>
///
/// </summary>
public static bool IsMasterPasswordSet(int StoreID)
{
return( ad.IsMasterPasswordSet(StoreID) );
}
public static bool VerifyMasterPassword(string masterPassword, int StoreID)
{
return( ad.VerifyMasterPassword(masterPassword, StoreID) );
}
///####################################################################### ///#######################################################################
/// READ STORE /// READ STORE
/// <summary> /// <summary>
/// Gets the GUI Data store /// Gets the GUI Data store
/// </summary> /// </summary>

View File

@ -10683,4 +10683,298 @@ Value:</property>
</child> </child>
</widget> </widget>
<widget class="GtkDialog" id="dialogFirefoxMP">
<property name="visible">True</property>
<property name="title" translatable="yes">Firefox - Master Password</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_CENTER_ALWAYS</property>
<property name="modal">True</property>
<property name="resizable">False</property>
<property name="destroy_with_parent">True</property>
<property name="icon">CASAicons.ico</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">True</property>
<signal name="delete_event" handler="OnDialogLoginDeleted" last_modification_time="Tue, 06 Sep 2005 13:51:23 GMT"/>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox136">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child internal-child="action_area">
<widget class="GtkHButtonBox" id="hbuttonbox20">
<property name="visible">True</property>
<property name="layout_style">GTK_BUTTONBOX_END</property>
<child>
<widget class="GtkButton" id="buttonFirefoxMPhelp">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NONE</property>
<property name="focus_on_click">True</property>
<property name="response_id">-11</property>
<signal name="clicked" handler="on_buttonFirefoxMPhelp_clicked" last_modification_time="Wed, 08 Mar 2006 10:36:57 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="buttonFirefoxMPclose">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-7</property>
<signal name="clicked" handler="on_buttonFirefoxMPclose_clicked" last_modification_time="Wed, 08 Mar 2006 10:36:10 GMT"/>
</widget>
</child>
<child>
<widget class="GtkButton" id="buttonFirefoxMPok">
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="on_buttonFirefoxMPok_clicked" last_modification_time="Wed, 08 Mar 2006 10:36:19 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">GTK_PACK_END</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox137">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHBox" id="hbox78">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox138">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkImage" id="image3756">
<property name="visible">True</property>
<property name="stock">gtk-dialog-authentication</property>
<property name="icon_size">6</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">6</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">4</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkVBox" id="vbox139">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label249">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Firefox Master Password authentication&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">5</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label250">
<property name="visible">True</property>
<property name="label" translatable="yes">The Firefox password manager is locked with
a master password. Please enter the master
password to view the secrets.</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">True</property>
<property name="selectable">False</property>
<property name="xalign">0</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="padding">4</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkFrame" id="frame28">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkAlignment" id="alignment41">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkTable" id="table30">
<property name="border_width">6</property>
<property name="visible">True</property>
<property name="n_rows">1</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
<child>
<widget class="GtkLabel" id="label251">
<property name="visible">True</property>
<property name="label" translatable="yes">Master Password :</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">1</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
<property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
<property name="width_chars">-1</property>
<property name="single_line_mode">False</property>
<property name="angle">0</property>
</widget>
<packing>
<property name="left_attach">0</property>
<property name="right_attach">1</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="entryFirefoxMP">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">True</property>
<property name="visibility">False</property>
<property name="max_length">256</property>
<property name="text" translatable="yes"></property>
<property name="has_frame">True</property>
<property name="invisible_char">*</property>
<property name="activates_default">False</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">0</property>
<property name="bottom_attach">1</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface> </glade-interface>