From 0070dfee972dbfbda33cca54ba591e8e2d8be7a0 Mon Sep 17 00:00:00 2001 From: Jack Magne Date: Tue, 15 Sep 2009 21:31:06 +0000 Subject: [PATCH] Pick up latest improvements. --- .cvsignore | 3 +- esc | 24 +- esc-1.0.1-admin-row-update.patch | 37 - esc-1.0.1-elif.patch | 14 - esc-1.0.1-lic-fix.patch | 11 - esc-1.0.1-log-fixes-1.patch | 131 -- esc-1.0.1-log-fixes.patch | 782 ---------- esc-1.0.1-nss-devel-fix.patch | 14 - esc-1.0.1-ui-fixes-1.patch | 1906 ------------------------- esc-1.0.1-xulrunner-sparc-fixes.patch | 69 - esc-1.1.0-fix1.patch | 38 + esc-1.1.0-fix2.patch | 51 + esc-1.1.0-fix3.patch | 22 + esc-1.1.0-fix4.patch | 22 + esc-1.1.0-fix5.patch | 218 +++ esc-1.1.0-fix6.patch | 884 ++++++++++++ esc-1.1.0-fix7.patch | 69 + esc.spec | 215 +-- firefox-1.5-with-system-nss.patch | 627 -------- firefox.secalg.patch | 12 - import.log | 1 + sources | 3 +- 22 files changed, 1424 insertions(+), 3729 deletions(-) delete mode 100644 esc-1.0.1-admin-row-update.patch delete mode 100644 esc-1.0.1-elif.patch delete mode 100644 esc-1.0.1-lic-fix.patch delete mode 100644 esc-1.0.1-log-fixes-1.patch delete mode 100644 esc-1.0.1-log-fixes.patch delete mode 100644 esc-1.0.1-nss-devel-fix.patch delete mode 100644 esc-1.0.1-ui-fixes-1.patch delete mode 100644 esc-1.0.1-xulrunner-sparc-fixes.patch create mode 100644 esc-1.1.0-fix1.patch create mode 100644 esc-1.1.0-fix2.patch create mode 100644 esc-1.1.0-fix3.patch create mode 100644 esc-1.1.0-fix4.patch create mode 100644 esc-1.1.0-fix5.patch create mode 100644 esc-1.1.0-fix6.patch create mode 100644 esc-1.1.0-fix7.patch delete mode 100644 firefox-1.5-with-system-nss.patch delete mode 100644 firefox.secalg.patch create mode 100644 import.log diff --git a/.cvsignore b/.cvsignore index c69122e..6615204 100644 --- a/.cvsignore +++ b/.cvsignore @@ -1,2 +1 @@ -esc-1.0.1.tar.bz2 -xulrunner-1.8.0.4-source.tar.bz2 +esc-1.1.0.tar.bz2 diff --git a/esc b/esc index bc23c86..cb0d44d 100755 --- a/esc +++ b/esc @@ -18,10 +18,6 @@ # END COPYRIGHT BLOCK - - -DO_SECMODE="false" -SECURITY_URL= DO_FORCEMODE="false" DO_SHOW_VERSION="false" ESC_ARGS= @@ -30,7 +26,7 @@ ESC_ARGS= ESC_PROFILE_BASE=~/.redhat/esc ESC_LOG_FILE=esc.log -ESC_PATH=$LIBDIR/esc-1.0.1 +ESC_PATH=$LIBDIR/esc-1.1.0 ESC_BIN_PATH=/usr/bin ESC_EXEC=esc ESCD_EXEC=escd @@ -97,25 +93,10 @@ function processArgs { #echo "Do show version!" DO_SHOW_VERSION="true" fi - if [ $DO_SECMODE == "true" ] - then - #echo "Sec Mode Url $arg" - SECURITY_URL=$arg - fi - if [ $arg == "-secmode" ] - then - DO_SECMODE="true" - #echo "Do security mode!" - fi done - - if [ $DO_SECMODE == "true" ] - then - #echo "Launch ESC in security mode!" - ARGS="--secmode $SECURITY_URL" - fi } + processArgs $* if [ ! -d $ESC_PROFILE_BASE ] @@ -180,7 +161,6 @@ else #echo "esc not already running start up and bring up window." ./$ESC_EXEC & sleep 4 - #echo "done sleeping bring up esc window." ./$ESC_EXEC exit 0 diff --git a/esc-1.0.1-admin-row-update.patch b/esc-1.0.1-admin-row-update.patch deleted file mode 100644 index d8bca92..0000000 --- a/esc-1.0.1-admin-row-update.patch +++ /dev/null @@ -1,37 +0,0 @@ ---- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix3 2007-04-03 11:00:47.000000000 -0700 -+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2007-04-03 11:00:51.000000000 -0700 -@@ -2249,6 +2249,7 @@ - } - function UpdateAdminListRow( keyType, keyID) - { -+ - if(!gAdminPage) - return; - -@@ -2527,6 +2528,7 @@ - { - recordMessage("EnrollCoolKey failed."); - } -+ - if(gAdminPage) - { - UpdateAdminListRow(keyType,keyID); -@@ -3778,11 +3780,14 @@ - UpdateEnrollmentArea(keyType,keyID,1); - } - -- if(gAdminPage) -+ -+ var adminWnd = IsPageWindowPresent(ADMIN_WINDOW); -+ -+ if(adminWnd) - { -- SelectRowByKeyID(keyType, keyID); -- UpdateAdminListRow(keyType,keyID); -- UpdateAdminKeyDetailsArea(keyType,keyID); -+ adminWnd.SelectRowByKeyID(keyType, keyID); -+ adminWnd.UpdateAdminListRow(keyType,keyID); -+ adminWnd.UpdateAdminKeyDetailsArea(keyType,keyID); - } - } - diff --git a/esc-1.0.1-elif.patch b/esc-1.0.1-elif.patch deleted file mode 100644 index 50544a2..0000000 --- a/esc-1.0.1-elif.patch +++ /dev/null @@ -1,14 +0,0 @@ -Patch by Robert Scheck for esc >= 1.0.1, that corrects -the preprocessor conditional from empty (wrong) elif to else. - ---- mozilla/toolkit/xre/nsAppRunner.cpp 2006-04-06 19:27:00.000000000 +0200 -+++ mozilla/toolkit/xre/nsAppRunner.cpp.elif 2009-04-14 05:35:25.000000000 +0200 -@@ -1157,7 +1157,7 @@ - if (NS_FAILED(rv)) - return rv; - --#elif -+#else - #error Oops, you need platform-specific code here - #endif - diff --git a/esc-1.0.1-lic-fix.patch b/esc-1.0.1-lic-fix.patch deleted file mode 100644 index e047c1d..0000000 --- a/esc-1.0.1-lic-fix.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- ./esc/src/app/xul/esc/application.ini.fix7 2007-08-30 10:13:53.000000000 -0700 -+++ ./esc/src/app/xul/esc/application.ini 2007-08-30 10:14:19.000000000 -0700 -@@ -25,7 +25,7 @@ - Name=ESC - ; - ; This field specifies your application's version. This field is optional. --Version=1.0.1-5 -+Version=1.0.1-7 - ; - ; This field specifies your application's build ID (timestamp). This field is - ; required. diff --git a/esc-1.0.1-log-fixes-1.patch b/esc-1.0.1-log-fixes-1.patch deleted file mode 100644 index 0e0bb15..0000000 --- a/esc-1.0.1-log-fixes-1.patch +++ /dev/null @@ -1,131 +0,0 @@ ---- ./esc/src/lib/coolkey/NSSManager.cpp.fix6 2007-07-17 13:37:43.000000000 -0700 -+++ ./esc/src/lib/coolkey/NSSManager.cpp 2007-07-17 13:38:40.000000000 -0700 -@@ -46,11 +46,13 @@ - - static PRLogModuleInfo *coolKeyLogNSS = PR_NewLogModule("coolKeyNSS"); - -+unsigned int NSSManager::lastError; - NSSManager::NSSManager() - { - char tBuff[56]; - PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::NSSManager:\n",GetTStamp(tBuff,56))); - mpSCMonitoringThread = NULL; -+ NSSManager::lastError = NSS_NO_ERROR; - #ifdef LINUX - systemCertDB = NULL; - #endif -@@ -111,6 +113,8 @@ - if(!userModule || !userModule->loaded) - { - PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager::InitNSS problem loading PKCS11 module. No keys will be recognized!\n",GetTStamp(tBuff,56))); -+ -+ NSSManager::lastError = NSS_ERROR_LOAD_COOLKEY; - return E_FAIL; - } - -@@ -132,6 +136,7 @@ - mpSCMonitoringThread = new SmartCardMonitoringThread(userModule); - if (!mpSCMonitoringThread) { - SECMOD_UnloadUserModule(userModule); -+ NSSManager::lastError = NSS_ERROR_SMART_CARD_THREAD; - return E_FAIL; - } - mpSCMonitoringThread->Start(); ---- ./esc/src/lib/coolkey/CoolKey.cpp.fix6 2007-07-17 13:37:29.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.cpp 2007-07-17 13:38:28.000000000 -0700 -@@ -1325,7 +1325,10 @@ - return E_FAIL; - - if(g_Log->IsInitialized()) -+ { -+ CoolKeyLogNSSStatus(); - return S_OK; -+ } - else - return E_FAIL; - } -@@ -1348,6 +1351,35 @@ - return S_OK; - } - -+COOLKEY_API HRESULT CoolKeyLogNSSStatus() -+{ -+ -+ char tBuff[56]; -+ if (g_NSSManager) -+ { -+ unsigned int error = g_NSSManager->GetLastInitError(); -+ -+ if(error == NSS_NO_ERROR) -+ { -+ CoolKeyLogMsg( PR_LOG_ALWAYS, "%s NSS system intialized successfully!\n",GetTStamp(tBuff,56)); -+ return S_OK; -+ } -+ -+ if(error == NSS_ERROR_LOAD_COOLKEY) -+ { -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Failed to load CoolKey module! Keys will not be recognized!\n",GetTStamp(tBuff,56)); -+ } -+ -+ if(error == NSS_ERROR_SMART_CARD_THREAD) -+ { -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Problem initializing the Smart Card thread! Keys will not be recognized!\n",GetTStamp(tBuff,56)); -+ } -+ } -+ -+ return S_OK; -+ -+} -+ - //Utility function to get Time Stamp - char *GetTStamp(char *aTime,int aSize) - { ---- ./esc/src/lib/coolkey/NSSManager.h.fix6 2007-07-17 13:37:51.000000000 -0700 -+++ ./esc/src/lib/coolkey/NSSManager.h 2007-07-17 13:38:43.000000000 -0700 -@@ -26,6 +26,10 @@ - #define PROMISCUOUS_PARAMETER "noAppletOK=yes" - #define NSS_PUBLIC_CERTS "slotFlags=PublicCerts" - -+#define NSS_NO_ERROR 0 -+#define NSS_ERROR_LOAD_COOLKEY 1 -+#define NSS_ERROR_SMART_CARD_THREAD 2 -+ - #ifndef NSSMANAGER_H - #define NSSMANAGER_H - -@@ -70,11 +74,14 @@ - - static HRESULT GetKeyIssuer(const CoolKey *aKey, char *aBuf, int aBufLength); - -+ static unsigned int GetLastInitError() { return lastError;} - - private: - - static bool IsCACert(CERTCertificate *cert); - -+ static unsigned int lastError; -+ - #ifdef LINUX - PK11SlotInfo *systemCertDB; - #endif ---- ./esc/src/lib/coolkey/CoolKey.h.fix6 2007-07-17 13:37:35.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.h 2007-07-17 13:38:33.000000000 -0700 -@@ -180,6 +180,7 @@ - - COOLKEY_API HRESULT CoolKeyLogMsg(int logLevel, const char *fmt, ...); - -+COOLKEY_API HRESULT CoolKeyLogNSSStatus(); - - //Utility time function - char *GetTStamp(char *aTime,int aSize); ---- ./esc/src/app/xul/esc/application.ini.fix6 2007-07-17 13:36:59.000000000 -0700 -+++ ./esc/src/app/xul/esc/application.ini 2007-07-17 13:37:16.000000000 -0700 -@@ -25,7 +25,7 @@ - Name=ESC - ; - ; This field specifies your application's version. This field is optional. --Version=1.0.1-4 -+Version=1.0.1-5 - ; - ; This field specifies your application's build ID (timestamp). This field is - ; required. diff --git a/esc-1.0.1-log-fixes.patch b/esc-1.0.1-log-fixes.patch deleted file mode 100644 index 7ce2580..0000000 --- a/esc-1.0.1-log-fixes.patch +++ /dev/null @@ -1,782 +0,0 @@ ---- ./esc/src/lib/coolkey/CoolKey.cpp.fix5 2007-06-20 11:41:52.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.cpp 2007-06-20 11:46:20.000000000 -0700 -@@ -16,6 +16,7 @@ - * END COPYRIGHT BLOCK **/ - - #define FORCE_PR_LOG 1 -+#define LINE_BUF_SIZE 512 - - #include "SlotUtils.h" - -@@ -46,6 +47,161 @@ - HRESULT ClearActiveKeyList(void); - ActiveKeyNode *GetNodeInActiveKeyList(const CoolKey *aKey); - -+class CoolKeyLogger { -+public: -+ -+ CoolKeyLogger(char *logFileName, int maxNumLines); -+ ~CoolKeyLogger(); -+ -+ void LogMsg(int logLevel, const char *fmt, ...); -+ void LogMsg(int logLevel,const char *msg, va_list argp); -+ -+ void init(); -+ -+ int IsInitialized() { return initialized; } -+ -+private: -+ -+ void LockLog(); -+ void UnlockLog(); -+ -+ PRLock *logLock; -+ -+ int maxLines; -+ -+ char *pathName; -+ PRFileDesc *fd; -+ -+ int initialized; -+ -+}; -+ -+CoolKeyLogger::CoolKeyLogger(char *logFileName, int maxNumLines) -+{ -+ fd = NULL; -+ logLock = NULL; -+ -+ maxLines = maxNumLines; -+ if(logFileName) -+ pathName = strdup(logFileName); -+ initialized = 0; -+} -+ -+CoolKeyLogger::~CoolKeyLogger() -+{ -+ char tBuff[56]; -+ -+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s ~CoolKeyLogger:\n",GetTStamp(tBuff,56))); -+ LockLog(); -+ -+ PR_Close(fd); -+ -+ fd = NULL; -+ -+ UnlockLog(); -+ -+ PR_DestroyLock(logLock); -+ -+ logLock = NULL; -+ -+ if(pathName) -+ free(pathName); -+ -+ pathName = NULL; -+} -+ -+void CoolKeyLogger::LockLog() -+{ -+ PR_Lock(logLock); -+} -+ -+void CoolKeyLogger::UnlockLog() -+{ -+ PR_Unlock(logLock); -+} -+ -+void CoolKeyLogger::init() -+{ -+ char tBuff[56]; -+ -+ PRFileInfo info; -+ -+ if( !pathName) -+ return; -+ -+ logLock = PR_NewLock(); -+ -+ PRStatus rv = PR_GetFileInfo(pathName,&info); -+ -+ int fileSize = 0; -+ -+ if(rv == PR_SUCCESS) -+ { -+ fileSize = info.size; -+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s File info size %d! \n",GetTStamp(tBuff,56),fileSize)); -+ } -+ -+ //Assume average line size of about 40 -+ -+ if((fileSize / 40) > maxLines) -+ { -+ -+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s Number of lines too big, truncate file %d! \n",GetTStamp(tBuff,56),fileSize / 80)); -+ -+ fd = PR_Open(pathName, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE, 0600); -+ } -+ else -+ { -+ fd = PR_Open(pathName, PR_WRONLY | PR_CREATE_FILE | PR_APPEND, 0600); -+ } -+ -+ if(!fd) -+ return; -+ -+ initialized = 1; -+ -+ return; -+} -+ -+void CoolKeyLogger::LogMsg(int logLevel, const char *fmt, ...) -+{ -+ va_list ap; -+ char line[LINE_BUF_SIZE]; -+ -+ if(!initialized) -+ return; -+ -+ va_start(ap, fmt); -+ -+ int end = PR_vsnprintf(line, sizeof(line)-1, fmt, ap); -+ -+ LockLog(); -+ -+ PR_Write(fd,line,end); -+ -+ UnlockLog(); -+ -+ va_end(ap); -+} -+ -+void CoolKeyLogger::LogMsg(int logLevel, const char *msg, va_list argp) -+{ -+ char line[LINE_BUF_SIZE]; -+ -+ if(!initialized) -+ return; -+ -+ int end = PR_vsnprintf(line, sizeof(line)-1, msg, argp); -+ -+ LockLog(); -+ -+ PR_Write(fd,line,end); -+ -+ UnlockLog(); -+} -+ -+static CoolKeyLogger *g_Log = NULL; -+ - COOLKEY_API HRESULT CoolKeyInit(const char *aAppDir) - { - char tBuff[56]; -@@ -92,6 +248,9 @@ - g_NSSManager = 0; - } - -+ if(g_Log) -+ delete g_Log ; -+ - return S_OK; - } - -@@ -903,7 +1062,7 @@ - - assert(cardCtxt); - if (!cardCtxt) { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Can't create Card Context !.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Can't create Card Context !.\n",GetTStamp(tBuff,56)); - result = E_FAIL; - goto done; - } -@@ -911,7 +1070,7 @@ - conn = CKYCardConnection_Create(cardCtxt); - assert(conn); - if (!conn) { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Can't create Card Connection!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Can't create Card Connection!\n",GetTStamp(tBuff,56)); - result = E_FAIL; - goto done; - } -@@ -919,14 +1078,14 @@ - readerName = GetReaderNameForKeyID(aKey); - assert(readerName); - if (!readerName) { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Can't get reader name!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Can't get reader name!\n",GetTStamp(tBuff,56)); - result = E_FAIL; - goto done; - } - - status = CKYCardConnection_Connect(conn, readerName); - if (status != CKYSUCCESS) { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Can't connect to Card!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Can't connect to Card!\n",GetTStamp(tBuff,56)); - - result = E_FAIL; - goto done; -@@ -938,7 +1097,7 @@ - apduRC = 0; - status = CKYApplet_SelectCoolKeyManager(conn, &apduRC); - if (status != CKYSUCCESS) { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Can't select CoolKey manager!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Can't select CoolKey manager!\n",GetTStamp(tBuff,56)); - goto done; - } - -@@ -946,7 +1105,7 @@ - &apduRC); - if(status != CKYSUCCESS) - { -- PR_LOG( coolKeyLog, PR_LOG_ERROR, ("%s Attempting to get key issuer info. Error actually getting IssuerInfo!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Attempting to get key issuer info. Error actually getting IssuerInfo!\n",GetTStamp(tBuff,56)); - result = E_FAIL; - goto done; - } -@@ -1153,6 +1312,42 @@ - return res; - } - -+HRESULT CoolKeyInitializeLog(char *logFileName, int maxNumLines) -+{ -+ if(g_Log) -+ return S_OK; -+ -+ g_Log = new CoolKeyLogger(logFileName,maxNumLines); -+ -+ if(g_Log) -+ g_Log->init(); -+ else -+ return E_FAIL; -+ -+ if(g_Log->IsInitialized()) -+ return S_OK; -+ else -+ return E_FAIL; -+} -+ -+HRESULT CoolKeyLogMsg(int logLevel, const char *fmt, ...) -+{ -+ -+ if(!g_Log) -+ return S_OK; -+ -+ va_list ap; -+ -+ -+ va_start(ap, fmt); -+ -+ g_Log->LogMsg(logLevel,fmt,ap); -+ -+ va_end(ap); -+ -+ return S_OK; -+} -+ - //Utility function to get Time Stamp - char *GetTStamp(char *aTime,int aSize) - { ---- ./esc/src/lib/coolkey/CoolKey.h.fix5 2007-06-20 11:42:04.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.h 2007-06-20 11:46:37.000000000 -0700 -@@ -176,6 +176,11 @@ - - COOLKEY_API int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor); - -+COOLKEY_API HRESULT CoolKeyInitializeLog(char *logFileName, int maxNumLines); -+ -+COOLKEY_API HRESULT CoolKeyLogMsg(int logLevel, const char *fmt, ...); -+ -+ - //Utility time function - char *GetTStamp(char *aTime,int aSize); - } ---- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix5 2007-06-20 11:42:18.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp 2007-06-20 11:46:26.000000000 -0700 -@@ -453,7 +453,7 @@ - const char *readerName = NULL; - - if (!aKey || aKey->mKeyType != eCKType_CoolKey || !aKey->mKeyID) { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Insuficient input parameters. \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Insuficient input parameters. \n",GetTStamp(tBuff,56)); - goto done; - } - -@@ -466,14 +466,14 @@ - - - if (!readerName) { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Cannot locate card reader name! \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Cannot locate card reader name! \n",GetTStamp(tBuff,56)); - goto done; - } - - mDataLock = PR_NewLock(); - if (!mDataLock) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Cannnot initialize internal locking mechanism.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Cannnot initialize internal locking mechanism.\n",GetTStamp(tBuff,56)); - return E_FAIL; - - } -@@ -481,7 +481,7 @@ - mDataCondVar = PR_NewCondVar(mDataLock); - if (!mDataCondVar) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Cannot initialize internal syncronization mechanism.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Cannot initialize internal syncronization mechanism.\n",GetTStamp(tBuff,56)); - return E_FAIL; - - } -@@ -493,7 +493,7 @@ - - if(!mCharHostName || !mRAUrl) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Didn't collect proper config information.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Didn't collect proper config information.\n",GetTStamp(tBuff,56)); - error_no = config_error_no; - goto done; - } -@@ -502,7 +502,7 @@ - - mCardContext = CKYCardContext_Create(SCARD_SCOPE_USER); - if (!mCardContext) { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Cannot create card context! \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Cannot create card context! \n",GetTStamp(tBuff,56)); - error_no = CARD_CONTEXT_ERROR; - goto done; - } -@@ -510,7 +510,7 @@ - mPDUWriter = new PDUWriterThread(this); - if (!mPDUWriter) { - error_no = PDU_WRITER_ERROR; -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Cannot begin CoolKey operation. Cannot create internal PDU writer thread!\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Cannot begin CoolKey operation. Cannot create internal PDU writer thread!\n",GetTStamp(tBuff,56)); - goto done; - } - -@@ -581,7 +581,7 @@ - - if(!keyID) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR,("%s Collecting CoolKey preferences. Cannot get keyID , cannot proceed. \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR,"%s Collecting CoolKey preferences. Cannot get keyID , cannot proceed. \n",GetTStamp(tBuff,56)); - - return; - } -@@ -621,7 +621,7 @@ - - if(!tps_url) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Collecting CoolKey preferences. Cannot find value for the TPS URL. \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Collecting CoolKey preferences. Cannot find value for the TPS URL. \n",GetTStamp(tBuff,56)); - - return; - } -@@ -651,7 +651,7 @@ - pos = tps_url_str.find(non_ssl_str,0); - if(pos == string::npos) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Collecting CoolKey preferences. TPS URL has specified an illegal protocol! \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Collecting CoolKey preferences. TPS URL has specified an illegal protocol! \n",GetTStamp(tBuff,56)); - return; - } - -@@ -692,7 +692,7 @@ - - if(!host_name_port_str.length()) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Collecting CoolKey preferences. Bad hostname and port value!.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg(PR_LOG_ERROR, "%s Collecting CoolKey preferences. Bad hostname and port value!.\n",GetTStamp(tBuff,56)); - return; - } - -@@ -1198,7 +1198,7 @@ - PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("%s CoolKeyHandler::ProcessTokenPDU:\n",GetTStamp(tBuff,56))); - if(!req || !context) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Processing HTTP message. Bad input data. \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Processing HTTP message. Bad input data. \n",GetTStamp(tBuff,56)); - return; - } - -@@ -1210,7 +1210,7 @@ - - if(size == 0) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Processing HTTP message. Can't extract PDU data from message! \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg(PR_LOG_ERROR, "%s Processing HTTP message. Can't extract PDU data from message! \n",GetTStamp(tBuff,56)); - context->HttpDisconnect(); - return; - } -@@ -1231,10 +1231,10 @@ - CKYStatus status = CKYCardConnection_ExchangeAPDU(context->GetCardConnection(), - requestAPDU, &response); - if (status != CKYSUCCESS) { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, -- ("%s Processing HTTP message. Can't write apdu to card! status %d response[0] %x response[1] %x error %d \n" -+ CoolKeyLogMsg( PR_LOG_ERROR, -+ "%s Processing HTTP message. Can't write apdu to card! status %d response[0] %x response[1] %x error %d \n" - ,GetTStamp(tBuff,56) ,status,CKYBuffer_GetChar(&response,0),CKYBuffer_GetChar(&response,1), -- CKYCardConnection_GetLastError(context->GetCardConnection()))); -+ CKYCardConnection_GetLastError(context->GetCardConnection())); - - context->HttpDisconnect(ERR_CONN_TOKEN); - -@@ -1248,7 +1248,7 @@ - - if(pduSizeRet == 0 || !pduDataRet ) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Processing HTTP message. No PDU response from card! \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Processing HTTP message. No PDU response from card! \n",GetTStamp(tBuff,56)); - context->HttpDisconnect(ERR_CONN_TOKEN); - return; - } -@@ -1267,7 +1267,7 @@ - - if(res == 0) - { -- PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("%s Processing HTTP message. Write back to TPS failed , disconnecting. \n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ERROR, "%s Processing HTTP message. Write back to TPS failed , disconnecting. \n",GetTStamp(tBuff,56)); - context->HttpDisconnect(); - } - else -@@ -1619,32 +1619,33 @@ - case ENROLL: - if (result == 0) { - -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Enrollment success.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg(PR_LOG_ALWAYS,"%s Key Enrollment success.\n",GetTStamp(tBuff,56)); - CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN()); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_EnrollmentComplete, - context->GetScreenName() == NULL ? 1 : 0); - } else { -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Enrollment failure. Error: %d.\n",GetTStamp(tBuff,56),description)); -+ CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Key Enrollment failure. Error: %d.\n",GetTStamp(tBuff,56),description); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_EnrollmentError, description); // XXX: Need INIT_FAILED error code! - } - break; - case RESET_PIN: - if (result == 0) { - -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Reset Password success.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg(PR_LOG_ALWAYS,"%s Key Reset Password success.\n",GetTStamp(tBuff,56)); -+ - CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN()); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_PINResetComplete, 0); - } else { -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Reset Password failure. Error: %d.\n",GetTStamp(tBuff,56),description)); -+ CoolKeyLogMsg(PR_LOG_ALWAYS, "%s Key Reset Password failure. Error: %d.\n",GetTStamp(tBuff,56),description); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_PINResetError, description); // XXX: Need PIN_RESET_FAILED error code! - } - break; - case FORMAT: - if (result == 0) { -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Format success.\n",GetTStamp(tBuff,56))); -+ CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Key Format success.\n",GetTStamp(tBuff,56)); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatComplete, 0); - } else { -- PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("%s Key Format failure. Error: %d.\n",GetTStamp(tBuff,56),description)); -+ CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Key Format failure. Error: %d.\n",GetTStamp(tBuff,56),description); - CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatError, description); // XXX: Need FORMAT_FAILED error code! - } - break; ---- ./esc/src/app/xpcom/rhCoolKey.cpp.fix5 2007-06-20 11:39:16.000000000 -0700 -+++ ./esc/src/app/xpcom/rhCoolKey.cpp 2007-06-20 11:43:35.000000000 -0700 -@@ -726,6 +726,14 @@ - - } - -+/* void CoolKeyInitializeLog (in string aPathName, in unsigned long aMaxLines); */ -+NS_IMETHODIMP rhCoolKey::CoolKeyInitializeLog(const char *aPathName, PRUint32 aMaxLines) -+{ -+ ::CoolKeyInitializeLog((char *)aPathName, aMaxLines); -+ -+ return NS_OK; -+} -+ - /* void CoolKeyLogMsg (in unsigned long aLogLevel, in string aMessage); */ - NS_IMETHODIMP rhCoolKey::CoolKeyLogMsg(PRUint32 aLogLevel, const char *aMessage) - { -@@ -733,7 +741,8 @@ - - if(aMessage && ((PRLogModuleLevel) aLogLevel >= PR_LOG_NONE && aLogLevel <= PR_LOG_MAX)) - { -- PR_LOG( coolKeyLog, (PRLogModuleLevel) aLogLevel, ("%s %s",GetTStamp(tBuff,56),aMessage)); -+ ::CoolKeyLogMsg((PRLogModuleLevel) aLogLevel, "%s %s \n",GetTStamp(tBuff,56),aMessage); -+ PR_LOG( coolKeyLog, (PRLogModuleLevel) aLogLevel, ("%s %s",GetTStamp(tBuff,56),aMessage)); - } - - return NS_OK; -@@ -776,7 +785,7 @@ - { - - char tBuff[56]; -- PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("%s Attempting to Enroll Key ,ID: %s \n",GetTStamp(tBuff,56),aKeyID)); -+ ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Enroll Key ,ID: %s \n",GetTStamp(tBuff,56),aKeyID); - - CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); - -@@ -808,7 +817,7 @@ - NS_IMETHODIMP rhCoolKey::ResetCoolKeyPIN(PRUint32 aKeyType, const char *aKeyID, const char *aScreenName, const char *aPIN, const char *aScreenNamePwd) - { - char tBuff[56]; -- PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("%s Attempting to Reset Key PIN, ID: %s \n",GetTStamp(tBuff,56),aKeyID)); -+ ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Reset Key PIN, ID: %s \n",GetTStamp(tBuff,56),aKeyID); - CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); - - if (!node) -@@ -859,7 +868,7 @@ - NS_IMETHODIMP rhCoolKey::FormatCoolKey(PRUint32 aKeyType, const char *aKeyID, const char *aEnrollmentType, const char *aScreenName, const char *aPIN, const char *aScreenNamePWord, const char *aTokenCode) - { - char tBuff[56]; -- PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("%s Attempting to Format Key, ID: %s. ",GetTStamp(tBuff,56),aKeyID)); -+ ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to Format Key, ID: %s. ",GetTStamp(tBuff,56),aKeyID); - CoolKeyNode *node = GetCoolKeyInfo(aKeyType, aKeyID); - - if (!node) -@@ -1203,7 +1212,7 @@ - - HRESULT res = CoolKeyGetIssuerInfo(&key, (char *)&issuerInfo,256); - -- PR_LOG( coolKeyLog, PR_LOG_ALWAYS, ("%s Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) issuerInfo)); -+ ::CoolKeyLogMsg( PR_LOG_ALWAYS, "%s Attempting to get the key's Issuer: Key: %s, Issuer %s. \n",GetTStamp(tBuff,56),aKeyID, (char *) issuerInfo); - - if(res == S_OK) - { ---- ./esc/src/app/xpcom/rhICoolKey.idl.fix5 2007-06-20 11:39:32.000000000 -0700 -+++ ./esc/src/app/xpcom/rhICoolKey.idl 2007-06-20 11:43:51.000000000 -0700 -@@ -32,6 +32,7 @@ - - void rhCoolKeyUnSetNotifyCallback(in rhIKeyNotify jsNotify); - -+ void CoolKeyInitializeLog(in string aPathName, in unsigned long aMaxLines); - void CoolKeyLogMsg(in unsigned long aLogLevel, in string aMessage); - void BlinkCoolKey(in unsigned long aKeyType, in string aKeyID,in unsigned long aRate,in unsigned long aDuration); - ---- ./esc/src/app/xul/esc/application.ini.fix5 2007-06-20 11:39:57.000000000 -0700 -+++ ./esc/src/app/xul/esc/application.ini 2007-06-20 13:12:31.000000000 -0700 -@@ -25,7 +25,7 @@ - Name=ESC - ; - ; This field specifies your application's version. This field is optional. --Version=1.0.1-3 -+Version=1.0.1-4 - ; - ; This field specifies your application's build ID (timestamp). This field is - ; required. ---- ./esc/src/app/xul/esc/chrome/content/esc/settings.xul.fix5 2007-06-20 11:40:31.000000000 -0700 -+++ ./esc/src/app/xul/esc/chrome/content/esc/settings.xul 2007-06-20 11:45:03.000000000 -0700 -@@ -25,8 +25,8 @@ - title="&escTitle;" - onload="InitializeAdminBindingList()" - onunload="cleanup()" -- width ="730" -- height= "460" -+ width ="720" -+ height= "415" - name="admin" - xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - ---- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix5 2007-06-20 11:40:21.000000000 -0700 -+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2007-06-20 11:44:52.000000000 -0700 -@@ -131,6 +131,9 @@ - netkey = netkey.QueryInterface(Components.interfaces.rhICoolKey); - gNotify = new jsNotify; - netkey.rhCoolKeySetNotifyCallback(gNotify); -+ -+ var logFileName = GetESCLogPathName("esc.log"); -+ netkey.CoolKeyInitializeLog(logFileName, 1000); - } catch(e) { - MyAlert(getBundleString("errorUniversalXPConnect") + e); - } -@@ -167,33 +170,33 @@ - - var Status_Messages = new Array( - getBundleString("errorNone"), -- getBundleString("serverError"), -- getBundleString("errorProblemCommToken"), -+ getBundleString("errorInternalServer"), -+ getBundleString("errorInternalServer"), - getBundleString("errorProblemCommToken"), - getBundleString("errorProblemResetTokenPin"), - getBundleString("errorInternalServer"), -- getBundleString("errorInternalServer"), -+ getBundleString("errorLifeCyclePDU"), - getBundleString("errorTokenEnrollment"), - getBundleString("errorProblemCommToken"), - getBundleString("errorInternalServer"), -- getBundleString("errorCommCA"), - getBundleString("errorInternalServer"), -- getBundleString("errorResetPin"), - getBundleString("errorInternalServer"), -+ getBundleString("errorInternalServer"), -+ getBundleString("errorTermSecureConn"), - getBundleString("errorAuthFailure"), - getBundleString("errorInternalServer"), - getBundleString("errorTokenDisabled"), -- getBundleString("errorProblemCommToken"), -- getBundleString("errorInternalServer"), -+ getBundleString("errorSecureChannel"), -+ getBundleString("errorServerMisconfig"), - getBundleString("errorTokenUpgrade"), - getBundleString("errorInternalServer"), -- getBundleString("errorProblemCommToken"), -- getBundleString("errorInvalidTokenType"), -+ getBundleString("errorExternalAuth"), - getBundleString("errorInvalidTokenType"), -+ getBundleString("errorInvalidTokenTypeParams"), - getBundleString("errorCannotPublish"), - getBundleString("errorCommTokenDB"), -- getBundleString("errorTokenDisabled"), -- getBundleString("errorPinReset"), -+ getBundleString("errorTokenSuspended"), -+ getBundleString("errorPinResetable"), - getBundleString("errorConnLost"), - getBundleString("errorEntryTokenDB"), - getBundleString("errorNoTokenState"), -@@ -201,10 +204,10 @@ - getBundleString("errorTokenUnusable"), - getBundleString("errorNoInactiveToken"), - getBundleString("errorProcessMultiTokens"), -+ getBundleString("errorTokenTerminated"), - getBundleString("errorInternalServer"), -- getBundleString("errorKeyRecoveryProcessed"), - getBundleString("errorKeyRecoveryFailed"), -- getBundleString("errorNoOperateLostToken"), -+ getBundleString("errorInternalServer"), - getBundleString("errorKeyArchival"), - getBundleString("errorConnTKS"), - getBundleString("errorFailUpdateTokenDB"), -@@ -559,9 +562,9 @@ - - function TestStatusMessages() - { -- for(i = 0 ; i < 48; i++) -+ for(i = 0 ; i < 49; i++) - { -- MyAlert(Status_Messages[i]); -+ MyAlert( i + " " + Status_Messages[i]); - } - } - -@@ -4263,9 +4266,9 @@ - - var value = line.value; - -- var colonIndex = value.indexOf(":"); -+ //var colonIndex = value.indexOf(":"); - -- value = value.substring(colonIndex + 1); -+ //value = value.substring(colonIndex + 1); - - lines.push(value); - } while(hasmore); -@@ -4484,3 +4487,29 @@ - adminList.focus(); - } - } -+ -+function GetESCLogPathName(aName) -+{ -+ -+ if(!aName) -+ return null; -+ -+ const logFileName = aName; -+ -+ // Get executable directory -+ -+ var file = Components.classes["@mozilla.org/file/directory_service;1"] -+ .getService(Components.interfaces.nsIProperties) -+ .get("ProfD", Components.interfaces.nsIFile); -+ -+ file = file.parent; -+ file.append(logFileName); -+ -+ -+ //alert("LogPathName " + file.path); -+ -+ -+ return file.path; -+ -+ -+} ---- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties.fix5 2007-06-20 11:40:51.000000000 -0700 -+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties 2007-06-20 11:45:50.000000000 -0700 -@@ -85,40 +85,48 @@ - #ESC Error Messages from TPS - errorNone=Operation Completed Successfully. - serverError=Smart Card Server error. --errorProblemResetTokenPin=Internal Smart Card Server error. --errorTokenEnrollment=Smart card enrollment error. -+errorProblemResetTokenPin=The Smart Card Server cannot reset your smart card's password. -+errorTokenEnrollment=The Smart Card Server cannot import the required certificates into your smart card. -+errorLifeCyclePDU=The Smart Card Server cannot finalize the enrollment of your smart card. - errorCommCA=Error communicating with the Certification Authority. - errorInternalServer=Internal Smart Card Server error. - errorResetPin=Error resetting the smart card's password. - errorInternalServer=Internal Smart Card Server error. --errorAuthFailure=Smart Card Server authentication failure. --errorTokenDisabled=Your smart card is listed as disabled. --errorProblemCommToken=Problem communicating with the smart card. --errorTokenUpgrade=Cannot upgrade smart card software. --errorInvalidTokenType=Invalid smart card type. --errorCannotPublish=Cannot publish smart card information. --errorCommTokenDB=Cannot communicate with smart card database. --errorPinReset=Cannot reset the password value for the smart card. --errorConnLost=Connection to Smart Card Server. --errorEntryTokenDB=Can not create entry for the smart card in the smart card database. --errorNoTokenState=Smart card found to be in an inconsistent state. --errorInvalidLostTokenReason=Invalid reason for lost smart card submitted. --errorTokenUnusable=Smart card found to be unusable due to compromise. --errorNoInactiveToken=No such inactive smart card found. --errorProcessMultiTokens=Can not process more than one active smart card. -+errorAuthFailure=The Smart Card Server cannot validate your credentials. Please try again with the correct credentials. -+errorTokenDisabled=The Smart Card Server does not know about your smart card. -+errorSecureChannel=The Smart Card Server cannot establish a secure channel with the smart card. -+errorServerMisconfig=The Smart Card Server has not been configured correctly. -+errorProblemCommToken=Your smart card can not perform the operation requested by the Smart Card Server. -+errorExternalAuth=Your smart card cannot correctly identify the Smart Card Server. -+errorTokenUpgrade=The Smart Card Server cannot upgrade the software on your smart card. -+errorTermSecureConn=The Smart Card Server can not terminate the secure cummunications channel with the smart card. -+errorInvalidTokenType=The Smart Card Server does not recognize the requested type of card enrollment. -+errorInvalidTokenTypeParams=The Smart Card Server cannot process the requested type of enrollment due to a misconfiguration. -+errorCannotPublish=The Smart Card Server cannot publish your card's certificates to the certificate directory. -+errorCommTokenDB=The Smart Card Server cannot connect to its internal database. -+errorTokenSuspended=Your smart card has been suspended. -+errorPinResetable=You are not allowed to reset the password of this smart card. -+errorConnLost=The Smart Card Manager has lost the connection to the Smart Card Server. -+errorEntryTokenDB=The Smart Card Server cannot add your smart card to its internal database. -+errorNoTokenState=The Smart Card server does not recognize your smart card's current status. -+errorInvalidLostTokenReason=The Smart Card server cannot process your smart card which has been reported lost. -+errorTokenUnusable=The Smart Card Server cannot process your smart card which has been reported stolen. -+errorNoInactiveToken=The Smart Card Server cannot restore your smart card's security keys. -+errorProcessMultiTokens=The Smart Card Server has detected that you already have one enrolled smart card. The server only allows one enrolled card per user. -+errorTokenTerminated=The Smart Card Server can not process your smart card which is marked as terminated. - errorKeyRecoveryProcessed=Smart card key recovery has been processed. --errorKeyRecoveryFailed=Smart card key recovery failed. -+errorKeyRecoveryFailed=The Smart Card Server can not restore the security keys onto your smart card. - errorNoOperateLostToken=Cannot process this smart card, which has been reported lost. --errorKeyArchival=Smart card key archival error. --errorConnTKS=Problem connecting to the Smart Card TKS Server. --errorFailUpdateTokenDB=Failed to update smart card database. --errorCertRevocation=Internal certificate revocation error discovered. --errorNotOwnToken=User does not own this smart card. --errorESCMisconfigured=Smart Card Manager has been misconfigured. --errorESCNoCommCardReader=Smart Card Manager can't communicate with card reader. --errorESCNoTokenSession=Smart Card Manager can't initiate session with smart card. --errorESCNoTalkTPS=Smart Card Manager can't talk to Smart Card Server. --errorESCNoTalkTokenReader=Smart Card Manager can't talk to smart card reader. -+errorKeyArchival=The Smart Card Server can not restore the security keys onto your smart card due to a server misconfiguration. -+errorConnTKS=The Smart Card server cannot contact its security key server,which is required for processing. -+errorFailUpdateTokenDB=The Smart Card Server cannot reset the status of your smart card. -+errorCertRevocation=The Smart Card Server cannot mark the security keys on your smart card as revoked. -+errorNotOwnToken=The Smart Card Server cannot process a smart card which you do not own. -+errorESCMisconfigured=The Smart Card Manager has been misconfigured. -+errorESCNoCommCardReader=The Smart Card Manager cannot initiate communications with the smart card. -+errorESCNoTokenSession=The Smart Card Manager cannot establish a communications session with the smart card. -+errorESCNoTalkTPS=The Smart Card Manager cannot initiate communications with the Smart Card Server. -+errorESCNoTalkTokenReader=The Smart Card Manager cannot finalize communications with the smart card. - #ESC text in general Alert messages - errorCoolKeyIsAuth=coolkey.GetCoolKeyIsAuthenticated() failed! - errorAuthCoolKey=coolkey.AuthenticateCoolKey failed! diff --git a/esc-1.0.1-nss-devel-fix.patch b/esc-1.0.1-nss-devel-fix.patch deleted file mode 100644 index 22035d7..0000000 --- a/esc-1.0.1-nss-devel-fix.patch +++ /dev/null @@ -1,14 +0,0 @@ ---- ./esc/src/lib/coolkey/CoolKeyHandler.cpp.fix9 2008-01-18 11:56:55.000000000 -0800 -+++ ./esc/src/lib/coolkey/CoolKeyHandler.cpp 2008-01-18 11:59:12.000000000 -0800 -@@ -49,6 +49,11 @@ - - #include - -+#ifndef CKO_NETSCAPE -+#define CKO_NETSCAPE CKO_NSS -+#endif -+ -+ - #ifndef CKO_MOZILLA_READER - #define CKO_MOZILLA_READER (CKO_NETSCAPE+5) - #define CKA_MOZILLA_IS_COOL_KEY (CKO_NETSCAPE+24) diff --git a/esc-1.0.1-ui-fixes-1.patch b/esc-1.0.1-ui-fixes-1.patch deleted file mode 100644 index 39bbb38..0000000 --- a/esc-1.0.1-ui-fixes-1.patch +++ /dev/null @@ -1,1906 +0,0 @@ ---- ./esc/src/lib/coolkey/NSSManager.cpp.fix4 2007-04-25 10:52:35.000000000 -0700 -+++ ./esc/src/lib/coolkey/NSSManager.cpp 2007-04-25 10:52:47.000000000 -0700 -@@ -51,6 +51,9 @@ - char tBuff[56]; - PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::NSSManager:\n",GetTStamp(tBuff,56))); - mpSCMonitoringThread = NULL; -+#ifdef LINUX -+ systemCertDB = NULL; -+#endif - } - - NSSManager::~NSSManager() -@@ -61,6 +64,7 @@ - delete mpSCMonitoringThread; - mpSCMonitoringThread = NULL; - } -+ - } - - HRESULT NSSManager::InitNSS(const char *aAppDir) -@@ -110,6 +114,21 @@ - return E_FAIL; - } - -+#ifdef LINUX -+ -+ // Load our Linux only database -+ -+ -+ const char *modspec = "configdir='/etc/pki/nssdb' tokenDescripton='SystemDB' flags='readOnly'"; -+ PK11SlotInfo *systemCertDB = SECMOD_OpenUserDB(modspec); -+ -+ if(!systemCertDB) -+ { -+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager::InitNSS problem loading Linux System Cert Database!\n",GetTStamp(tBuff,56))); -+ } -+ -+#endif -+ - mpSCMonitoringThread = new SmartCardMonitoringThread(userModule); - if (!mpSCMonitoringThread) { - SECMOD_UnloadUserModule(userModule); -@@ -132,6 +151,17 @@ - - // Logout all tokens. - PK11_LogoutAll(); -+ -+#ifdef LINUX -+ if(systemCertDB) -+ { -+ SECMOD_CloseUserDB(systemCertDB); -+ -+ PK11_FreeSlot(systemCertDB); -+ systemCertDB = NULL; -+ } -+ -+#endif - } - - bool -@@ -326,7 +356,7 @@ - return S_OK; - } - --HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength) -+HRESULT NSSManager::GetKeyIssuer(const CoolKey *aKey, char *aBuf, int aBufLength) - { - char tBuff[56]; - if(!aBuf) -@@ -337,17 +367,89 @@ - PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo \n",GetTStamp(tBuff,56))); - - if(!aKey ) -- { - return E_FAIL; -- } - - PK11SlotInfo *slot = GetSlotForKeyID(aKey); - - if (!slot) -+ return E_FAIL; -+ -+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL); -+ -+ if (!certs) - { -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuer no certs found! \n",GetTStamp(tBuff,56))); -+ PK11_FreeSlot(slot); - return E_FAIL; - } - -+ CERTCertListNode *node= NULL; -+ -+ char *orgID = 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) -+ { -+ if(IsCACert(cert)) -+ { -+ continue; -+ } -+ orgID = CERT_GetOrgName(&cert->subject); -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p org %s \n",GetTStamp(tBuff,56),slot,cert->slot,orgID)); -+ -+ } -+ -+ if(orgID) -+ break; -+ } -+ } -+ -+ } -+ -+ if(orgID && ((int)strlen(orgID) < aBufLength)) -+ { -+ strcpy(aBuf,orgID); -+ } -+ -+ if(certs) -+ CERT_DestroyCertList(certs); -+ -+ if(slot) -+ PK11_FreeSlot(slot); -+ -+ if(orgID) -+ PORT_Free(orgID); -+ -+ return S_OK; -+} -+ -+HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength) -+{ -+ char tBuff[56]; -+ if(!aBuf) -+ return E_FAIL; -+ -+ aBuf[0]=0; -+ -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo \n",GetTStamp(tBuff,56))); -+ -+ if(!aKey ) -+ return E_FAIL; -+ -+ PK11SlotInfo *slot = GetSlotForKeyID(aKey); -+ -+ if (!slot) -+ return E_FAIL; -+ - CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL); - - if (!certs) -@@ -373,8 +475,14 @@ - { - if(cert->slot == slot) - { -+ if(IsCACert(cert)) -+ { -+ continue; -+ } -+ - certID = CERT_GetCommonName(&cert->subject); -- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",GetTStamp(tBuff,56),slot,cert->slot,certID)); -+ -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",GetTStamp(tBuff,56),slot,cert->slot,certID)); - - } - -@@ -627,3 +735,41 @@ - - return isAuthenticated; - } -+ -+bool -+NSSManager::IsCACert(CERTCertificate *cert) -+{ -+ char tBuff[56]; -+ bool isCA = false; -+ -+ if(!cert) -+ return isCA; -+ -+ SECItem basicItem; -+ basicItem.data = 0; -+ -+ SECStatus s = CERT_FindCertExtension(cert, SEC_OID_X509_BASIC_CONSTRAINTS, &basicItem); -+ -+ if(s != SECSuccess || !basicItem.data) -+ return isCA; -+ -+ CERTBasicConstraints basic_value; -+ -+ s = CERT_DecodeBasicConstraintValue(&basic_value,&basicItem); -+ -+ if(s != SECSuccess) -+ return isCA; -+ -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuedTo isCA %d \n",GetTStamp(tBuff,56),basic_value.isCA)); -+ -+ if(basic_value.isCA) -+ { -+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuedTo found a CA cert , skipping! \n",GetTStamp(tBuff,56))); -+ isCA = true; -+ } -+ -+ PORT_Free(basicItem.data); -+ basicItem.data = NULL; -+ -+ return isCA; -+} ---- ./esc/src/lib/coolkey/CoolKey.h.fix4 2007-04-25 10:52:20.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.h 2007-04-25 11:02:56.000000000 -0700 -@@ -134,6 +134,7 @@ - COOLKEY_API HRESULT CoolKeyGetCertInfo(const CoolKey *aKey, char *aCertNickname, std::string & aCertInfo); - - COOLKEY_API HRESULT CoolKeyGetIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength); -+COOLKEY_API HRESULT CoolKeyGetIssuer(const CoolKey *aKey, char *aBuf, int aBufLength); - - COOLKEY_API bool CoolKeyRequiresAuthentication(const CoolKey *aKey); - COOLKEY_API bool CoolKeyIsAuthenticated(const CoolKey *aKey); ---- ./esc/src/lib/coolkey/CoolKey.cpp.fix4 2007-04-25 10:51:58.000000000 -0700 -+++ ./esc/src/lib/coolkey/CoolKey.cpp 2007-04-25 10:52:06.000000000 -0700 -@@ -844,6 +844,16 @@ - return NSSManager::GetKeyIssuedTo(aKey,aBuf,aBufLength); - } - -+HRESULT -+CoolKeyGetIssuer(const CoolKey *aKey, char *aBuf, int aBufLength) -+{ -+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLength < 1) -+ return E_FAIL; -+ -+ return NSSManager::GetKeyIssuer(aKey,aBuf,aBufLength); -+} -+ -+ - HRESULT CoolKeyGetATR(const CoolKey *aKey, char *aBuf, int aBufLen) - { - char tBuff[56]; ---- ./esc/src/lib/coolkey/NSSManager.h.fix4 2007-04-25 11:08:44.000000000 -0700 -+++ ./esc/src/lib/coolkey/NSSManager.h 2007-04-25 10:53:08.000000000 -0700 -@@ -68,11 +68,16 @@ - - static HRESULT GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength); - -- -+ static HRESULT GetKeyIssuer(const CoolKey *aKey, char *aBuf, int aBufLength); - - - private: - -+ static bool IsCACert(CERTCertificate *cert); -+ -+#ifdef LINUX -+ PK11SlotInfo *systemCertDB; -+#endif - SmartCardMonitoringThread *mpSCMonitoringThread; - }; - ---- ./esc/src/app/xpcom/rhICoolKey.idl.fix4 2007-04-25 10:41:08.000000000 -0700 -+++ ./esc/src/app/xpcom/rhICoolKey.idl 2007-04-25 10:41:36.000000000 -0700 -@@ -66,9 +66,13 @@ - string GetCoolKeyCertInfo(in unsigned long aKeyType, in string aKeyID, in string aCertNickname); - - string GetCoolKeyIssuedTo(in unsigned long aKeyType, in string aKeyID); -+ -+ string GetCoolKeyIssuer(in unsigned long aKeyType, in string aKeyID); - - string GetCoolKeyATR(in unsigned long aKeyType, in string aKeyID); - -+ string GetCoolKeyTokenName(in unsigned long aKeyType, in string aKeyID); -+ - boolean GetCoolKeyRequiresAuthentication(in unsigned long aKeyType,in string aKeyID); - - boolean GetCoolKeyIsAuthenticated(in unsigned long aKeyType,in string aKeyID); ---- ./esc/src/app/xpcom/rhCoolKey.cpp.fix4 2007-04-25 10:40:43.000000000 -0700 -+++ ./esc/src/app/xpcom/rhCoolKey.cpp 2007-04-25 10:40:53.000000000 -0700 -@@ -1074,7 +1074,7 @@ - char tBuff[56]; - PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread())); - -- if (ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) { -+ if (aKeyType && aKeyID && ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) { - if (aKeyID) { - AutoCoolKey key(aKeyType, aKeyID); - PRBool isCool = CoolKeyIsReallyCoolKey(&key); -@@ -1164,6 +1164,34 @@ - return NS_OK; - } - -+/* string GetCoolKeyTokenName (in unsigned long aKeyType, in string aKeyID); */ -+ NS_IMETHODIMP rhCoolKey::GetCoolKeyTokenName(PRUint32 aKeyType, const char *aKeyID, char **_retval) -+{ -+ char tBuff[56]; -+ -+ *_retval = NULL; -+ -+ if(!aKeyType && !aKeyID) -+ return NS_OK; -+ -+ AutoCoolKey key(aKeyType,aKeyID); -+ -+ char *tokenName = NULL; -+ -+ tokenName = (char *) CoolKeyGetTokenName(&key); -+ -+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyTokenName %s \n",GetTStamp(tBuff,56),tokenName)); -+ if(tokenName) -+ { -+ char *temp = (char *) nsMemory::Clone(tokenName,sizeof(char) * strlen((char *)tokenName) + 1); -+ *_retval = temp; -+ -+ } -+ -+ return NS_OK; -+ -+} -+ - /* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char **_retval) - { - char tBuff[56]; -@@ -1251,6 +1279,40 @@ - return NS_OK; - - } -+ -+/* string GetCoolKeyIssuer (in unsigned long aKeyType, in string aKeyID); */ -+NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuer(PRUint32 aKeyType, const char *aKeyID, char **issuer) -+{ -+ char tBuff[56]; -+ if (!aKeyID) { -+ return NS_ERROR_FAILURE; -+ } -+ -+ AutoCoolKey key(aKeyType, ( char *)aKeyID); -+ -+ // const char *keyName = CoolKeyGetTokenName(&key); -+ -+ char buff[512]; -+ int bufLength = 512; -+ buff[0] = 0; -+ -+ CoolKeyGetIssuer(&key, (char *) buff, bufLength); -+ -+ if(!buff[0]) -+ { -+ return NS_OK; -+ } -+ -+ PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetIssuer %s \n",GetTStamp(tBuff,56),(char *) buff)); -+ -+ char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1); -+ -+ *issuer = temp; -+ -+ return NS_OK; -+ -+} -+ - /* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */ - NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, PRBool *_retval) - { ---- ./esc/src/app/xpcom/tray/rhTray.h.fix4 2007-04-25 10:55:28.000000000 -0700 -+++ ./esc/src/app/xpcom/tray/rhTray.h 2007-04-25 10:55:35.000000000 -0700 -@@ -263,6 +263,7 @@ - // Icon menu related - - static GtkWidget *mIconMenu; -+ static GtkWidget *mIconBoxWidget; - static void IconMenuCBProc(GtkWidget *widget, gpointer data); - HRESULT CreateIconMenu(); - ---- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix4 2007-04-25 10:42:40.000000000 -0700 -+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2007-04-25 10:42:51.000000000 -0700 -@@ -22,11 +22,13 @@ - #include - #include "notifytray.h" - #include "intl/nsIStringBundle.h" -+#include - - NS_IMPL_ISUPPORTS1(rhTray, rhITray) - - GtkWidget* rhTray::mWnd = NULL; - GtkWidget* rhTray::mIconMenu = NULL; -+GtkWidget* rhTray::mIconBoxWidget = NULL; - - int rhTray::mInitialized = 0; - -@@ -37,6 +39,44 @@ - - static PRLogModuleInfo *trayLog = PR_NewLogModule("tray"); - -+static void popup_position(GtkMenu *menu, -+ gint *x, -+ gint *y, -+ gboolean *push_in, -+ gpointer user_data) -+{ -+ -+ char tBuff[56]; -+ GtkWidget *icon_box_widget = GTK_WIDGET(user_data); -+ -+ if(icon_box_widget) -+ { -+ GdkWindow* window = icon_box_widget->window; -+ -+ gint width; -+ gint height; -+ -+ gint px; -+ gint py; -+ -+ gdk_drawable_get_size(window,&width,&height); -+ -+ gdk_window_get_position(window, -+ &px, -+ &py); -+ -+ PR_LOG( trayLog, PR_LOG_DEBUG, ("%s popup_position width %d height %d px %d py %d \n",GetTStamp(tBuff,56),width,height,px,py)); -+ -+ -+ gint x_coord = px; -+ gint y_coord = (py + height); -+ -+ *x = x_coord; -+ *y = y_coord; -+ -+ } -+ -+} - - rhTray::rhTray() - { -@@ -232,11 +272,12 @@ - return E_FAIL; - } - -- GtkWidget *icon_widget = notify_icon_get_box_widget(); -+ mIconBoxWidget = notify_icon_get_box_widget(); - -- if(icon_widget) -+ if(mIconBoxWidget) - { -- g_signal_connect(G_OBJECT(icon_widget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL); -+ g_signal_connect(G_OBJECT(mIconBoxWidget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL); -+ - } - - res = CreateEventWindow(); -@@ -352,11 +393,23 @@ - - GtkWidget *min_item = gtk_menu_item_new_with_label ("Hide"); - GtkWidget *max_item = gtk_menu_item_new_with_label ("Manage Keys"); -- GtkWidget *exit_item = gtk_menu_item_new_with_label ("Exit"); -+ GtkWidget *exit_item = gtk_image_menu_item_new_with_label ("Exit"); - -- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item); -+ GtkWidget* quit_icon = gtk_image_new_from_stock(GTK_STOCK_QUIT,GTK_ICON_SIZE_SMALL_TOOLBAR); -+ -+ if(max_item) -+ gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item); - //gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item); -- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item); -+ if(exit_item) -+ { -+ gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item); -+ -+ if(quit_icon) -+ { -+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(exit_item), quit_icon); -+ -+ } -+ } - - g_signal_connect(G_OBJECT (min_item), "activate", - G_CALLBACK (rhTray::IconMenuCBProc), -@@ -404,8 +457,8 @@ - gtk_menu_popup(GTK_MENU(mIconMenu), - NULL, - NULL, -- NULL, -- NULL, -+ (GtkMenuPositionFunc) popup_position, -+ mIconBoxWidget, - event->button, - event->time); - -@@ -725,6 +778,7 @@ - - if(widget->window) - { -+ gdk_x11_window_set_user_time (widget->window, gdk_x11_get_server_time (widget->window)); - if(GTK_WIDGET_VISIBLE(mWnd)) - { - gdk_window_show(widget->window); ---- ./esc/src/app/xul/esc/application.ini.fix4 2007-04-25 10:43:17.000000000 -0700 -+++ ./esc/src/app/xul/esc/application.ini 2007-04-25 10:44:00.000000000 -0700 -@@ -19,13 +19,13 @@ - ; - ; This field specifies your organization's name. This field is recommended, - ; but optional. --Vendor=RedHat -+Vendor=RedHat - ; - ; This field specifies your application's name. This field is required. - Name=ESC - ; - ; This field specifies your application's version. This field is optional. --Version=1.0.0 -+Version=1.0.1-3 - ; - ; This field specifies your application's build ID (timestamp). This field is - ; required. ---- ./esc/src/app/xul/esc/chrome/content/esc/security.xul.fix4 2007-04-25 10:48:49.000000000 -0700 -+++ ./esc/src/app/xul/esc/chrome/content/esc/security.xul 2007-04-25 10:48:59.000000000 -0700 -@@ -38,6 +38,6 @@ - - - --