Blob Blame History Raw
diff -up ./esc/src/app/xpcom/Makefile.sdk.fix20 ./esc/src/app/xpcom/Makefile.sdk
--- ./esc/src/app/xpcom/Makefile.sdk.fix20	2015-04-07 17:29:25.406955513 -0700
+++ ./esc/src/app/xpcom/Makefile.sdk	2015-04-07 18:32:07.330144841 -0700
@@ -195,13 +195,13 @@ all::	export libs
 
 libs:: 
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp  -o rhIKeyNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhIKeyNotify.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir /tmp  -o rhIKeyNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhIKeyNotify.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhIKeyNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhIKeyNotify.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir /tmp -o rhIKeyNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhIKeyNotify.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir /tmp -o rhICoolKey.h  -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhICoolKey.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir /tmp -o rhICoolKey.h  -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhICoolKey.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir /tmp -o rhICoolKey.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir /tmp -o rhICoolKey.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhICoolKey.idl
 
 ifeq ($(OS_ARCH),Darwin)
 	$(CXX)   $(CPPFLAGS)  -c  -o $(OBJECT)  $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES)
@@ -257,7 +257,7 @@ $(DEPLOY_OBJDIR):
 	mkdir $(DEPLOY_OBJDIR)
 
 	cd $(CORE_DEPTH)/$(DEPLOY_OFFSET)/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip
-	$(XUL_FRAMEWORK_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc  $(DEPLOY_OBJDIR)
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/install_app.py $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc  $(DEPLOY_OBJDIR)/esc --appName esc
 
 ifeq ($(OS_ARCH), Darwin)
 	mkdir $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_BASE)
diff -up ./esc/src/app/xpcom/rhCoolKey.cpp.fix20 ./esc/src/app/xpcom/rhCoolKey.cpp
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix20	2015-04-07 17:31:15.166792191 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.cpp	2015-04-07 18:24:16.454130223 -0700
@@ -106,21 +106,23 @@ class CoolKeyShutdownObserver : public n
    NS_DECL_ISUPPORTS
    NS_DECL_NSIOBSERVER
 
- ~CoolKeyShutdownObserver(); 
+  private:
+   ~CoolKeyShutdownObserver(); 
  };
 
- NS_IMPL_ISUPPORTS1(CoolKeyShutdownObserver, nsIObserver)
+ NS_IMPL_ISUPPORTS(CoolKeyShutdownObserver, nsIObserver)
 
  CoolKeyShutdownObserver::~CoolKeyShutdownObserver()
  {
     char tBuff[56];
     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s CoolKeyShutdownObserver::~CoolKeyShutdownObserver \n",GetTStamp(tBuff,56)));
  }
- 
+
+
  NS_IMETHODIMP
  CoolKeyShutdownObserver::Observe(nsISupports *aSubject,
                                  const char *aTopic,
-                                 const PRUnichar *someData)
+                                 const char16_t *someData)
  {
      char tBuff[56];
      if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID))
@@ -1793,5 +1795,5 @@ static const mozilla::Module kCoolKeyMod
  NSMODULE_DEFN(rhCoolKeyModule) = &kCoolKeyModule;
 //
 
-NS_IMPL_ISUPPORTS1(rhCoolKey,rhICoolKey) 
+NS_IMPL_ISUPPORTS(rhCoolKey,rhICoolKey) 
 
diff -up ./esc/src/app/xpcom/rhCoolKey.h.fix20 ./esc/src/app/xpcom/rhCoolKey.h
--- ./esc/src/app/xpcom/rhCoolKey.h.fix20	2015-04-07 18:03:46.544134629 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.h	2015-04-07 18:25:33.828309642 -0700
@@ -93,6 +93,7 @@ public:
     rhCoolKey();
 
     void ShutDownInstance();
+private:
     ~rhCoolKey();
 private:
     static HRESULT Dispatch( rhICoolKey *listener,
diff -up ./esc/src/app/xpcom/tray/Makefile.sdk.fix20 ./esc/src/app/xpcom/tray/Makefile.sdk
--- ./esc/src/app/xpcom/tray/Makefile.sdk.fix20	2015-04-02 15:09:32.327346359 -0700
+++ ./esc/src/app/xpcom/tray/Makefile.sdk	2015-04-02 15:12:17.987617741 -0700
@@ -230,13 +230,13 @@ all::	export libs
 libs:: 
 	echo "PPC_BUILD $(PPC_BUILD)"
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITray.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhITray.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/header.py --cachedir=/tmp -o rhITray.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhITray.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITray.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir=/tmp -o rhITray.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITray.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/header.py --cachedir=/tmp -o rhITrayWindNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhITrayWindNotify.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)//header.py --cachedir=/tmp -o rhITrayWindNotify.h -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE)  rhITrayWindNotify.idl
 
-	$(PYTHON_BIN) $(GECKO_SDK_PATH)/bin/typelib.py --cachedir=/tmp -o rhITrayWindNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl
+	$(PYTHON_BIN) $(GECKO_BIN_PATH)/typelib.py --cachedir=/tmp -o rhITrayWindNotify.xpt -I $(GECKO_IDL_PATH) -I $(NSPR_INCLUDE) rhITrayWindNotify.idl
 
 ifeq ($(OS_ARCH),Darwin)
 	$(CXX)   $(CPPFLAGS)  -c  -o $(OBJECT)  $(GECKO_CONFIG_INCLUDE) $(GECKO_DEFINES) $(GECKO_INCLUDES) $(COOL_INCLUDES) $(CXXFLAGS) $(FILES)
diff -up ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix20 ./esc/src/app/xpcom/tray/rhLinuxTray.cpp
--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix20	2015-04-07 16:15:16.840118695 -0700
+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp	2015-04-07 16:15:39.047883270 -0700
@@ -898,5 +898,5 @@ static const mozilla::Module kCoolKeyTra
 // shared library.
 NSMODULE_DEFN(rhCoolKeyTrayModule) = &kCoolKeyTrayModule;
 
-NS_IMPL_ISUPPORTS1(rhTray,rhITray)
+NS_IMPL_ISUPPORTS(rhTray,rhITray)
 
diff -up ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix20 ./esc/src/app/xul/esc/chrome/content/esc/ESC.js
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix20	2015-04-09 17:58:37.203518142 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js	2015-04-09 18:00:19.302492123 -0700
@@ -57,6 +57,7 @@ const  ESC_SECURITY_URL="esc.security.ur
 const  ESC_SECURE_URL="esc.secure.url";
 const  ESC_GLOBAL_PHONE_HOME_URL= "esc.global.phone.home.url";
 const  ESC_HIDE_FORMAT="esc.hide.format";
+const  ESC_ALLOW_NOTIFICATIONS="esc.allow.notifications";
 
 const  CLEAN_TOKEN = "cleanToken";
 const  UNINITIALIZED        = 1;
@@ -76,6 +77,7 @@ const ENROLL_WINDOW      = "esc.xul";
 const ADMIN_WINDOW       = "settings.xul";
 const HIDDEN_WINDOW      = "hiddenWindow.xul";
 const SECURITY_WINDOW    = "security.xul";
+const PHONE_WINDOW       = "config.xul";
 
 
 //Log level constants
@@ -230,10 +232,14 @@ var Status_Messages = new Array(
 function DoPhoneHome(keyType,keyID)
 {
   CoolKeyLogMsg(PR_LOG_ALWAYS,"Attempting to phone home for Key " + keyID); 
+  var allowNotify = null;
   var callback = function (aResult) {
 
     recordMessage("In DoPhoneHome callback");
 
+    var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS);
+
+
     var issuer = "";
     if(aResult == true)
     {
@@ -241,7 +247,10 @@ function DoPhoneHome(keyType,keyID)
         if(!issuer)
             issuer = getBundleString("unknownIssuer");
         recordMessage("In DoPhoneHome callback success issuer " + issuer);
-        TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+
+        if(allowNotify == "yes") {
+            TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+        }
         LogKeyInfo(keyType,keyID,"Key Inserted ...");
         UpdateRowWithPhoneHomeData(keyType,keyID);
         recordMessage("cached issuer " + issuer);
@@ -262,7 +271,9 @@ function DoPhoneHome(keyType,keyID)
         if(!issuer)
             issuer = getBundleString("unknownIssuer");
         recordMessage("Phone home callback failed , issuer " + issuer);
-        TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+        if (allowNotify == "yes") {
+            TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+        }
         LogKeyInfo(keyType,keyID,"Key Inserted ...");
     }
   }
@@ -271,6 +282,7 @@ function DoPhoneHome(keyType,keyID)
 
   var home = DoCoolKeyGetIssuerUrl(keyType,keyID);
 
+  //home = null;
   recordMessage("Returned IssuerURL " + home);
 
   if(IsPhoneHomeCached(keyID) && home)
@@ -279,7 +291,12 @@ function DoPhoneHome(keyType,keyID)
 
       recordMessage("Phone home info cached...");
       issuer = GetCoolKeyIssuer(keyType,keyID);
-      TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+
+      allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS);
+      if (allowNotify == "yes") {
+          TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+      }
+
       LogKeyInfo(keyType,keyID,"Key Inserted ...");
 
       var launchBrowserURL =  GetCachedEnrolledTokenBrowserURL(keyID);
@@ -534,7 +551,11 @@ function GetAuthDataFromPopUp(aKeyType,a
    keyUITable[aKeyID] = aUiData;
    keyTypeTable[aKeyID] = aKeyType;
 
-   var child =  window.open("chrome://esc/content/GenericAuth.xul", aKeyID, "chrome,centerscreen,width=400,height=250");
+   var child =  window.open("chrome://esc/content/GenericAuth.xul", aKeyID, "chrome,centerscreen,width=400,height=250,dialog");
+
+   if (child) {
+       child.setTimeout("focus()", 1000);
+   }
  
    curChildWindow = child; 
 }
@@ -1275,7 +1296,7 @@ function UpdateEnrollmentArea(keyType,ke
 
       var numUnenrolledKeys = DoGetNumUnenrolledCoolKeys();
 
-      //alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys);
+     // alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys);
 
 
      var ui_id = document.getElementById("esc-ui");
@@ -1290,7 +1311,7 @@ function UpdateEnrollmentArea(keyType,ke
          {
              if(!numUnenrolledKeys)
              {
-               ui_id.setAttribute("src",null);
+                ui_id.setAttribute("src","");
              }
              else
              {
@@ -1427,14 +1448,19 @@ function UpdateEnrollmentArea(keyType,ke
          HideItem(no_key_area);
      }
 
+
     if(!alreadyEnrolled  && inserted && showExternalUI)
      {
          UpdateESCSize();
+         gEnrollmentPage.setTimeout("focus();",3500);
          return;
      }
 
      if(!showExternalUI)
          UpdateESCSize();
+
+     gEnrollmentPage.setTimeout("focus();",3500);
+     
 }
 
 //Evaulate Password Quality
@@ -2006,7 +2032,7 @@ function SelectESCPage(keyType,keyID,pho
        break;
    }
 
-   //alert("SelectESCPage  initialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage);
+   //alert("SelectESCPage  uninitialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage + " phoneHomeFailed " + phoneHomeFailed + " no_launch_external_ui " + no_launch_external_ui);
 
    //Get the primary page windows if present
 
@@ -2022,14 +2048,7 @@ function SelectESCPage(keyType,keyID,pho
 
    if(keyUninitialized == UNINITIALIZED && !phoneHomeFailed && !no_launch_external_ui )  //formatted uninitialized card
    {
-       if(enrollWnd)   //Enrollment window is  already up
-       {
-          enrollWnd.focus();
-       }
-       else
-       {
-          launchESC();
-       }
+       launchESC();
    }
    else
    {
@@ -2975,8 +2994,9 @@ function OnCoolKeyInserted(keyType, keyI
 
   var uninitialized = 0;
 
-  recordMessage("Key inserted!" + "Window " + IdentifyWindow());
+  var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS);
 
+  recordMessage("Key inserted!" + "Window " + IdentifyWindow());
   if(gHiddenPage)
   {
       TrayShowNotificationIcon();
@@ -2993,6 +3013,7 @@ function OnCoolKeyInserted(keyType, keyI
 
         gCurrentSelectedRow = row;
         UpdateEnrollmentArea(keyType,keyID,1);
+
    }
 
    if(gAdminPage)
@@ -3017,7 +3038,9 @@ function OnCoolKeyInserted(keyType, keyI
           if(!issuer )
               issuer = getBundleString("unknownIssuer");
 
-          TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+          if( allowNotify) {
+              TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+          }
 
       }
 
@@ -3037,6 +3060,8 @@ function OnCoolKeyRemoved(keyType, keyID
 
   var  row = GetRowForKey(keyType, keyID);
 
+  var allowNotify = DoCoolKeyGetConfigValue(ESC_ALLOW_NOTIFICATIONS);
+
   if(gHiddenPage)
   {
       if(curChildWindow)
@@ -3047,7 +3072,9 @@ function OnCoolKeyRemoved(keyType, keyID
       var issuer = GetCoolKeyIssuer(keyType,keyID);
       if(!issuer)
           issuer = getBundleString("unknownIssuer");
-      TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" + issuer + "\"" + " " + getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID));
+      if (allowNotify == "yes") {
+          TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" + issuer + "\"" + " " + getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID));
+      }
        LogKeyInfo(keyType,keyID, "Key Removed ...");
 
   }
@@ -3345,6 +3372,7 @@ uiListener =
 
             if(url != esc_enroll_uri)
             {
+
                 MyAlert(getBundleString("errorEnrollmentUI"));
 
                 if(uiListener)
@@ -3978,17 +4006,24 @@ function launchCONFIG(keyType,keyID)
         platform = "mac";
     }
 
-    var wind = null;
+    var wind  = IsPageWindowPresent(PHONE_WINDOW);
 
-    if(platform == "mac")
-    {
-        wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=no");
-    }
-    else
-    {
-        wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=yes");
+    if (!wind) {
+        if(platform == "mac")
+        {
+            wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=no");
+        }
+        else
+        {
+            wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable");
+
+        }
+    } 
 
+    if(wind) {
+        wind.setTimeout("focus();",1500);
     }
+    
 }
 
 //Launch cert viewer if key has certs
@@ -4021,7 +4056,7 @@ function launchCertViewerIfCerts()
 //Launch page to view card's certificates
 function launchCertViewer()
 {
-   var wind = window.openDialog("chrome://esc/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+   var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
 }
 
 //Launch ESC admin page window
@@ -4046,12 +4081,12 @@ function launchESC()
 
     if(!enrollWnd)
     {
-        var wind = window.open("chrome://esc/content/esc.xul","","chrome,resizable,centerscreen,dialog");
+        enrollWnd = window.open("chrome://esc/content/esc.xul","","chrome,resizable,centerscreen,dialog");
 
     }
-    else
-    {
-        enrollWnd.focus();
+
+    if(enrollWnd) {
+         enrollWnd.setTimeout("focus();",1500);
     }
 
 }
diff -up ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js.fix20 ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js
--- ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js.fix20	2015-04-09 18:01:00.074082399 -0700
+++ ./esc/src/app/xul/esc/defaults/preferences/esc-prefs.js	2015-04-09 18:03:45.160423403 -0700
@@ -29,6 +29,10 @@ pref("esc.tps.message.timeout","90");
 
 pref("esc.windows.do.capi","yes");
 
+#Do we allow card notifications? Default no.
+
+pref("esc.allow.notifications", "yes");
+
 
 #Sample Security Officer Enrollment UI