rpms/esc/devel esc-1.0.0-diag-fix.patch, NONE, 1.1 esc-1.0.0-mac-win-fix.patch, NONE, 1.1 esc.spec, 1.20, 1.21

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Oct 4 21:59:11 UTC 2006


Author: jmagne

Update of /cvs/dist/rpms/esc/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv3109/devel

Modified Files:
	esc.spec 
Added Files:
	esc-1.0.0-diag-fix.patch esc-1.0.0-mac-win-fix.patch 
Log Message:
auto-import esc-1.0.0-17 on branch devel from esc-1.0.0-17.src.rpm

esc-1.0.0-diag-fix.patch:
 app/xpcom/rhCoolKey.cpp                         |   21 +++
 app/xpcom/rhICoolKey.idl                        |    5 
 app/xul/esc/application.ini                     |    2 
 app/xul/esc/chrome/content/esc/AdvancedInfo.js  |   16 +-
 app/xul/esc/chrome/content/esc/ESC.js           |  143 ++++++++++++++++--------
 app/xul/esc/chrome/content/esc/advancedinfo.xul |    3 
 app/xul/esc/chrome/content/esc/esc.css          |    7 +
 app/xul/esc/chrome/locale/en-US/esc.properties  |   17 ++
 lib/coolkey/CoolKey.cpp                         |   33 +++++
 lib/coolkey/CoolKey.h                           |    2 
 lib/coolkey/CoolKeyHandler.cpp                  |    2 
 lib/coolkey/NSSManager.cpp                      |  116 ++++++++++++++++---
 12 files changed, 291 insertions(+), 76 deletions(-)

--- NEW FILE esc-1.0.0-diag-fix.patch ---
--- ./esc/src/lib/coolkey/CoolKey.h.fix18	2006-09-26 21:27:44.000000000 -0700
+++ ./esc/src/lib/coolkey/CoolKey.h	2006-09-26 20:34:11.000000000 -0700
@@ -172,6 +172,8 @@
 
 COOLKEY_API HRESULT CoolKeyGetIssuerInfo(const CoolKey *aKey, char *aBuf, int aBufLen);
 
+COOLKEY_API int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor);
+
 }
 
 ////////////////////////////////////////////////////////////////////////
--- ./esc/src/lib/coolkey/NSSManager.cpp.fix18	2006-09-26 21:28:59.000000000 -0700
+++ ./esc/src/lib/coolkey/NSSManager.cpp	2006-09-26 17:26:17.000000000 -0700
@@ -33,11 +33,16 @@
 #include "p12plcy.h"
 #include "secmod.h"
 #include "secerr.h"
+#include "secder.h"
 #include "certdb.h"
 #include "secmodt.h"
 #include "keythi.h"
 #include "keyhi.h"
 
+#include <iostream>
+ #include <sstream>
+
+
 #include "SlotUtils.h"
 
 static PRLogModuleInfo *coolKeyLogNSS = PR_NewLogModule("coolKeyNSS");
@@ -244,13 +249,11 @@
 
   PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertNickNames \n"));
 
-
   if(!aKey )
   {
     return E_FAIL;
   }
 
-
   PK11SlotInfo *slot = GetSlotForKeyID(aKey);
 
   if (!slot)
@@ -258,7 +261,33 @@
     return E_FAIL;
   }
 
-  CERTCertList *certs = PK11_ListCertsInSlot(slot);
+  CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
+
+    if (!certs)
+    {
+        PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetCertNicknames no certs found! \n"));
+        PK11_FreeSlot(slot);
+        return E_FAIL;
+    }
+    CERTCertListNode *node= NULL;
+    for( node = CERT_LIST_HEAD(certs);
+             ! CERT_LIST_END(node, certs);
+             node = CERT_LIST_NEXT(node))
+    {
+        if(node->cert)
+        {
+            CERTCertificate *cert = node->cert;
+            if(cert)
+            {
+                if(cert->slot != slot)
+                {
+                    CERT_RemoveCertListNode(node);
+                }
+            }
+        }
+
+    }
+
 
   if (!certs)
   {
@@ -388,7 +417,7 @@
 HRESULT NSSManager::GetKeyCertInfo(const CoolKey *aKey, char *aCertNickname, string & aCertInfo)
 {
 
-   PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo \n"));
+   PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo Nickname %s \n",aCertNickname));
 
   aCertInfo = "";
 
@@ -409,7 +438,7 @@
     return E_FAIL;
   }
 
-  CERTCertList *certs = PK11_ListCertsInSlot(slot);
+  CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
 
   if (!certs)
   {
@@ -418,19 +447,75 @@
     return E_FAIL;
   }
 
-  CERTCertListNode *node= CERT_LIST_HEAD(certs);
+  PR_LOG(coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo About to get CertList for slot. \n"));
 
-  if(!CERT_LIST_END(node,certs))
-  {
-      CERTCertificate *cert = CERT_FindCertByNickname(node->cert->dbhandle,aCertNickname);
-
-    if(cert)
+  CERTCertListNode *node= NULL;
+    for( node = CERT_LIST_HEAD(certs);
+             ! CERT_LIST_END(node, certs);
+             node = CERT_LIST_NEXT(node))
     {
-       aCertInfo = (char *) ""; 
-    } 
-  }
+        if(node->cert)
+        {
+            CERTCertificate *cert = node->cert;
+            if(cert)
+            {
+                if(cert->slot == slot)
+                {
+                    if(!strcmp(cert->nickname,aCertNickname))
+                    {
+                        PR_LOG(coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo We have a matching cert to our slot. nickname %s \n",cert->nickname));
+
+                        char *issuerCN   = NULL;
+                        char *issuedToCN = NULL;
+                       
+                        aCertInfo = (char *) "";
+                        issuedToCN = cert->subjectName;
+                        issuerCN   = cert->issuerName;
+                        
+                        string issuerCNStr =  "";
+                        if(issuerCN)
+                            issuerCNStr = issuerCN;
+
+                        string issuedToCNStr = "" ;
+                        if(issuedToCN)
+                           issuedToCNStr = issuedToCN;
 
-  PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertINfo info %s \n",aCertInfo.c_str())); 
+                        string notBeforeStr = "";
+                        string notAfterStr  = "";
+
+                        char *nBefore = (char *) DER_UTCTimeToAscii(&cert->validity.notBefore);
+                        char  *nAfter  = (char *) DER_UTCTimeToAscii(&cert->validity.notAfter);
+
+
+ 
+                        if(nBefore)
+                            notBeforeStr = nBefore;
+                        if(nAfter)
+                            notAfterStr  = nAfter;
+
+                        PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo notBefore %s notAfter %s \n",nBefore, nAfter));
+
+
+                        int serialNumber = DER_GetInteger(&cert->serialNumber);
+
+                        std::ostringstream o;
+                        string serialStr = "";
+                        if (o << serialNumber)
+                            serialStr = o.str();                        
+
+                        aCertInfo = issuedToCNStr + "\n" + issuerCNStr + "\n"
+                            + notBeforeStr + "\n" + notAfterStr + "\n" + serialStr ;
+                        PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo issuerCN %s issuedToCN %s \n",issuerCN, issuedToCN)); 
+
+                        
+                        break;
+                    }               
+                }
+            }
+        }
+    }
+
+  PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo info: %s \n",aCertInfo.c_str())); 
 
   if(certs)
       CERT_DestroyCertList(certs);
@@ -440,6 +525,7 @@
 
   return S_OK;
 }
+
 HRESULT
 NSSManager::GetKeyPolicy(const CoolKey *aKey, char *aBuf, int aBufLength)
 {
--- ./esc/src/lib/coolkey/CoolKey.cpp.fix18	2006-09-26 21:27:21.000000000 -0700
+++ ./esc/src/lib/coolkey/CoolKey.cpp	2006-09-26 20:40:57.000000000 -0700
@@ -819,7 +819,7 @@
 
     }
 
-    return S_OK; // NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
+    return NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
 
 }
 
@@ -974,6 +974,37 @@
    return res;
 }
 
+int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor)
+{
+
+  int result = -1;
+  if(!aKey)
+      return result;
+
+  CoolKeyInfo *info =
+      GetCoolKeyInfoByKeyID(aKey);
+
+  if(!info)
+      return result;
+
+  PK11SlotInfo *slot = GetSlotForKeyID(aKey);
+
+  if(!slot)
+      return result;
+
+  CK_TOKEN_INFO tokenInfo;
+  PK11_GetTokenInfo(slot, &tokenInfo);
+
+  if(isMajor)
+     result = (int) tokenInfo.firmwareVersion.major;
+  else
+     result = (int) tokenInfo.firmwareVersion.minor;
+
+   return result;
+
+}
+
+
 bool
 CoolKeyHasReader(const CoolKey *aKey)
 {
--- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix18	2006-09-26 21:28:17.000000000 -0700
+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp	2006-09-26 20:27:54.000000000 -0700
@@ -2161,7 +2161,7 @@
   PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->model %s.\n",(char *)tokenInfo.model));
   PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->serialNumber %s.\n",(char *)tokenInfo.serialNumber));
 
-
+  PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->firmwareVersion.major %d info->firmwareVersion.minor %d \n",(int)tokenInfo.firmwareVersion.major,(int) tokenInfo.firmwareVersion.minor));
 
 
   // OK, we have everything we need, now build the COOLKEYInfo structure.
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix18	2006-09-26 21:17:36.000000000 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.cpp	2006-09-26 21:20:14.000000000 -0700
@@ -39,6 +39,7 @@
 #include "nsXPCOMGlue.h"
 #include "prlink.h"
 #include "nscore.h"
+#include "content/nsCopySupport.h"
 #include <vector>
 #include <string>
 
@@ -1087,6 +1088,21 @@
     return NS_OK;
 }
 
+/* long GetCoolKeyGetAppletVer (in unsigned long aKeyType, in string aKeyID, in boolean aIsMajor); */
+NS_IMETHODIMP rhCoolKey::GetCoolKeyGetAppletVer(PRUint32 aKeyType, const char *aKeyID, PRBool aIsMajor, PRInt32 *_retval)
+{
+
+    PR_LOG(coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyAppletVer thread: %p \n",PR_GetCurrentThread()));
+
+    AutoCoolKey key(aKeyType, aKeyID);
+
+    int ver = CoolKeyGetAppletVer(&key, aIsMajor);
+
+    *_retval = ver;
+
+    return S_OK;
+
+}
 
 /* boolean rhCoolKeyIsEnrolled (in unsigned long aKeyType, in string aKeyID); */
 
@@ -1116,6 +1132,9 @@
     string certInfo = "";
     *aCertInfo = NULL;
 
+    PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyCertInfo thread: %p \n",PR_GetCurrentThread()));
+
+
     AutoCoolKey key(aKeyType, aKeyID);
 
 
@@ -1339,7 +1358,7 @@
 {
     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
 
-    char *version = "1.0.0-15";
+    char *version = "1.0.0-16";
     
     char *versionVal =  (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) +  1);
 
--- ./esc/src/app/xpcom/rhICoolKey.idl.fix18	2006-09-26 21:18:16.000000000 -0700
+++ ./esc/src/app/xpcom/rhICoolKey.idl	2006-09-26 20:42:59.000000000 -0700
@@ -19,6 +19,7 @@
 #include "rhIKeyNotify.idl"
 #include "nsIObserver.idl"
 
+interface nsIDOMHTMLDocument;
 [scriptable,uuid(ea54eee4-9548-4b63-b94d-c519ffc91d09)]
 
 interface rhICoolKey: nsISupports
@@ -75,9 +76,13 @@
     boolean    SetCoolKeyConfigValue(in string aName, in string aValue);
 
     boolean   GetCoolKeyIsReallyCoolKey(in unsigned long aKeyType, in string aKeyID);
+
+    long      GetCoolKeyGetAppletVer(in unsigned long aKeyType, in string aKeyID , in boolean aIsMajor);
+
     string    GetCoolKeyConfigValue(in string aName);
 
     string    GetCoolKeyVersion();
+ 
 
 };
 
--- ./esc/src/app/xul/esc/application.ini.fix18	2006-09-26 21:19:46.000000000 -0700
+++ ./esc/src/app/xul/esc/application.ini	2006-09-26 21:19:58.000000000 -0700
@@ -29,7 +29,7 @@
 ;
 ; This field specifies your application's build ID (timestamp).  This field is
 ; required.
-BuildID=00000000015
+BuildID=00000000016
 ;
 ; This ID is just an example.  Every XUL app ought to have it's own unique ID.
 ; You can use the microsoft "guidgen" or "uuidgen" tools, or go on
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix18	2006-09-26 21:24:12.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js	2006-09-26 21:03:53.000000000 -0700
@@ -32,8 +32,6 @@
 var gHiddenPageDone = 0;
 var gExternalUI = 0;
 
-var gDiagnosticsCopyString="";
-
 loadStringBundle();
 
 //ESC constants
@@ -813,33 +811,48 @@
     var arr = GetAvailableCoolKeys();
     var coolkeyVersion = GetCoolKeyVersion();
 
-    var dump = "<html>";
-    dump += "<style> p { font-size: 9pt } </style>";
+    var textDump="";
+
+    textDump +=  getBundleString("diagnosticsReport") + "\n\n";
+
+    textDump += "***" + getBundleString("diagnosticsSystemInfo") + "***" + "\n\n";
+    var agent = getBundleString("diagnosticsSoftVersioInfo") + " " +  navigator.userAgent.toLowerCase() + "\n";
+
+    textDump +=  " " + getBundleString("coolkeyComponentVersion");
+    textDump += " " + coolkeyVersion + "\n";
 
-    //dump += "<p><br>" + getBundleString("diagnosticsMessage") + "<br></p>";
 
-    dump += "<p><br><b>" +  getBundleString("coolkeyComponentVersion") + "</b>" ;
-    dump += " " + coolkeyVersion ;
+    textDump += " " + agent + "\n";
 
-    dump +=  "<br><b>" + getBundleString("coolkeyDetectedNumberKeys") + "</b>"; 
-    dump +=  " " +  arr.length + "</p>" ; 
+    textDump += "***" + getBundleString("diagnosticsDetails") + "***" + "\n\n";
+
+    textDump += "  " +  getBundleString("coolkeyDetectedNumberKeys") + " ";
+
+    textDump +=   arr.length + "\n\n" ;
 
-    dump += "<p>";
     for(i = 0 ; i < arr.length ; i++)
     {
        keyID = arr[i][1];
        keyType = arr[i][0];
 
+       var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
+       var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
+
        var issuer = GetCachedIssuer(keyID);
        if(!issuer)
            issuer = getBundleString("unknownIssuer");
 
+       textDump += "***" + getBundleString("smartCardU") + " " + i + ":" + "***" + "\n\n";
+
+       textDump += "  " + getBundleString("appletVersion") + " " + appletVerMaj + "." + appletVerMin + "\n";
+
+
        var status =  GetStatusForKeyID(keyType, keyID);
 
-       dump += "<b>" + getBundleString("keyID") + "</b>" + " " +  keyID  + "<br>";
-       dump += "<b>" + getBundleString("status") + "</b>" + " " + status + "<br>";
+       textDump += "  " + getBundleString("keyID") + " " + " " +  keyID  + "\n";
+       textDump += "  " + getBundleString("status") + " " + " " + status + "\n";
+       textDump += "  " + getBundleString("issuer") + " " + " " + issuer + "\n";
 
-       dump += "<b>" + getBundleString("issuer") + "</b>" + " " + issuer + "<br>";
        var tpsURI = GetCachedTPSURL(keyID);
        var tpsUI  = GetCachedTPSUI(keyID);
        var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
@@ -853,43 +866,81 @@
        if(!phoneHomeURI)
            phoneHomeURI = ""; 
 
-       dump += "<b>" + getBundleString("tpsPhoneHomeURL") + "</b>" + " " + phoneHomeURI + "<br>";
+       textDump += "  " + getBundleString("tpsPhoneHomeURL") + " " + " " + phoneHomeURI + "\n";
+       textDump += "  " + getBundleString("tpsURI") + " " + " " + tpsURI + "\n";
+       textDump += "  " +getBundleString("tpsUI") + " " + " " + tpsUI + "\n";
+
+       textDump += "\n";
+
+       var nicknames  = GetCoolKeyCertNicknames(keyType,keyID);
+       if(nicknames && nicknames.length)
+       {
+        textDump += "  " + getBundleString("certsOnToken")  + " \n\n";
+       }
+
+       if(nicknames)
+       {
+           var cert_info = null;
+           for (i = 0; i < nicknames.length ; i ++)
+           {
+                textDump += "    " + getBundleString("certificateNickname") + " " + nicknames[i] + " \n\n";
+
+                cert_info = GetCoolKeyCertInfo(keyType,keyID,nicknames[i]);
+
+                var cert_split = cert_info.split("\n");
+
+
+                if(cert_split.length)
+                {
+
+                    textDump += "      " + getBundleString("certIssuedTo") + " " + cert_split[0] + "\n";
+
+                    textDump += "      " + getBundleString("certIssuedBy") + " " + cert_split[1] + "\n";
+
+                    textDump += "      " + getBundleString("certValidityFrom") + " " + cert_split[2] + "\n";
+
+                    
+                    textDump += "      " + getBundleString("certValidityTo") + " " + cert_split[3] + "\n";
+
+                    textDump += "      " + getBundleString("certSerialNumber") + " " + cert_split[4] + "\n";
+
 
-       dump += "<b>" + getBundleString("tpsURI") + "</b>" + " " + tpsURI + "<br>";
-       dump += "<b>" + getBundleString("tpsUI") + "</b>" + " " + tpsUI + "<br>";
+                    textDump += "\n";
+                }
+
+           }
+       }
 
     }
 
-    dump += "</p>";
+    if(i <= 0)
+    {
+        textDump += "\n";
+    }
 
     var lines = null;
 
     var lines = ReadESCLog();
 
-    dump += "<hr><b><center>" + "***" + getBundleString("escLogEntries") + "***" +  "</b></center>";
 
-    dump += "<p>";
+    textDump += "***" + getBundleString("escLogEntries") + "***"  + "\n";
+
 
     if(lines)
     {
         for(i = 0 ; i < lines.length ; i++)
         {
-             dump += lines[i] + "<br>";
+             textDump += lines[i] + "\n";
         }
 
     }
     else
     {
-         dump += getBundleString("noLogFileOrData");
-    }
-
-    dump += "</p>";
 
-    dump += "</html>";
-
-    gDiagnosticsCopyString = dump;
+         textDump += getBundleString("noLogFileOrData");
+    }
 
-    var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",dump);
+    var wnd = window.openDialog("chrome://esc/content/advancedinfo.xul","Info","chrome,centerscreen,width=600,height=500,modal=yes",textDump);
 
 }
 
@@ -3875,6 +3926,19 @@
   return url;
 }
 
+function DoGetCoolKeyGetAppletVer(keyType, keyID , isMajor)
+{
+    var ver = -1;
+
+    try {
+      netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+      var ver  =  netkey.GetCoolKeyGetAppletVer(keyType, keyID,isMajor);
+    } catch (e) {
+      ver = -1;
+  }
+  return ver;
+
+}
 
 function CheckForFactoryMode()
 {
@@ -4380,40 +4444,33 @@
 
 function DoCopyAdvancedInfoToClipBoard()
 {
-    CopyDataToClipboard(gDiagnosticsData);
+    var textinfo = window.document.getElementById("advanced-info");
+
+
+    CopyDataToClipboard(gDiagnosticsDataText);
 }
 
 
-function CopyDataToClipboard(aData)
+function CopyDataToClipboard(aDataText)
 {
 
-    if (!aData)
+   if(!aDataText)
        return;
 
-    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); 
-
 
-    var html = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+    var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString); 
 
 
     if (!str) 
        return false; 
 
-    if(!html)
-        return false;
-
-    html.data = aData;
-
-    str.data = aData; 
+    str.data = aDataText; 
 
     var trans = Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable); 
 
     if (!trans) 
         return false; 
 
-
-    trans.addDataFlavor("text/html"); 
-    trans.setTransferData("text/html",html,html.data.length * 2);
     trans.setTransferData("text/unicode",str,str.data.length *2); 
     var clipid = Components.interfaces.nsIClipboard; 
 
--- ./esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js.fix18	2006-09-26 21:22:07.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js	2006-09-26 11:20:53.000000000 -0700
@@ -16,24 +16,20 @@
  * END COPYRIGHT BLOCK **/
 
 
-var gDiagnosticsData= "";
+var gDiagnosticsDataText="";
 
 function ShowAdvancedInfo()
 {
-    var dump = window.arguments[0];
+    var textDump = window.arguments[0];
 
     gDiagnosticsData=dump;
+    gDiagnosticsDataText=textDump;
 
-    var frame = window.document.getElementById("advanced-info");
+    var textbox = window.document.getElementById("advanced-info");
 
-    var doco = frame.contentDocument;
-
-    if(doco)
+    if(textbox)
     {
-        doco.open(); 
-        doco.write(dump);
-        doco.close();
-
+        textbox.setAttribute("value",textDump);
     }
 }
 
--- ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul.fix18	2006-09-26 21:23:09.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul	2006-09-26 11:13:46.000000000 -0700
@@ -49,7 +49,8 @@
      &diagnosticsMessage;
  </description>
  <groupbox flex = "1" >
-     <iframe id="advanced-info" src="" flex="1" />
+     <textbox id="advanced-info" flex="1" multiline="true" readonly="true" />
+<!--     <iframe id="advanced-info" src="" flex="1" /> -->
  </groupbox>
 <hbox >
 <spacer flex = "1"/>
--- ./esc/src/app/xul/esc/chrome/content/esc/esc.css.fix18	2006-09-26 21:23:38.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/esc.css	2006-09-26 11:06:21.000000000 -0700
@@ -313,6 +313,13 @@
   background-color: #ffffff;
 }
 
+.DiagnosicsTextBox {
+
+   width: 600px;
+   height: 725px;
+   border: black solid 4px;
+
+}
 
 .BorderedIFrame {
 
--- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties.fix18	2006-09-26 21:25:22.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties	2006-09-26 20:50:47.000000000 -0700
@@ -32,6 +32,7 @@
 unknownIssuer=Unknown
 redHatUser=User
 statusUnknown=Unknown
+appletVersion = Smart Card Applet Version:
 operationPINReset=Resetting Key Password..
 operationEnrollment=Enrolling Key..
 operationFormat=Formatting Key..
@@ -43,11 +44,21 @@
 tpsPhoneHomeURL=Phone Home URL:
 status=Status:
 issuer=Issuer:
-escLogEntries=Log Entries
+escLogEntries=Smart Card Activity
 noLogFileOrData=No log file or log file has no data.
-dataCopiedToClipboard=Data copied to the clipboard.
-certsOnToken=CERTIFICATES on KEY 
+dataCopiedToClipboard=Diagnostics information copied to the clipboard.
+diagnosticsReport=SMART CARD DIAGNOSTICS REPORT
+diagnosticsSystemInfo=Software Version Information
+diagnosticsSoftVersioInfo=System Versions:
+diagnosticsDetails=Active Smart Card Details
+secCard=Card
+certsOnToken=Certificates on Smart Card 
 certificateNickname=Certificate Nickname:
+certIssuedTo=Issued to;
+certIssuedBy=Issued by;
+certValidityFrom=Validity from:
+certValidityTo=Validity to:
+certSerialNumber=Serial number:
 coolkeyComponentVersion=Smart Card Manager Version:
 coolkeyDetectedNumberKeys=Number of Smart Cards Detected:
 enrolledDetected=Enrolled Smart Card Detected

esc-1.0.0-mac-win-fix.patch:
 rpm/esc                                         |  105 ++++++++++++++++++++++-
 rpm/esc.spec                                    |   63 +++++++++++++-
 src/app/daemon/manifest.mn                      |   10 ++
 src/app/xpcom/Makefile.moz                      |   28 ++++--
 src/app/xpcom/rhCoolKey.cpp                     |   11 ++
 src/app/xpcom/tray/Makefile.moz                 |   10 +-
 src/app/xpcom/tray/cool.rc                      |    4 
 src/app/xpcom/tray/rhMacTray.cpp                |  103 ++++++++++++++++++-----
 src/app/xpcom/tray/rhTray.cpp                   |  106 ++++++++++++++++++++----
 src/app/xpcom/tray/rhTray.h                     |    4 
 src/app/xul/esc/chrome/content/esc/ESC.js       |   34 ++++++-
 src/app/xul/esc/chrome/content/esc/password.js  |   16 +++
 src/app/xul/esc/chrome/content/esc/password.xul |   17 +++
 src/xulrunner/Makefile                          |    2 
 14 files changed, 452 insertions(+), 61 deletions(-)

--- NEW FILE esc-1.0.0-mac-win-fix.patch ---
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix19	2006-10-04 10:56:51.000000000 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.cpp	2006-10-04 11:48:42.000000000 -0700
@@ -43,6 +43,14 @@
 #include <vector>
 #include <string>
 
+
+#define STRINGIFY(x) #x
+#define GETSTRING(x) STRINGIFY(x)
+
+#ifndef ESC_VERSION
+#define ESC_VERSION 1.0.0-0
+#endif
+
 #include <prlog.h>
 #define COOL_MAX_PATH 1024
 #define MAX_STR_LEN COOL_MAX_PATH
@@ -1358,10 +1366,9 @@
 {
     PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("rhCoolKey::GetCoolKeyVersion \n"));
 
-    char *version = "1.0.0-16";
+    char *version = GETSTRING(ESC_VERSION);
     
     char *versionVal =  (char *) nsMemory::Clone(version,sizeof(char) * strlen(version) +  1);
-
     
     *_retval = versionVal;   
 
--- ./esc/src/app/xpcom/Makefile.moz.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xpcom/Makefile.moz	2006-10-04 11:13:24.000000000 -0700
@@ -26,7 +26,6 @@
 CORE_DIST	= $(CORE_DEPTH)/dist/$(OBJDIR)
 CORE_INC	= $(CORE_DEPTH)/dist/public
 MDDEPDIR	:= $(OBJDIR)/.deps
-DESTDIR		= $(MOZ_OBJDIR)/install
 
 NO_DIST_INSTALL	= 1
 
@@ -37,6 +36,9 @@
 DEPLOY_OBJDIR           = $(CORE_DEPTH)/dist/$(OBJDIR)/esc_build
 
 XULRUNNER_ZIP_NAME	= xulrunner-1.8.0.1.*.tar.gz 
+ifeq ($(OS_ARCH),WINNT)
+XULRUNNER_ZIP_NAME	= xulrunner-1.8.0.1.*.win32.zip
+endif
 XULRUNNER_BIN_PATH	= $(MOZ_OBJDIR)/dist/xulrunner
 XULRUNNER_EXEC		= xulrunner
 ifeq ($(OS_ARCH), Darwin)
@@ -46,6 +48,13 @@
 XULRUNNER_FRAME_BASE	= ESC.app/Contents/Frameworks
 endif
 
+DEPLOY_OFFSET=/esc
+
+ifeq ($(OS_ARCH),Linux)
+DEPLOY_OFFSET=/src
+DESTDIR=$(MOZ_OBJDIR)/install
+endif
+
 ifeq ($(OS_ARCH), WINNT)
 OS_LIBS			+= crypt32.lib
 CSPSRCS			=  CoolKeyCSP.cpp
@@ -74,6 +83,10 @@
 DEFINES		+= -DXPCOM_GLUE  $(GECKO_INCLUDES) -I$(CORE_INC)/ckymanager -I$(CORE_INC)/httpchuncked -I./_xpidlgen
 
 
+ifdef ESC_VERSION
+DEFINES += -DESC_VERSION=$(ESC_VERSION)
+endif
+
 REQUIRES	= string \
 		  xpcom \
 		  $(NULL)
@@ -115,7 +128,7 @@
 clean::
 	rm -f Makefile.in
 	rm -rf $(DEPLOY_OBJDIR)
-	rm -rf $(CORE_DEPTH)/src/app/xul/esc/esc
+	rm -rf $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc
 
 deploy: $(DEPLOY_OBJDIR)
 	echo "deploy! on $(OS_ARCH)"
@@ -160,14 +173,14 @@
 
 $(DEPLOY_OBJDIR):
 	echo "Installing!"
-	$(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
-	$(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)/src/app/xul/esc/components
+	$(NSINSTALL) ./$(LIB_PREFIX)rhCoolKey$(DLL_SUFFIX) $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/components
+	$(NSINSTALL) ./_xpidlgen/*.xpt $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/components
 
 	echo  "Creating $(DEPLOY_OBJDIR)"
 	mkdir $(DEPLOY_OBJDIR)
 
-	cd $(CORE_DEPTH)/src/app/xul/esc; zip -r test.zip * -x *\CVS\* \*.fix*; unzip -d esc test.zip ; rm -f test.zip
-	$(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)/src/app/xul/esc/esc  $(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
+	$(XULRUNNER_BIN_PATH)/$(XULRUNNER_EXEC) --install-app $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/esc  $(DEPLOY_OBJDIR)
 
 ifeq ($(OS_ARCH), Darwin)
 
@@ -178,8 +191,11 @@
 endif
 	#cp -Rf -v $(XULRUNNER_BIN_PATH) $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)
 
+ifeq ($(OS_ARCH),Linux)
 	tar -xzvf $(MOZ_OBJDIR)/dist/$(XULRUNNER_ZIP_NAME)  -C $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)/esc 
+endif
 ifeq ($(OS_ARCH),WINNT)
+	unzip $(MOZ_OBJDIR)/dist/$(XULRUNNER_ZIP_NAME) -d $(DEPLOY_OBJDIR)/$(XULRUNNER_FRAME_DEST)/esc
 	cp -f $(XPCOM_EXTRA)  $(DEPLOY_OBJDIR)/ESC/components
 endif
 ifdef DESTDIR
--- ./esc/src/app/xpcom/tray/cool.rc.fix19	2006-07-17 10:33:01.000000000 -0700
+++ ./esc/src/app/xpcom/tray/cool.rc	2006-10-03 10:46:52.000000000 -0700
@@ -58,8 +58,8 @@
 BEGIN
     POPUP "System Tray Menu"
     BEGIN
-        MENUITEM "Show...",                     ID_SHOW
-        //MENUITEM "Hide...",                     ID_HIDE
+        MENUITEM "Show Manage Smart Cards",                     ID_SHOW
+        //MENUITEM "Hide",                     ID_HIDE
         MENUITEM "Exit",                        IDM_EXIT
     END
 END
--- ./esc/src/app/xpcom/tray/rhTray.h.fix19	2006-07-17 10:33:01.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhTray.h	2006-10-03 10:46:52.000000000 -0700
@@ -68,6 +68,7 @@
 #endif
 
 #include <map>
+#include <string>
 using namespace std;
 // generate unique ID here with uuidgen
 
@@ -142,6 +143,8 @@
 
      static map< nsIBaseWindow *, rhTrayWindowListener *> mWindowMap;
 
+     static map<unsigned int,string> mMenuItemStringMap;
+
 
      static HRESULT ShowPopupMenu (WORD PopupMenuResource);
      HRESULT AddListener(nsIBaseWindow *aBaseWindow);
@@ -343,6 +346,7 @@
 
      static EventHandlerRef mEventHandlerRef;
      static EventHandlerUPP mEventHandlerUPP;
+     static MenuRef mDockMenu;
 
   // Icon menu related
 
--- ./esc/src/app/xpcom/tray/rhMacTray.cpp.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhMacTray.cpp	2006-10-03 10:46:52.000000000 -0700
@@ -25,12 +25,14 @@
 
 int rhTray::mInitialized = 0;
 WindowRef rhTray::mWnd = NULL;
+MenuRef   rhTray::mDockMenu = NULL;
 ProcessSerialNumber rhTray::mPSN;
 EventHandlerRef rhTray::mEventHandlerRef=NULL;
 EventHandlerUPP rhTray::mEventHandlerUPP=NULL;
 
 map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
 
+#define MENU_ITEM_ID_BASE 5
 
 std::list< nsCOMPtr<rhITrayWindNotify> > rhTray::gTrayWindNotifyListeners;
 
@@ -137,7 +139,6 @@
 
     rhTrayWindowListener *listener = rhTray::mWindowMap[aWindow];
 
-    ShowApp();
     if(listener)
     {
         listener->ShowWindow();
@@ -220,7 +221,7 @@
 {
 
     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Show app!  \n"));
-   
+  
     ::ShowHideProcess(&rhTray::mPSN,TRUE);
     ::SetFrontProcess(&rhTray::mPSN);
 
@@ -259,6 +260,27 @@
         return E_FAIL;
     }
 
+    //Take care of the menu stuff
+
+    MenuRef tMenu;
+    CreateNewMenu(1, 0, &tMenu);
+
+    MenuItemIndex item;
+    AppendMenuItemTextWithCFString( tMenu, CFSTR("Show Manage Smart Cards"),  0,MENU_ITEM_ID_BASE , &item );
+
+    if(tMenu)
+    {
+        OSStatus result =  SetApplicationDockTileMenu (tMenu);
+
+        if(result == noErr)
+        {
+            PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of SetApplicationDockTileMenu %d \n",result));
+            mDockMenu = GetApplicationDockTileMenu();
+
+            PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Initialize result of GertApplicationDockTileMenu: %d \n",mDockMenu));
+        }
+    }
+
     mInitialized = 1;
 
     return S_OK;
@@ -292,6 +314,11 @@
         ::DisposeEventHandlerUPP(mEventHandlerUPP);
 
     }
+
+    if(mDockMenu)
+    {
+        ::ReleaseMenu(mDockMenu);
+    }
  
     return S_OK;
 }
@@ -323,7 +350,6 @@
 void rhTray::ShowAllListeners()
 {
 
-    ShowApp();
     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowAllListeners.\n"));
     map< nsIBaseWindow *, rhTrayWindowListener *>::iterator i;
 
@@ -421,7 +447,6 @@
 
     }
 
-
     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::AddWindowListener top level widget  %p \n",hWnd));
 
     rhTrayWindowListener *create = new rhTrayWindowListener(hWnd);
@@ -437,7 +462,7 @@
 
     if(res != S_OK)
        return E_FAIL;
-   
+  
     return S_OK; 
 }
 
@@ -506,6 +531,46 @@
 /* void setmenuitemtext (in unsigned long aIndex, in string aText); */
 NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
 {
+
+    // On the Mac , we support only one menu item
+
+    if(aIndex == 0 && aText)
+    {
+        PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::Setmenuitemtext  aIndex: %d text %s. \n",aIndex,aText));
+
+        MenuRef outMenu;
+        MenuItemIndex theIndex;
+
+        OSStatus result = GetIndMenuItemWithCommandID (
+             mDockMenu,
+             MENU_ITEM_ID_BASE + aIndex,
+             1,
+             &outMenu,
+             &theIndex
+        );
+
+        PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::Setmenuitemtext  Result of menu item: %d. \n",result));
+   
+        if(result == noErr)
+        {
+            PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::Setmenuitemtext changing item index:    %d . \n",theIndex));
+            CFStringRef cfStr= CFStringCreateWithCString (
+                NULL,
+                aText,
+                kCFStringEncodingASCII
+            );
+
+            OSStatus  result = SetMenuItemTextWithCFString (
+               mDockMenu,
+               theIndex ,
+               cfStr 
+            );
+
+            PR_LOG( trayLog, PR_LOG_DEBUG, ("rhCoolKey::Setmenuitemtext  Result of setting item text: %d. \n",result));
+
+        }
+    }
+
     return S_OK;
 }
 
@@ -596,6 +661,7 @@
 
         PRBool claimed = 0;
 
+        PR_LOG(trayLog, PR_LOG_DEBUG, ("rhTray::NotifyTrayWindListener:   . \n"));
         ((rhITrayWindNotify *) (*it))->RhTrayWindEventNotify(aEvent,aEventData, aKeyData, aData1, aData2, &claimed);
 
 
@@ -626,6 +692,7 @@
 
                  case kEventAppActivated:
                    PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App activated! \n"));
+                   result = noErr;
                    break;
 
                  case kEventAppDeactivated:
@@ -668,6 +735,12 @@
                      PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App kHICommandQuit! \n"));
 
                  break;
+
+                 case MENU_ITEM_ID_BASE:
+                     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ApplicationProc App Manage Smart Cards! \n"));
+                     NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
+
+                 break;
             };
 
 
@@ -714,6 +787,8 @@
     //::InstallStandardEventHandler(target);
     ::InstallEventHandler(target,mEventHandlerUPP,numTypes,eventTypes, (void *) this,&mEventHandlerRef); 
 
+    ShowWindow();
+
     return S_OK;
 }
 
@@ -728,18 +803,18 @@
          if(IsWindowCollapsed(mWnd))
         { 
             PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow :  uncollapsing collapsed window. \n"));
-            ::CollapseWindow(mWnd,FALSE);
+            //::CollapseWindow(mWnd,FALSE);
          }
 
 
          if(!IsWindowVisible(mWnd))
          {
              PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow : Window not visible showing...  \n"));
-             ::ShowWindow(mWnd);
+             //::ShowWindow(mWnd);
          }
 
 
-         //::BringToFront(mWnd);
+         ::BringToFront(mWnd);
          PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow :  \n"));
 
          rhTray::ShowApp();
@@ -753,15 +828,6 @@
     {
 
          PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow \n"));
-
-         //OSStatus res = ::CollapseWindow(mWnd,TRUE);
-
-         //::HideWindow(mWnd);
-
-         rhTray::HideApp();
-
-         PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: HideWindow  \n"));
-
     }
 
 }
@@ -783,9 +849,6 @@
 
             PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener::WindowProc attempting Window close! \n"));
 
-            if(self)
-                self->HideWindow();
-            //result = noErr;
         break;
 
         case kEventWindowHidden:
--- ./esc/src/app/xpcom/tray/Makefile.moz.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xpcom/tray/Makefile.moz	2006-10-03 10:46:52.000000000 -0700
@@ -39,6 +39,12 @@
 
 -include $(MOZ_OBJDIR)/config/autoconf.mk
 
+DEPLOY_OFFSET=/esc
+ifeq ($(OS_ARCH),Linux)
+DEPLOY_OFFSET=/src
+endif
+
+
 OS_CXXFLAGS     +=  $(HOST_CXXFLAGS)
 
 #MODULE		= rhTray
@@ -133,8 +139,8 @@
 deploy::
 	echo "Deploying"
 	echo $(IMPORT_LIBRARY)
-	$(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)/src/app/xul/esc/components
-	$(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)/src/app/xul/esc/components
+	$(NSINSTALL) ./$(LIB_PREFIX)rhTray$(DLL_SUFFIX) $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/components
+	$(NSINSTALL) ./_xpidlgen/*.xpt $(INSTALL_STUFF) $(CORE_DEPTH)$(DEPLOY_OFFSET)/app/xul/esc/components
 
 
 # separate libraries linked in.
--- ./esc/src/app/xpcom/tray/rhTray.cpp.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhTray.cpp	2006-10-03 10:46:52.000000000 -0700
@@ -23,7 +23,7 @@
 
 NS_IMPL_ISUPPORTS1(rhTray, rhITray)
 
-#include "Winuser.h"
+#include "WinUser.h"
 
 HWND rhTray::mWnd = 0;
 int rhTray::mInitialized = 0;
@@ -34,8 +34,11 @@
 
 
 map< nsIBaseWindow *, rhTrayWindowListener *> rhTray::mWindowMap;
+map<unsigned int,string> rhTray::mMenuItemStringMap;
+
 NOTIFYICONDATA rhTray::mIconData;
 
+
 const TCHAR* LISTENER_INSTANCE = 
   TEXT("_RH_TRAY_WIND_LISTENER_INST");
 
@@ -121,7 +124,7 @@
 
     if(listener)
     {
-        listener->HideWindow();
+        //listener->HideWindow();
 
     }
 
@@ -311,6 +314,8 @@
     DestroyEventWindow();
     RemoveIcon();
 
+    rhTray::mMenuItemStringMap.clear();
+
     return S_OK;
 }
 
@@ -461,14 +466,11 @@
 
                     case ID_SHOW:
 
+                        NotifyTrayWindListeners(MENU_EVT,MENU_SHOW);
+
                         ShowAllListeners();
                     break;
                     
-                    case ID_HIDE:
-
-                        HideAllListeners();
-                    break;
-                 
                     case IDM_EXIT:
 
                         PostQuitMessage(0);
@@ -556,6 +558,8 @@
 {
   HMENU hMenu, hPopup = 0;
 
+  const int numMenuItems = 2;
+
   hMenu = ::LoadMenu (::GetModuleHandle("rhTray.dll"),
                       MAKEINTRESOURCE (PopupMenuResource));
 
@@ -567,6 +571,68 @@
 
     hPopup = ::GetSubMenu (hMenu, 0);
 
+    int numItems = rhTray::mMenuItemStringMap.size();
+
+
+    
+    PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowPopupMenu num menu item strings : %d\n",numItems));
+    // Change the menu items text if possible
+
+    MENUITEMINFO mii = {0};
+ 
+    unsigned int menuItemID = 0;
+
+    int i = 0;
+ 
+    if(numItems == numMenuItems)
+    {     
+        for (i = 0 ;i < numMenuItems; i++)
+        {
+             mii.cbSize = sizeof(MENUITEMINFO);
+             mii.fMask = MIIM_TYPE ;
+
+
+
+             char * itemText = (char *) (rhTray::mMenuItemStringMap[i]).c_str();
+
+             
+             PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowPopupMenu menutext: %d text %s \n",i,itemText));
+             if(itemText)
+             {
+
+                 if(i == 0)
+                 {
+                     menuItemID= ID_SHOW;                          
+                 }
+                 else
+                 {
+                      menuItemID= IDM_EXIT;
+
+                 }
+
+                 if( GetMenuItemInfo(hPopup,menuItemID,FALSE,&mii))
+                 {
+                     char *tmpBuff = NULL;
+
+                     tmpBuff = strdup(itemText);
+
+                     mii.cch=strlen(itemText);
+                     mii.dwTypeData=tmpBuff;
+                     SetMenuItemInfo(hPopup,menuItemID,FALSE,&mii);
+
+                     free(tmpBuff);
+                 }
+                 else
+                 {
+                     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::ShowPopupMenu Can't GetMenuItemInfo \n")); 
+
+                 }
+             }
+
+        }
+
+    }
+
     ::SetForegroundWindow (rhTray::mWnd);
 
     WORD cmd = ::TrackPopupMenu (hPopup, TPM_RIGHTBUTTON | TPM_RETURNCMD,
@@ -644,6 +710,18 @@
 /* void setmenuitemtext (in unsigned long aIndex, in string aText); */
 NS_IMETHODIMP rhTray::Setmenuitemtext(PRUint32 aIndex, const char *aText)
 {
+
+   
+   PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTray::Setmenuitemtext index: %d text: %s\n",aIndex, aText));
+
+   if(aIndex >= 0 && aIndex <= 10 && aText)
+   {
+       rhTray::mMenuItemStringMap[aIndex] = aText;
+
+   }
+
+
+
     return S_OK;
 }
 
@@ -798,12 +876,12 @@
                      }
 
                     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener Minimize\n"));
-                     eventClaimed = 1;
+                     //eventClaimed = 1;
                 break;
 
                 case HTMAXBUTTON:
                     PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Maximize  \n"));
-                    eventClaimed = 1;
+                    //eventClaimed = 1;
                 break;
                  
                 case HTCLOSE:
@@ -815,7 +893,7 @@
                         me->HideWindow();
                     }
 
-                    eventClaimed = 1;
+                    //eventClaimed = 1;
 
                 break;
 
@@ -943,9 +1021,9 @@
     if(mWnd)
     {
          PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: ShowWindow \n"));
-         ::ShowWindow(mWnd,SW_SHOW);
+         //::ShowWindow(mWnd,SW_SHOW);
 
-         ::ShowWindow(mWnd,SW_RESTORE);
+         //::ShowWindow(mWnd,SW_RESTORE);
 
     }
 
@@ -958,8 +1036,8 @@
 
         PR_LOG( trayLog, PR_LOG_DEBUG, ("rhTrayWindowListener:: Hide Window \n"));
 
-        ::ShowWindow(mWnd,SW_MINIMIZE);
-        ::ShowWindow(mWnd,SW_HIDE);
+        //::ShowWindow(mWnd,SW_MINIMIZE);
+        //::ShowWindow(mWnd,SW_HIDE);
 
     }
 }
--- ./esc/src/app/daemon/manifest.mn.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/daemon/manifest.mn	2006-10-03 10:46:52.000000000 -0700
@@ -20,15 +20,23 @@
 CORE_DIST= $(CORE_DEPTH)/dist/
 
 SYS_INC= /usr/include
+
+XULRUNNER_LIBS_LDFLAGS=
 ifndef MOZ_OFFSET
 MOZ_OFFSET      = mozilla-1.7.13
+else
+XULRUNNER_LIBS_LDFLAGS=$(CORE_DIST)/$(OBJDIR)/xulrunner_build/dist/lib
 endif
 
+
+
 DEFINES         +=  -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3  -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss
 
+DEFINES += $(shell pkg-config --cflags xft)
+
 CPPFLAGS		+= $(DEFINES) -g
 
-LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib  -lnss3 -lnspr4  -lssl3 -lckyapplet -lX11
+LDFLAGS += -lstdc++ -L$(CORE_DIST)/$(OBJDIR)/lib -L$(XULRUNNER_LIBS_LDFLAGS)  -lnss3 -lnspr4  -lssl3 -lckyapplet $(shell pkg-config --libs xft) 
 LDFLAGS +=  -lckymanager -lhttpchunked 
 # MODULE public and private header  directories are implicitly REQUIRED.
 
--- ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix19	2006-07-17 10:33:01.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/password.xul	2006-10-03 10:46:52.000000000 -0700
@@ -1,6 +1,21 @@
 <?xml version="1.0"?>
 <?xml-stylesheet href="esc.css" type="text/css"?>
-
+<!-- ***** BEGIN COPYRIGHT BLOCK *****
+ * This Program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; version 2 of the License.
+ *
+ * This Program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Copyright (C) 2005 Red Hat, Inc.
+ * All rights reserved.
+ ***** END COPYRIGHT BLOCK ***** -->
 <!DOCTYPE window SYSTEM "chrome://esc/locale/esc.dtd">
 <window
     class="escwindow"
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js	2006-10-03 10:46:52.000000000 -0700
@@ -830,6 +830,7 @@
 
     textDump +=   arr.length + "\n\n" ;
 
+    var i = 0;
     for(i = 0 ; i < arr.length ; i++)
     {
        keyID = arr[i][1];
@@ -842,7 +843,7 @@
        if(!issuer)
            issuer = getBundleString("unknownIssuer");
 
-       textDump += "***" + getBundleString("smartCardU") + " " + i + ":" + "***" + "\n\n";
+       textDump += getBundleString("smartCardU") + " " + i + ":"  + "\n\n";
 
        textDump += "  " + getBundleString("appletVersion") + " " + appletVerMaj + "." + appletVerMin + "\n";
 
@@ -881,11 +882,11 @@
        if(nicknames)
        {
            var cert_info = null;
-           for (i = 0; i < nicknames.length ; i ++)
+           for (j = 0; j < nicknames.length ; j ++)
            {
-                textDump += "    " + getBundleString("certificateNickname") + " " + nicknames[i] + " \n\n";
+                textDump += "    " + getBundleString("certificateNickname") + " " + nicknames[j] + " \n\n";
 
-                cert_info = GetCoolKeyCertInfo(keyType,keyID,nicknames[i]);
+                cert_info = GetCoolKeyCertInfo(keyType,keyID,nicknames[j]);
 
                 var cert_split = cert_info.split("\n");
 
@@ -3954,7 +3955,30 @@
 
 function launchCONFIG(keyType,keyID)
 {
-    var wind = window.openDialog("chrome://esc/content/config.xul",keyID,"chrome,centerscreen,resizable,modal=yes");
+
+    var agent = navigator.userAgent.toLowerCase();
+
+    var platform = "";
+
+    if(agent && agent.indexOf("mac") != -1)
+    {
+        platform = "mac";
+    }
+
+    var wind = null;
+
+
+    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");
+
+
+    }
 }
 
 function launchCertViewer()
--- ./esc/src/app/xul/esc/chrome/content/esc/password.js.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/password.js	2006-10-03 10:46:52.000000000 -0700
@@ -1,3 +1,19 @@
+/** BEGIN COPYRIGHT BLOCK
+ * This Program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation; version 2 of the License.
+ *
+ * This Program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA.
+ *
+ * Copyright (C) 2005 Red Hat, Inc.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
 
 var parentWindow = window.opener;
 
--- ./esc/src/xulrunner/Makefile.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/src/xulrunner/Makefile	2006-10-03 10:46:52.000000000 -0700
@@ -42,7 +42,9 @@
 
 $(MOZ_OBJDIR): $(MOZ_SRCDIR)/.mozconfig $(MOZ_SRCDIR)/client.mk
 	(cd $(MOZ_SRCDIR) ; make -f client.mk build ) 
+ifneq ($(OS_ARCH),Darwin)
 	(cd $(MOZ_OBJDIR)/xulrunner/installer ; make )
+endif
 	touch $(MOZ_OBJDIR)
 
 $(MOZ_SRCDIR)/.mozconfig: $(SOURCE_XP_DIR)/target.$(TYPE)
--- ./esc/rpm/esc.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/rpm/esc	2006-10-03 10:46:52.000000000 -0700
@@ -1,11 +1,104 @@
 #!/bin/sh
-export NSPR_LOG_MODULES=tray:2,coolKeyLib:2,coolKey:2,coolKeyNSS:2,coolKeySmart:2,coolKeyHandler:2
+# 
+# BEGIN COPYRIGHT BLOCK
+# This Program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation; version 2 of the License.
+#
+# This Program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this Program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA.
+#
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+# END COPYRIGHT BLOCK
 
-if [ ! -d ~/.redhat/esc ]
+ESC_PROFILE_BASE=~/.redhat/esc
+ESC_LOG_FILE=esc.log
+
+ESC_PATH=$LIBDIR/esc-1.0.0
+ESC_BIN_PATH=/usr/bin
+ESC_EXEC=esc
+ESCD_EXEC=escd
+
+ESC_BIN=$ESC_PATH/xulrunner/xulrunner-bin
+ESCD_BIN=./$ESCD_EXEC
+
+LAST_PROG_PID=0
+SIGUSR1=10
+
+FORCE_START_ESC=$1
+
+XPTI_DAT=xpti.dat
+COMPREG_DAT=compreg.dat
+
+function isProgRunning {
+
+    userID=$(whoami)
+    isProgRunning=$(pgrep -U $userID -f $1)
+    if [ $isProgRunning  ];
+    then
+        LAST_PROG_PID=$isProgRunning
+        return 0
+    fi
+    LAST_PROG_PID=0
+    return 1 
+}
+
+function removeFile {
+
+    if [  -w  $1 ]
+    then
+       rm -f $1
+    fi
+}
+
+
+export NSPR_LOG_MODULES=tray:2,coolKeyLib:2,coolKey:2,coolKeyNSS:2,coolKeySmart:2,coolKeyHandler:2,escDLog:5
+
+
+if [ ! -d $ESC_PROFILE_BASE ]
+then
+mkdir -p  $ESC_PROFILE_BASE
+fi
+export NSPR_LOG_FILE=$ESC_PROFILE_BASE/$ESC_LOG_FILE
+
+cd $ESC_PATH
+
+isProgRunning $ESC_BIN
+
+if [  $LAST_PROG_PID  -gt 0 ]
+then
+./$ESC_EXEC
+exit 0
+fi
+
+if [ $FORCE_START_ESC ]
+then
+./$ESC_EXEC
+exit 0
+fi
+
+
+
+isProgRunning $ESCD_BIN
+
+
+if  [ $LAST_PROG_PID  -gt 0 ]
 then
-mkdir -p ~/.redhat/esc
+kill -$SIGUSR1 $LAST_PROG_PID
+else
+removeFile $ESC_PROFILE_BASE/*default/$XPTI_DAT
+removeFile $ESC_PROFILE_BASE/*default/$COMPREG_DAT
+./$ESCD_EXEC --key_Inserted=\"/usr/bin/esc\"  --on_Signal=\"/usr/bin/esc\"
+
 fi
 
-export NSPR_LOG_FILE=~/.redhat/esc/esc.log
-cd  $LIBDIR/esc-1.0.0
-./esc
+exit 0
+
+
+
--- ./esc/rpm/esc.spec.fix19	2006-10-03 10:46:52.000000000 -0700
+++ ./esc/rpm/esc.spec	2006-10-03 10:46:52.000000000 -0700
@@ -1,6 +1,25 @@
+# BEGIN COPYRIGHT BLOCK
+# Copyright (C) 2005 Red Hat, Inc.
+# All rights reserved.
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation version
+# 2.1 of the License.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+# END COPYRIGHT BLOCK
+
 Name: esc 
 Version: 1.0.0
-Release: 8%{?dist} 
+Release: 16%{?dist} 
 Summary: Enterprise Security Client Smart Card Client
 License: GPL
 URL: http://directory.fedora.redhat.com/wiki/CoolKey 
@@ -15,6 +34,15 @@
 Patch5: esc-1.0.0-xul-sys-nss-nspr.patch
 Patch6: esc-1.0.0-ui-enhance.patch
 Patch7: esc-1.0.0-notify-icon-fixes.patch
+Patch8: esc-1.0.0-strings-fix.patch
+Patch11: esc-1.0.0.strings-1-fix.patch
+Patch12: esc-1.0.0-ui-enhance-1.patch
+Patch13: esc-1.0.0-pw-reset-fix.patch
+Patch14: esc-1.0.0-escd.patch
+Patch15: esc-1.0.0-escd1.patch
+Patch16: esc-1.0.0-escd2.patch
+Patch17: esc-1.0.0-build-fix.patch
+Patch18: esc-1.0.0-diag-fix.patch
 
 BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1
 BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel
@@ -68,6 +96,15 @@
 %patch5 -p1 -b .fix5
 %patch6 -p1 -b .fix6
 %patch7 -p1 -b .fix7
+%patch8 -p1 -b .fix8
+%patch11 -p1 -b .fix11
+%patch12 -p1 -b .fix12
+%patch13 -p1 -b .fix13
+%patch14 -p1 -b .fix14
+%patch15 -p1 -b .fix15
+%patch16 -p1 -b .fix16
+%patch17 -p1 -b .fix17
+%patch18 -p1 -b .fix18
 
 #Unpack xulrunner where esc expects it to be.
 
@@ -143,6 +180,7 @@
 %defattr(-,root,root,-)
 
 %{escdir}/esc
+%{escdir}/escd
 %{escbindir}/esc
 %{escdir}/application.ini
 
@@ -175,7 +213,28 @@
 fi
 
 %changelog
-* Sat Aug 22 2006 Jack Magne <jmagne at redhat.com>-  1.0.0-8
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>= 1.0.0-15
+- Fix to the build version
+
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>= 1.0.0-14
+- Fix to compile error in daemon
+
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-13
+- Fix to include the new esc daemon.  
+
+* Sat Sep 16 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-12
+- Fix for Password Reset and minor UI revision.
+
+* Fri Sep 15 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-11
+- Further UI enhancement bug fixes
+
+* Thu Sep 7 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-10
+- Further strings revisions.
+
+* Wed Aug 30 2006 Jack Magne <jmagne at redhat.com>-  1.0.0-9
+- Revision of the strings used in ESC.
+
+* Sat Aug 27 2006 Jack Magne <jmagne at redhat.com>-  1.0.0-8
 - Fixes to get libnotify working properly on FC6 systems.
 
 * Tue Aug 22 2006 Jack Magne <jmagne at redhat.com> - 1.0.0-7


Index: esc.spec
===================================================================
RCS file: /cvs/dist/rpms/esc/devel/esc.spec,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- esc.spec	1 Oct 2006 21:16:08 -0000	1.20
+++ esc.spec	4 Oct 2006 21:59:09 -0000	1.21
@@ -1,6 +1,6 @@
 Name: esc 
 Version: 1.0.0
-Release: 16%{?dist} 
+Release: 17%{?dist} 
 Summary: Enterprise Security Client Smart Card Client
 License: GPL
 URL: http://directory.fedora.redhat.com/wiki/CoolKey 
@@ -23,6 +23,8 @@
 Patch15: esc-1.0.0-escd1.patch
 Patch16: esc-1.0.0-escd2.patch
 Patch17: esc-1.0.0-build-fix.patch
+Patch18: esc-1.0.0-diag-fix.patch
+Patch19: esc-1.0.0-mac-win-fix.patch
 
 BuildRequires: doxygen fontconfig-devel freetype-devel >= 2.1
 BuildRequires: glib2-devel libIDL-devel atk-devel gtk2-devel libjpeg-devel
@@ -84,6 +86,8 @@
 %patch15 -p1 -b .fix15
 %patch16 -p1 -b .fix16
 %patch17 -p1 -b .fix17
+%patch18 -p1 -b .fix18
+%patch19 -p1 -b .fix19
 
 #Unpack xulrunner where esc expects it to be.
 
@@ -109,7 +113,7 @@
 
 cd ../..
 
-make BUILD_OPT=1 HAVE_LIB_NOTIFY=1
+make BUILD_OPT=1 HAVE_LIB_NOTIFY=1 ESC_VERSION=%{version}-%{release}
 
 %install
 
@@ -192,13 +196,16 @@
 fi
 
 %changelog
+* Sun Oct 4  2006 Jack Magne <jmagne at redhat.com>- 1.0.0-17
+- Diagnostics display fixes, Mac and Window fixes.
+
 * Sun Oct 01 2006 Jesse Keating <jkeating at redhat.com> - 1.0.0-16
 - rebuilt for unwind info generation, broken in gcc-4.1.1-21
 
-* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com> - 1.0.0-15
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-15
 - Fix to the build version
 
-* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com> - 1.0.0-14
+* Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>= 1.0.0-14
 - Fix to compile error in daemon
 
 * Fri Sep 22 2006 Jack Magne <jmagne at redhat.com>- 1.0.0-13




More information about the fedora-cvs-commits mailing list