[Fedora-directory-commits] esc/src/lib/notifytray notifyareaicon.c, 1.1, 1.2 notifytray.c, 1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/notifytray
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27433
Modified Files:
notifyareaicon.c notifytray.c
Log Message:
Latest updates.
Index: notifyareaicon.c
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/notifytray/notifyareaicon.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- notifyareaicon.c 13 Sep 2006 18:06:08 -0000 1.1
+++ notifyareaicon.c 27 Sep 2006 17:48:29 -0000 1.2
@@ -16,6 +16,7 @@
* END COPYRIGHT BLOCK **/
#include <string.h>
+#include <unistd.h>
#include <gdk/gdkx.h>
#include "notifyareaicon.h"
@@ -170,6 +171,44 @@
icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
+ if(icon->manager_wnd == None)
+ {
+
+ /* Let's loop through for up to 7 seconds until the
+ notification applet comes on line */
+
+ const int maxIters = 7;
+ const int sleepInterval = 1000000;
+
+ int i = 0;
+ for(i = 0; i < maxIters ; i++)
+ {
+
+ XUngrabServer (xdisplay);
+ XFlush (xdisplay);
+ g_print("XGetSelectionOwner failed try again iter: %d ... \n",i);
+
+ usleep(sleepInterval);
+
+
+ XGrabServer (xdisplay);
+ icon->manager_wnd = XGetSelectionOwner (xdisplay, icon->selection_atom);
+
+ if(icon->manager_wnd == None)
+ {
+ g_print("XGetSelectionOwner failed try again! \n");
+ }
+ else
+ {
+
+ g_print("XGetSelectionOwner succeeded ! \n");
+ break;
+ }
+
+ }
+
+ }
+
if (icon->manager_wnd != None)
XSelectInput (xdisplay,
icon->manager_wnd, StructureNotifyMask);
@@ -207,6 +246,16 @@
icon = (NotifyAreaIcon *) g_object_new(notify_area_icon_get_type ()
, NULL);
+
+ g_print ("result of g_object_new() %p",icon);
+
+
+ if(!icon)
+ {
+ g_print ("icon is null returning...");
+ return icon;
+ }
+
gtk_window_set_title (GTK_WINDOW (icon), name);
gtk_plug_construct (GTK_PLUG (icon), 0);
@@ -225,6 +274,8 @@
notify_area_icon_update_manager_wnd(icon);
+ g_print ("attempted to update_manager_wnd: %p",(void *)icon->manager_wnd);
+
root = gdk_window_lookup (gdk_x11_get_default_root_xwindow ());
icon->tooltips = gtk_tooltips_new ();
Index: notifytray.c
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/notifytray/notifytray.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- notifytray.c 13 Sep 2006 18:06:08 -0000 1.1
+++ notifytray.c 27 Sep 2006 17:48:29 -0000 1.2
@@ -118,11 +118,17 @@
notify_icon_create()
{
if (notify) {
+ g_print ("Notify icon already created!");
return;
}
notify = notify_area_icon_new("coolkey");
+ if(!notify)
+ {
+ g_print ("notify_area_icon_new() failed!");
+ }
+
if(!notify_box)
{
notify_box = gtk_event_box_new();
@@ -155,13 +161,22 @@
int notify_icon_created_ok()
{
if(!notify)
+ {
+ g_print ("notify_icon_created_ok returning 0 because notify is null.");
return 0;
+ }
+
if(notify->manager_wnd)
return 1;
else
+ {
+
+ g_print ("notify_icon_created_ok returning 0 because notify->manager_wnd is null.");
return 0;
+ }
+
}
int notify_icon_show()
17 years, 6 months
[Fedora-directory-commits] esc/src/lib/coolkey CoolKey.cpp, 1.1.1.1, 1.2 CoolKey.h, 1.1.1.1, 1.2 CoolKeyHandler.cpp, 1.1.1.1, 1.2 CoolKeyHandler.h, 1.1.1.1, 1.2 CoolKey_Message.cpp, 1.1.1.1, 1.2 NSSManager.cpp, 1.1.1.1, 1.2 NSSManager.h, 1.1.1.1, 1.2 SlotUtils.cpp, 1.1.1.1, 1.2 SlotUtils.h, 1.1.1.1, 1.2 SmartCardMonitoringThread.cpp, 1.1.1.1, 1.2 ckymanager.def, 1.1.1.1, 1.2 manifest.mn, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/lib/coolkey
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27376
Modified Files:
CoolKey.cpp CoolKey.h CoolKeyHandler.cpp CoolKeyHandler.h
CoolKey_Message.cpp NSSManager.cpp NSSManager.h SlotUtils.cpp
SlotUtils.h SmartCardMonitoringThread.cpp ckymanager.def
manifest.mn
Log Message:
Latest updates.
Index: CoolKey.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,14 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-//#ifdef WIN32
-//#include "windows.h"
-//#include "CoolKeyCSP.h"
-//#define ENABLE_CSP
-//#endif
+#define FORCE_PR_LOG 1
-#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "SlotUtils.h"
#include "prthread.h"
@@ -38,10 +32,10 @@
#include <list>
#include <algorithm>
#include <prlog.h>
-
+#include "CoolKey.h"
static NSSManager* g_NSSManager = NULL;
-static PRLogModuleInfo *coolKeyLog = PR_NewLogModule("netkey");
+static PRLogModuleInfo *coolKeyLog = PR_NewLogModule("coolKeyLib");
static std::list<CoolKeyListener*> g_Listeners;
@@ -70,18 +64,17 @@
if (!g_NSSManager)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyInit:Failed to create NSSManager.\n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("CoolKeyInit:Failed to create NSSManager.\n"));
return E_FAIL;
}
HRESULT rv = g_NSSManager->InitNSS(aAppDir);
if (rv == E_FAIL)
{
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyInit:Failed to Init NSSManager. \n"));
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Failed to initialize Crypto library! \n"));
return rv;
}
-
return S_OK;
}
@@ -89,14 +82,6 @@
{
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdown:\n"));
-// ShutdownUIThreadProxyService();
-
- std::list<CoolKeyListener*>::iterator it;
- for (it=g_Listeners.begin(); it!=g_Listeners.end(); ++it)
- {
- PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyShutdown: listener still in list %p\n",(*it)));
- }
-
DestroyCoolKeyList();
if (g_NSSManager) {
@@ -105,10 +90,6 @@
g_NSSManager = 0;
}
- //DestroyCoolKeyList();
-
- CoolKeyPrefShutdown();
-
return S_OK;
}
@@ -118,6 +99,8 @@
static CoolKeyGetConfigValue g_GetConfigValue = NULL;
static CoolKeySetConfigValue g_SetConfigValue = NULL;
+char* CoolKeyVerifyPassword(PK11SlotInfo *,PRBool,void *);
+
COOLKEY_API HRESULT CoolKeySetCallbacks(CoolKeyDispatch dispatch,
CoolKeyReference reference, CoolKeyRelease release,
CoolKeyGetConfigValue getconfigvalue,CoolKeySetConfigValue setconfigvalue)
@@ -127,6 +110,10 @@
g_Release = release;
g_GetConfigValue = getconfigvalue;
g_SetConfigValue = setconfigvalue;
+
+
+ PK11_SetPasswordFunc( CoolKeyVerifyPassword);
+ // Set the verify password callback here, no params needed we know what it is
return 0;
}
@@ -140,6 +127,11 @@
(*g_Reference)(list); \
}
+char *CoolKeyVerifyPassword(PK11SlotInfo *slot,PRBool retry,void *arg)
+{
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyVerifyPassword: \n"));
+ return NULL;
+}
COOLKEY_API HRESULT CoolKeyRegisterListener(CoolKeyListener* aListener)
{
@@ -169,7 +161,6 @@
PR_LOG( coolKeyLog, PR_LOG_DEBUG,
("CoolKeyUnregisterListener: erasing listener %p \n",*it));
- //CoolKeyListener *listener = *it;
g_Listeners.erase(it);
RELEASE_LISTENER(aListener);
}
@@ -196,9 +187,6 @@
}
}
- PR_LOG( coolKeyLog, PR_LOG_DEBUG,
- ("CoolKeyNotify: leaving: key %s state %d data %d",
- aKey->mKeyID, aKeyState, aData));
return S_OK;
}
@@ -831,7 +819,7 @@
}
- return S_OK; // NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
+ return NSSManager::GetKeyCertInfo(aKey,aCertNickname,aCertInfo);
}
@@ -843,6 +831,178 @@
return NSSManager::GetKeyPolicy(aKey, aBuf, aBufLen);
}
+HRESULT
+CoolKeyGetIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLength < 1)
+ return E_FAIL;
+
+ return NSSManager::GetKeyIssuedTo(aKey,aBuf,aBufLength);
+
+}
+HRESULT CoolKeyGetIssuerInfo(const CoolKey *aKey, char *aBuf, int aBufLen)
+{
+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLen < 1)
+ return E_FAIL;
+
+ aBuf[0] = 0;
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo::\n"));
+
+ CKYBuffer ISSUER_INFO;
+ CKYBuffer_InitEmpty(&ISSUER_INFO);
+ CKYCardConnection *conn = NULL;
+ CKYISOStatus apduRC = 0;
+ CKYStatus status;
+ const char *readerName = NULL;
+ const CKYByte *infoData = NULL;
+ CKYSize infoSize = 0;
+
+ HRESULT result = S_OK;
+
+
+ CKYCardContext *cardCtxt = CKYCardContext_Create(SCARD_SCOPE_USER);
+
+ assert(cardCtxt);
+ if (!cardCtxt) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't create Card Context !.\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ conn = CKYCardConnection_Create(cardCtxt);
+ assert(conn);
+ if (!conn) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't create Card Connection!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ readerName = GetReaderNameForKeyID(aKey);
+ assert(readerName);
+ if (!readerName) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't get reader name!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ status = CKYCardConnection_Connect(conn, readerName);
+ if (status != CKYSUCCESS) {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't connect to Card!\n"));
+
+ result = E_FAIL;
+ goto done;
+ }
+
+CKYCardConnection_BeginTransaction(conn);
+ apduRC = 0;
+ status = CKYApplet_SelectCoolKeyManager(conn, &apduRC);
+ if (status != CKYSUCCESS) {
+
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Can't select CoolKey manager!\n"));
+ goto done;
+ }
+
+ status = CKYApplet_GetIssuerInfo(conn, &ISSUER_INFO,
+ &apduRC);
+
+ if(status != CKYSUCCESS)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_ERROR, ("Attempting to get key issuer info. Error actually getting IssuerInfo!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ infoSize = CKYBuffer_Size(&ISSUER_INFO);
+
+ if(infoSize == 0)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: IssuerInfo buffer size is zero!\n"));
+ result = E_FAIL;
+ goto done;
+ }
+
+ if(infoSize >= (CKYSize ) aBufLen)
+ {
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: Insufficient space to put Issuer Info!\n"));
+
+ result = E_FAIL;
+ goto done;
+ }
+
+ infoData = CKYBuffer_Data(&ISSUER_INFO);
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("CoolKeyGetIssuerInfo:: IssuerInfo actual data %s!\n",(char *) infoData));
+ if(infoData)
+ {
+ strcpy((char *) aBuf, (char *) infoData);
+ }
+
+ done:
+
+ if (conn) {
+ CKYCardConnection_EndTransaction(conn);
+ CKYCardConnection_Disconnect(conn);
+ CKYCardConnection_Destroy(conn);
+ }
+ if (cardCtxt) {
+ CKYCardContext_Destroy(cardCtxt);
+ }
+
+ CKYBuffer_FreeData(&ISSUER_INFO);
+
+ return result;
+}
+
+bool CoolKeyIsReallyCoolKey(const CoolKey *aKey)
+{
+ bool res = false;
+
+ if(!aKey)
+ return res;
+
+
+ CoolKeyInfo *info =
+ GetCoolKeyInfoByKeyID(aKey);
+
+ if(!info)
+ return res;
+
+ if( IS_REALLY_A_COOLKEY(info->mInfoFlags))
+ res = true;
+
+ 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
Index: CoolKey.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -120,6 +120,8 @@
COOLKEY_API bool CoolKeyHasApplet(const CoolKey *aKey);
COOLKEY_API bool CoolKeyIsEnrolled(const CoolKey *aKey);
COOLKEY_API bool CoolKeyHasReader(const CoolKey *aKey);
+COOLKEY_API bool CoolKeyIsReallyCoolKey(const CoolKey *aKey);
+
COOLKEY_API bool CoolKeyAuthenticate(const CoolKey *aKey, const char *aPIN);
COOLKEY_API HRESULT CoolKeyGenerateRandomData(unsigned char *aBuf, int aBufLen);
COOLKEY_API HRESULT CoolKeyGetSignatureLength(const CoolKey *aKey, int *aLength);
@@ -133,6 +135,8 @@
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 bool CoolKeyRequiresAuthentication(const CoolKey *aKey);
COOLKEY_API bool CoolKeyIsAuthenticated(const CoolKey *aKey);
@@ -165,6 +169,11 @@
COOLKEY_API HRESULT CoolKeySetDataValue(const CoolKey *aKey,const char *name, const char *value);
+
+COOLKEY_API HRESULT CoolKeyGetIssuerInfo(const CoolKey *aKey, char *aBuf, int aBufLen);
+
+COOLKEY_API int CoolKeyGetAppletVer(const CoolKey *aKey, const bool isMajor);
+
}
////////////////////////////////////////////////////////////////////////
Index: CoolKeyHandler.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKeyHandler.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyHandler.cpp 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ CoolKeyHandler.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,11 +15,12 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include <memory.h>
#include <assert.h>
#include <stdio.h>
#include <string>
-//#include <winscard.h>
#include "prprf.h"
#include "nss.h"
@@ -35,7 +36,6 @@
#include "CoolKeyID.h"
#include "CoolKey.h"
-#include "CoolKeyPref.h"
#include "cky_base.h"
#include "cky_applet.h"
@@ -55,7 +55,7 @@
#define CKA_MOZILLA_ATR (CKO_NETSCAPE+25)
#endif
-static PRLogModuleInfo *coolKeyLogHN = PR_NewLogModule("netkey");
+static PRLogModuleInfo *coolKeyLogHN = PR_NewLogModule("coolKeyHandler");
void NotifyEndResult(CoolKeyHandler* context, int operation, int result, int description);
@@ -446,7 +446,7 @@
const char *tokenCode,int op) {
int error_no = 0;
- int config_error_no = 44;
+ int config_error_no = CONFIG_ERROR;
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init:\n"));
@@ -455,7 +455,7 @@
const char *readerName = NULL;
if (!aKey || aKey->mKeyType != eCKType_CoolKey || !aKey->mKeyID) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 1\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Insuficient input parameters. \n"));
goto done;
}
@@ -468,14 +468,14 @@
if (!readerName) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 2\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot locate card reader name! \n"));
goto done;
}
mDataLock = PR_NewLock();
if (!mDataLock)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure Can't initialize Lock for data.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannnot initialize internal locking mechanism.\n"));
return E_FAIL;
}
@@ -483,41 +483,36 @@
mDataCondVar = PR_NewCondVar(mDataLock);
if (!mDataCondVar)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure Can't initialize Cond Var for data.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot initialize internal syncronization mechanism.\n"));
return E_FAIL;
}
CollectPreferences();
-
mHttpDisconnected = false;
mCancelled = false;
- //CoolKeyGetPref("TPS_HOST_USES_SSL", &temp);
-
-
if(!mCharHostName || !mRAUrl)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: Didn't collect proper config info..\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Didn't collect proper config information.\n"));
error_no = config_error_no;
goto done;
}
-
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: Past configuration tests, about to attempt operation.\n"));
mCardContext = CKYCardContext_Create(SCARD_SCOPE_USER);
if (!mCardContext) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 3\n"));
- error_no = 45;
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot create card context! \n"));
+ error_no = CARD_CONTEXT_ERROR;
goto done;
}
mPDUWriter = new PDUWriterThread(this);
if (!mPDUWriter) {
- error_no = 46;
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 4\n"));
+ error_no = PDU_WRITER_ERROR;
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Cannot begin CoolKey operation. Cannot create internal PDU writer thread!\n"));
goto done;
}
@@ -528,8 +523,8 @@
if(mHttp_handle <= 0)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 5\n"));
- error_no = 47;
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("Cannot begin CoolKey operation. Can't create internal Http Client!\n"));
+ error_no = HTTP_CLIENT_ERROR;
goto done;
}
@@ -537,8 +532,8 @@
connected = ConnectToReader(readerName);
if (!connected) {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 6\n"));
- error_no = 48;
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("Cannot begin CoolKey operation. Can't connect to card reader!\n"));
+ error_no = CONN_READER_ERROR;
goto done;
}
@@ -569,12 +564,8 @@
CKYCardContext_Destroy(mCardContext);
mCardContext = 0;
}
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure 7\n"));
-
-
- NotifyEndResult(this, op, 1, error_no);
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::Init: failure attempted to NotifyEndResult error no %d\n",error_no));
+ NotifyEndResult(this, op, 1, error_no);
return E_FAIL;
}
@@ -586,22 +577,27 @@
{
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences !\n"));
+ //Grab the keyID which we will need
- int httpMessageTimeout = 30;
+ const char *keyID = mKey.mKeyID;
+ if(!keyID)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR,("Collecting CoolKey preferences. Cannot get keyID , cannot proceed. \n"));
- //Quickly grab the configurable http message timeout
+ return;
+ }
+
+ int httpMessageTimeout = 30;
+ //Quickly grab the configurable http message timeout
const char *msg_timeout = CoolKeyGetConfig("esc.tps.message.timeout");
-
if(msg_timeout)
{
-
httpMessageTimeout = atoi(msg_timeout);
-
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG,("CoolKeyHandler::CollectPreferences! Message timeout %d\n",httpMessageTimeout));
}
@@ -610,12 +606,27 @@
// Now grab the url for the tps server from config store.
- const char *tps_url = CoolKeyGetConfig("esc.tps.url");
+ string tps_operation = "Operation";
+
+ string tps_url_for_key = tps_operation + "-" + keyID;
+
+ const char *tps_url_for_key_str = tps_url_for_key.c_str();
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG,("CoolKeyHandler::CollectPreferences! tps_url %s\n",tps_url_for_key_str));
+ const char *tps_url = CoolKeyGetConfig(tps_url_for_key_str);
if(!tps_url)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences Can't find value for esc.tps.url \n"));
- return;
+ //now try to get the hard coded entry out of the config file.
+
+ tps_url = CoolKeyGetConfig("esc.tps.url");
+
+ if(!tps_url)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. Cannot find value for the TPS URL. \n"));
+
+ return;
+ }
}
PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences esc.tps.url %s\n",tps_url));
@@ -642,7 +653,7 @@
pos = tps_url_str.find(non_ssl_str,0);
if(pos == string::npos)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences esc.tps.url illegal protocol! \n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. TPS URL has specified an illegal protocol! \n"));
return;
}
@@ -685,7 +696,7 @@
if(!host_name_port_str.length())
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CollectPreferences Bad hostname and port sttring!.\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Collecting CoolKey preferences. Bad hostname and port value!.\n"));
return;
}
@@ -811,7 +822,7 @@
HRESULT CoolKeyHandler::SetPassword(const char *password)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::CloseConnection:\n"));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::SetPassword:\n"));
PR_Lock(mDataLock);
if(!mCharScreenNamePwd)
@@ -1162,7 +1173,7 @@
string ext_buffer = "";
- char *clientVer = "ESC 1.1";
+ char *clientVer = "ESC 1.0.0";
sprintf(buffer,"clientVersion=%s",clientVer);
ext_buffer = buffer;
@@ -1224,23 +1235,25 @@
void CoolKeyHandler::HttpProcessTokenPDU(CoolKeyHandler *context,eCKMessage_TOKEN_PDU_REQUEST *req)
{
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::ProcessTokenPDU:\n"));
- if(!req)
- {
- return;
- }
-
- int size = 4096;
- unsigned char pduData[4096];
-
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::ProcessTokenPDU:\n"));
+ if(!req || !context)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Bad input data. \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
- req->getPduData(pduData,&size);
+ int size = 4096;
+ unsigned char pduData[4096];
+ req->getPduData(pduData,&size);
- if(size == 0)
- {
- return;
- }
+ if(size == 0)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Can't extract PDU data from message! \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
// Send the PDU to the token
@@ -1250,56 +1263,61 @@
// structure is a C struct that contains a single member
// which just so happens to be an CKYBuffer.
- AutoCKYBuffer pduBuffer(pduData, size);
- CKYAPDU *requestAPDU = (CKYAPDU*)((CKYBuffer*)&pduBuffer);
+ AutoCKYBuffer pduBuffer(pduData, size);
+ CKYAPDU *requestAPDU = (CKYAPDU*)((CKYBuffer*)&pduBuffer);
- // XXX
+ AutoCKYBuffer response;
-
- AutoCKYBuffer response;
-
- CKYStatus status = CKYCardConnection_ExchangeAPDU(context->GetCardConnection(),
+ CKYStatus status = CKYCardConnection_ExchangeAPDU(context->GetCardConnection(),
requestAPDU, &response);
-
- if (status != CKYSUCCESS) {
- return;
- }
-
- eCKMessage_TOKEN_PDU_RESPONSE pdu_response;
+ if (status != CKYSUCCESS) {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR,
+ ("Processing HTTP message. Can't write apdu to card! status %d response[0] %x response[1] %x error %d \n"
+ ,status,CKYBuffer_GetChar(&response,0),CKYBuffer_GetChar(&response,1),
+ CKYCardConnection_GetLastError(context->GetCardConnection())));
- int pduSizeRet = (MESSAGE_u08) CKYBuffer_Size(&response);
- MESSAGE_byte *pduDataRet = (MESSAGE_byte *) CKYBuffer_Data(&response);
+ context->HttpOnDisconnect();
- if(pduSizeRet == 0 || !pduDataRet)
- {
- return;
- }
+ return;
+ }
+
+ eCKMessage_TOKEN_PDU_RESPONSE pdu_response;
- pdu_response.setPduData(pduDataRet,pduSizeRet);
+ int pduSizeRet = (MESSAGE_u08) CKYBuffer_Size(&response);
+ MESSAGE_byte *pduDataRet = (MESSAGE_byte *) CKYBuffer_Data(&response);
- string output = "";
+ if(pduSizeRet == 0 || !pduDataRet)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. No PDU response from card! \n"));
+ context->HttpOnDisconnect();
+ return;
+ }
- pdu_response.encode(output);
-
- NSS_HTTP_HANDLE handle = context->getHttpHandle();
+ pdu_response.setPduData(pduDataRet,pduSizeRet);
+ string output = "";
- if(handle && output.size())
- {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::sending to RA: %s \n",output.c_str()));
- NSS_HTTP_RESULT res = sendChunkedEntityData(output.size(),(unsigned char *) output.c_str(),handle);
+ pdu_response.encode(output);
+
+ NSS_HTTP_HANDLE handle = context->getHttpHandle();
- if(res == 0)
- {
- PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::write back to RA failed , disconnecting: \n"));
+ if(handle && output.size())
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler::sending to RA: %s \n",output.c_str()));
+ NSS_HTTP_RESULT res = sendChunkedEntityData(output.size(),(unsigned char *) output.c_str(),handle);
- context->CloseConnection();
- context->HttpOnDisconnect();
-
- }
+ if(res == 0)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_ERROR, ("Processing HTTP message. Write back to TPS failed , disconnecting. \n"));
+ context->HttpOnDisconnect();
+ }
+ else
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CoolKeyHandler:ProcessTokenPDU data written to RA .\n"));
+ }
- }
- return;
}
+
+}
HRESULT CoolKeyHandler::HttpProcessStatusUpdate(eCKMessage_STATUS_UPDATE_REQUEST * msg)
{
@@ -1624,25 +1642,33 @@
switch (operation) {
case ENROLL:
if (result == 0) {
+
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Enrollment success.\n"));
CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN());
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_EnrollmentComplete,
context->GetScreenName() == NULL ? 1 : 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Enrollment failure. Error: %d.\n",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, ("Key Reset Password success.\n"));
CoolKeyAuthenticate(context->GetAutoCoolKey(), context->GetPIN());
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_PINResetComplete, 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Reset Password failure. Error: %d.\n",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, ("Key Format success.\n"));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatComplete, 0);
} else {
+ PR_LOG( coolKeyLogHN, PR_LOG_ALWAYS, ("Key Format failure. Error: %d.\n",description));
CoolKeyNotify(context->GetAutoCoolKey(), eCKState_FormatError, description); // XXX: Need FORMAT_FAILED error code!
}
break;
@@ -1981,6 +2007,7 @@
if (tokenInfo->flags & CKF_TOKEN_INITIALIZED) {
mask |= COOLKEY_INFO_IS_PERSONALIZED_MASK;
}
+
return mask;
}
@@ -2059,6 +2086,7 @@
if (status != SECSuccess) {
return 0;
}
+
return MapGetFlags(&tokenInfo);
}
@@ -2075,9 +2103,14 @@
HRESULT hres;
int atrSize;
char *atrString;
+ SECItem isCOOLKey;
ATR.data = NULL; // initialize for error processing
label.data = NULL; // initialize for error processing
+ isCOOLKey.data = NULL;
+
+
+ int isACOOLKey = 0;
/* if it's one of "ours" it'll have a reader object */
obj = PK11_FindGenericObjects(aSlot, CKO_MOZILLA_READER);
@@ -2093,8 +2126,7 @@
// get the ATR (though, again, we probably don't need it
status = PK11_ReadRawAttribute(PK11_TypeGeneric, obj, CKA_MOZILLA_ATR, &ATR);
- PK11_DestroyGenericObjects(obj);
- obj = NULL;
+ // PK11_DestroyGenericObjects(obj);
if (status != SECSuccess) {
goto failed;
}
@@ -2104,6 +2136,34 @@
goto failed;
}
+ //get the are we a CoolKey value
+
+ status = PK11_ReadRawAttribute(PK11_TypeGeneric, obj, CKA_MOZILLA_IS_COOL_KEY, &isCOOLKey);
+
+ PK11_DestroyGenericObjects(obj);
+ obj = NULL;
+
+ if (status != SECSuccess) {
+ goto failed;
+ }
+
+ if(isCOOLKey.len == 1)
+ {
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: CKA_MOZILLA_IS_COOL_KEY %d.\n",(int) isCOOLKey.data[0]));
+
+ isACOOLKey=(int) isCOOLKey.data[0];
+ }
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->flags %u.\n",tokenInfo.flags));
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->label %s.\n",(char *)tokenInfo.label));
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->manufacturerID %s.\n",(char *)tokenInfo.manufacturerID));
+ 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.
info = new CoolKeyInfo();
if (!info) {
@@ -2122,6 +2182,10 @@
SECITEM_FreeItem(&ATR,PR_FALSE);
ATR.data = NULL;
+
+ PR_LOG( coolKeyLogHN, PR_LOG_DEBUG, ("CKHGetCoolKeyInfo: info->atr %s.\n",(char *)atrString));
+
+
info->mATR = atrString;
info->mReaderName= (char *)malloc(label.len+1);
if (!info->mReaderName) {
@@ -2130,6 +2194,12 @@
memcpy(info->mReaderName, label.data, label.len);
info->mReaderName[label.len] = 0;
info->mInfoFlags = MapGetFlags(&tokenInfo);
+
+ //Handle the isCOOLKey flag
+ if(isACOOLKey) {
+ info->mInfoFlags |= COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK;
+ }
+
info->mCUID = (char *)malloc(35); /* should be a define ! */
if (!info->mCUID) {
goto failed;
@@ -2142,6 +2212,8 @@
SECITEM_FreeItem(&ATR,PR_FALSE);
SECITEM_FreeItem(&label,PR_FALSE);
+ SECITEM_FreeItem(&isCOOLKey,PR_FALSE);
+
info->mSlot = PK11_ReferenceSlot(aSlot);
info->mSeries = PK11_GetSlotSeries(aSlot);
return info;
Index: CoolKeyHandler.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKeyHandler.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKeyHandler.h 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ CoolKeyHandler.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -95,6 +95,15 @@
FORMAT
};
+enum {
+ CONFIG_ERROR = 44,
+ CARD_CONTEXT_ERROR,
+ PDU_WRITER_ERROR,
+ HTTP_CLIENT_ERROR,
+ CONN_READER_ERROR
+
+};
+
class CoolKeyHandler
{
public:
Index: CoolKey_Message.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/CoolKey_Message.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- CoolKey_Message.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ CoolKey_Message.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,12 +15,14 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "nspr.h"
#include "CoolKey_Message.h"
#include "math.h"
#include <iostream>
-PRLogModuleInfo *nkeyLogMS = PR_NewLogModule("netkey");
+PRLogModuleInfo *nkeyLogMS = PR_NewLogModule("coolKeyMessage");
void URLEncode(unsigned char *buf,char *ret, int *ret_len,int buff_len);
void URLDecode(char *buf,unsigned char *ret, int *ret_len,int buff_len);
Index: NSSManager.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- NSSManager.cpp 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ NSSManager.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "NSSManager.h"
#include "SmartCardMonitoringThread.h"
@@ -31,14 +33,19 @@
#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("coolKey");
+static PRLogModuleInfo *coolKeyLogNSS = PR_NewLogModule("coolKeyNSS");
NSSManager::NSSManager()
{
@@ -59,6 +66,9 @@
{
// Init NSS
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("Initializing the NSS Crypto Library. \n"));
+
+
if(aAppDir)
{
SECStatus status = NSS_Init(aAppDir);
@@ -85,7 +95,7 @@
char modSpec[512];
- sprintf(modSpec,"library='%s' name='%s' parameters='%s'\n",COOLKEY_PKCS11_LIBRARY,COOLKEY_NAME,PROMISCUOUS_PARAMETER);
+ sprintf(modSpec,"library=\"%s\" name=\"%s\" parameters=\"%s\" NSS=\"slotParams={0x00000002=[slotFlags='PublicCerts']}\"\n",COOLKEY_PKCS11_LIBRARY,COOLKEY_NAME,PROMISCUOUS_PARAMETER);
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("InitNSS: modSpec %s\n",modSpec));
@@ -96,7 +106,7 @@
if(!userModule || !userModule->loaded)
{
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::InitNSS problem loading PKCS11 module. \n"));
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("NSSManager::InitNSS problem loading PKCS11 module. No keys will be recognized!\n"));
return E_FAIL;
}
@@ -122,13 +132,6 @@
// Logout all tokens.
PK11_LogoutAll();
-
- //No longer Shutdown NSS, we are using the PSM XPCOM service which
- // takes care of this
-
- // SECStatus rv = NSS_Shutdown();
-
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::Shutdown \n"));
}
bool
@@ -246,13 +249,11 @@
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertNickNames \n"));
-
if(!aKey )
{
return E_FAIL;
}
-
PK11SlotInfo *slot = GetSlotForKeyID(aKey);
if (!slot)
@@ -260,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)
{
@@ -306,10 +333,91 @@
}
+HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+
+ if(!aBuf)
+ return E_FAIL;
+
+ aBuf[0]=0;
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyIssuedTo \n"));
+
+ 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, ("NSSManager::GetKeyIssuedTo no certs found! \n"));
+ PK11_FreeSlot(slot);
+ return E_FAIL;
+ }
+
+ CERTCertListNode *node= NULL;
+
+ char *certID = 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)
+ {
+
+ certID = CERT_GetCommonName(&cert->subject);
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",slot,cert->slot,certID));
+
+ }
+
+ if(certID)
+ break;
+ }
+ }
+
+ }
+
+ if(certID && ((int)strlen(certID) < aBufLength))
+ {
+ strcpy(aBuf,certID);
+ }
+
+ if(certs)
+ CERT_DestroyCertList(certs);
+
+ if(slot)
+ PK11_FreeSlot(slot);
+
+ if(certID)
+ PORT_Free(certID);
+
+ return S_OK;
+}
+
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 = "";
@@ -330,7 +438,7 @@
return E_FAIL;
}
- CERTCertList *certs = PK11_ListCertsInSlot(slot);
+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
if (!certs)
{
@@ -339,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;
+
+ 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()));
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("NSSManager::GetKeyCertInfo info: %s \n",aCertInfo.c_str()));
if(certs)
CERT_DestroyCertList(certs);
@@ -361,6 +525,7 @@
return S_OK;
}
+
HRESULT
NSSManager::GetKeyPolicy(const CoolKey *aKey, char *aBuf, int aBufLength)
{
@@ -404,6 +569,7 @@
if (aBufLength - policyLen - 1 >=0) {
// if this policy ID isn't in the buffer, add it.
+
if (!strstr(aBuf, policyID)) {
// assuming that this isn't the start, add our delimiter
Index: NSSManager.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/NSSManager.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- NSSManager.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ NSSManager.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -23,7 +23,9 @@
#define COOLKEY_NAME "COOL Key Module"
#define MUSCLE_NAME "SLB PKCS #11 module"
-#define PROMISCUOUS_PARAMETER "promiscuous=yes"
+#define PROMISCUOUS_PARAMETER "noAppletOK=yes"
+#define NSS_PUBLIC_CERTS "slotFlags=PublicCerts"
+
#ifndef NSSMANAGER_H
#define NSSMANAGER_H
@@ -64,6 +66,8 @@
static HRESULT GetKeyCertNicknames( const CoolKey *aKey, vector<string> & aStrings );
+ static HRESULT GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength);
+
Index: SlotUtils.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SlotUtils.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SlotUtils.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SlotUtils.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,6 +15,8 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+#define FORCE_PR_LOG 1
+
#include "nss.h"
#include "secmod.h"
#include "pk11func.h"
@@ -42,7 +44,7 @@
static std::list<CoolKeyInfo*> gCoolKeyList;
PRLock *gCoolKeyListLock = NULL;
-static PRLogModuleInfo *coolKeyLogSU = PR_NewLogModule("coolKey");
+static PRLogModuleInfo *coolKeyLogSU = PR_NewLogModule("coolKeySlot");
#ifdef DEBUG
int gCoolKeyListLockCount = 0;
#endif // DEBUG
@@ -315,6 +317,10 @@
CoolKeyInfo *info = GetCoolKeyInfoByKeyIDInternal(aKey);
+ int alreadyCoolKey = 0;
+ if( IS_REALLY_A_COOLKEY(info->mInfoFlags))
+ alreadyCoolKey = 1;
+
if (!info)
return -1;
@@ -323,6 +329,11 @@
info->mInfoFlags = CKHGetInfoFlags(info->mSlot);
+ if(alreadyCoolKey)
+ {
+ info->mInfoFlags |= COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK;
+ }
+
return 0;
}
Index: SlotUtils.h
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SlotUtils.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SlotUtils.h 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SlotUtils.h 27 Sep 2006 17:47:46 -0000 1.2
@@ -38,10 +38,12 @@
#define COOLKEY_INFO_HAS_ATR_MASK (1 << 0)
#define COOLKEY_INFO_HAS_APPLET_MASK (1 << 1)
#define COOLKEY_INFO_IS_PERSONALIZED_MASK (1 << 2)
+#define COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK (1 << 3)
#define HAS_ATR(info) ((info)&COOLKEY_INFO_HAS_ATR_MASK)
#define HAS_APPLET(info) ((info)&COOLKEY_INFO_HAS_APPLET_MASK)
#define IS_PERSONALIZED(info) ((info)&COOLKEY_INFO_IS_PERSONALIZED_MASK)
+#define IS_REALLY_A_COOLKEY(info) ((info)&COOLKEY_INFO_IS_REALLY_A_COOLKEY_MASK)
struct CoolKeyInfo
{
Index: SmartCardMonitoringThread.cpp
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/SmartCardMonitoringThread.cpp,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- SmartCardMonitoringThread.cpp 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ SmartCardMonitoringThread.cpp 27 Sep 2006 17:47:46 -0000 1.2
@@ -15,13 +15,7 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
-//#include "XptlBase.h"
-//#include "CoolBucky.h"
-//#include "CoolSec.h"
-//#include "CoolBos.h"
-//#include "ILocateManager.h"
-//#include "ICertificateBlob.h"
-//#include "atlbase.h"
+#define FORCE_PR_LOG 1
#include "nspr.h"
@@ -32,14 +26,10 @@
#include "NSSManager.h"
#include "CoolKeyID.h"
#include "SlotUtils.h"
-//#include "CoolKeyThreadEventService.h"
-
#include <assert.h>
-static PRLogModuleInfo *coolKeyLogSC = PR_NewLogModule("coolKey");
-
-//WINOLEAPI CoInitializeEx(IN LPVOID pvReserved, IN DWORD dwCoInit);
+static PRLogModuleInfo *coolKeyLogSC = PR_NewLogModule("coolKeySmart");
SmartCardMonitoringThread::SmartCardMonitoringThread(SECMODModule *aModule)
: mModule(aModule), mThread(NULL)
@@ -79,7 +69,7 @@
{
PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Insert pig: \n"));
+ ("SmartCardMonitoringThread::Insert Key. \n"));
CoolKeyInfo *info = CKHGetCoolKeyInfo(aSlot);
if (info) {
@@ -95,7 +85,7 @@
void SmartCardMonitoringThread::Remove(CoolKeyInfo *info)
{
PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Remove : \n"));
+ ("SmartCardMonitoringThread::Remove Key: \n"));
info->mInfoFlags = 0;
AutoCoolKey key(eCKType_CoolKey, info->mCUID);
@@ -136,9 +126,8 @@
slot = SECMOD_WaitForAnyTokenEvent(mModule, 0, PR_SecondsToInterval(1) );
- PR_LOG( coolKeyLogSC, PR_LOG_DEBUG,
- ("SmartCardMonitoringThread::Execute Token Event fired :"
- " slot %p \n", slot));
+ PR_LOG( coolKeyLogSC, PR_LOG_ALWAYS,
+ ("SmartCard thread event detected. \n"));
if (slot == NULL) {
Index: ckymanager.def
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/ckymanager.def,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ckymanager.def 12 Jun 2006 23:39:52 -0000 1.1.1.1
+++ ckymanager.def 27 Sep 2006 17:47:46 -0000 1.2
@@ -56,10 +56,6 @@
CoolKeySetDataValue;
CoolKeyGetTokenName;
CoolKeyGetKeyID;
-CoolKeyGetPref;
-CoolKeyFreePref;
-CoolKeyPrefInit;
-CoolKeyPrefShutdown;
;+ local:
;+ *;
;+};
Index: manifest.mn
===================================================================
RCS file: /cvs/dirsec/esc/src/lib/coolkey/manifest.mn,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- manifest.mn 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ manifest.mn 27 Sep 2006 17:47:46 -0000 1.2
@@ -17,10 +17,14 @@
CORE_DEPTH = ../../..
+SYS_INC = /usr/include
MODULE = ckymanager
LIBRARY_NAME = $(MODULE)
REQUIRES = httpchunked nss nspr ckyapplet
-DEFINES += -I$(CORE_DEPTH)/esc/app/xpcom
+ifndef MOZ_OFFSET
+MOZ_OFFSET = mozilla-1.7.13
+endif
+DEFINES += -I$(CORE_DEPTH)/esc/app/xpcom -I$(SYS_INC)/nspr4 -I$(SYS_INC)/nss3 -I$(SYS_INC)/PCSC -I$(SYS_INC)/$(MOZ_OFFSET)/nspr -I$(SYS_INC)/$(MOZ_OFFSET)/nss
MAPFILE = $(OBJDIR)/ckymanager.def
#EXTRA_LIBS += -L$(DIST)/lib -lckyapplet
@@ -31,12 +35,10 @@
CoolKey_Message.cpp \
CoolKeyHandler.cpp \
CoolKey.cpp \
- CoolKeyPref.cpp \
SmartCardMonitoringThread.cpp \
$(NULL)
EXPORTS = \
CoolKey.h \
- CoolKeyPref.h \
$(NULL)
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/icons/default esc-window.xpm, NONE, 1.1
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/icons/default
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27342
Added Files:
esc-window.xpm
Log Message:
Initial revision.
--- NEW FILE esc-window.xpm ---
/* XPM */
static char * esc_client_16_xpm[] = {
"16 16 129 2",
" c None",
". c #1C1C1C",
"+ c #101010",
"@ c #1D1D1D",
"# c #3B3B3B",
"$ c #4F4F4F",
"% c #6C6C6D",
"& c #8F9091",
"* c #484848",
"= c #0A0A0A",
"- c #323232",
"; c #3F3F3F",
"> c #95989E",
", c #9CA5B4",
"' c #A4B2C9",
") c #A9B9D3",
"! c #8A919C",
"~ c #393939",
"{ c #1A1A1A",
"] c #9C9C9D",
"^ c #B1B8C3",
"/ c #9CACC5",
"( c #97ACCD",
"_ c #9AAFD1",
": c #AABBD7",
"< c #AFBACB",
"[ c #4B515B",
"} c #434548",
"| c #585858",
"1 c #222222",
"2 c #AAB1BE",
"3 c #9CB1D3",
"4 c #B6C4D9",
"5 c #D0D4DA",
"6 c #D2D2D2",
"7 c #C2C2C2",
"8 c #606060",
"9 c #696969",
"0 c #909090",
"a c #6A6A6A",
"b c #626262",
"c c #242424",
"d c #232323",
"e c #A5AEBB",
"f c #B8C6DD",
"g c #D8D9DD",
"h c #B8B8B8",
"i c #B9B9B9",
"j c #AEAEAB",
"k c #4A4A44",
"l c #90908F",
"m c #51514A",
"n c #55533F",
"o c #5A5A55",
"p c #2B2B2B",
"q c #252525",
"r c #A4ACB9",
"s c #B8C6DE",
"t c #DADCDF",
"u c #C9C9C9",
"v c #C4C6CA",
"w c #7D7F7D",
"x c #6A5E29",
"y c #9D9781",
"z c #7C7763",
"A c #C2BF95",
"B c #87826E",
"C c #56523B",
"D c #15140D",
"E c #A2AAB7",
"F c #B7C6DF",
"G c #B4BED9",
"H c #B4BED6",
"I c #A1ADCE",
"J c #616873",
"K c #988420",
"L c #DBBF3F",
"M c #DAC571",
"N c #ECD056",
"O c #D4A83A",
"P c #BF8821",
"Q c #221805",
"R c #272727",
"S c #A1A9B5",
"T c #B1C2DD",
"U c #AAB9D9",
"V c #B2C0DD",
"W c #A5B7D5",
"X c #646F78",
"Y c #99831D",
"Z c #F0E67E",
"` c #C1C286",
" . c #342C06",
".. c #B18B11",
"+. c #DD9A13",
"@. c #261A03",
"#. c #262626",
"$. c #ABB0B8",
"%. c #B6C5DF",
"&. c #A1B2CE",
"*. c #8D9CB3",
"=. c #818A99",
"-. c #4D5051",
";. c #7D6512",
">. c #EBDC6E",
",. c #D8D893",
"'. c #64590D",
"). c #D8AE19",
"!. c #DD9B13",
"~. c #757576",
"{. c #727478",
"]. c #535456",
"^. c #424242",
"/. c #1E1E1E",
"(. c #030303",
"_. c #312504",
":. c #AE9C3A",
"<. c #DBD176",
"[. c #BCA313",
"}. c #D5A415",
"|. c #AF7B0F",
"1. c #201603",
"2. c #171717",
"3. c #0D0D0D",
"4. c #272209",
"5. c #2C2914",
"6. c #2D2604",
"7. c #2D2204",
"8. c #2B1F04",
" ",
" ",
" . + ",
" @ # $ % & * ",
" = - - ; > , ' ) ! ~ ",
" { ] ^ / ( _ : < [ } | 1 ",
" 1 2 3 4 5 6 7 8 9 0 a b c ",
" d e f g h i j k l m n o p ",
" q r s t u v w x y z A B C D ",
" q E F G H I J K L M N O P Q ",
" R S T U V W X Y Z ` ...+.@. ",
" #.$.%.&.*.=.-.;.>.,.'.).!.@. ",
" @ ~.{.].^./.(._.:.<.[.}.|.1. ",
" = 2.3.{. 4.5.6.7.8. ",
" ",
" "};
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/locale/en-US esc.dtd, 1.2, 1.3 esc.properties, 1.2, 1.3
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27296
Modified Files:
esc.dtd esc.properties
Log Message:
Latest updates.
Index: esc.dtd
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.dtd 13 Sep 2006 17:56:06 -0000 1.2
+++ esc.dtd 27 Sep 2006 17:45:14 -0000 1.3
@@ -28,13 +28,14 @@
<!ENTITY progressHeader "Progress">
<!ENTITY unknownIssuer "Unknown Issuer">
<!ENTITY unknown "Unknown">
+<!ENTITY copyToClipboard "Copy To Clipboard">
<!ENTITY cancel "Cancel">
<!ENTITY doEnroll "Enroll">
<!ENTITY doCancel "Cancel">
<!ENTITY doResetPin "Reset Password">
<!ENTITY doFormat "Format">
-<!ENTITY keyPassword "Password">
-<!ENTITY pluggedInCards "Plugged-In-Cards">
+<!ENTITY keyPassword "Smart Card Password">
+<!ENTITY pluggedInCards "Active Smart Cards">
<!ENTITY keyIssuer "Issuer">
<!ENTITY keyIssuedTo "Issued To">
<!ENTITY keyStatus "Status">
@@ -57,7 +58,7 @@
<!ENTITY insertKey "To enroll your smart card, please insert your security card or USB key now.">
<!ENTITY adminNoKeysMessage "In order to administer your security smart cards, you must have one or more cards connected to the computer. Please do so now.">
<!ENTITY progressHeader "Progress">
-<!ENTITY detectedKeyDetailsHeader "Security Information">
+<!ENTITY detectedKeyDetailsHeader "Smart Card Functions">
<!ENTITY keyEnrollmentHeader "Create Password">
<!ENTITY passwordQuality "Password Quality">
<!ENTITY unknownIssuer "Unknown Issuer">
@@ -70,13 +71,16 @@
<!ENTITY enrollKeyNow "Enroll My Smart Card Now">
<!ENTITY enrollKey "Enroll Smart Card">
<!ENTITY administerKeys "Manage Smart Cards">
-<!ENTITY administerMessage "Here you can perform various operations upon your smart card(s). For instance, Formatting a card results in preparing a card for future enrollment.">
+<!ENTITY administerMessage "This tool helps you manage your smart cards and to examine their contents when you are having problems. To manage your smart cards, you must connect them to the computer.">
<!ENTITY blankKeyLabel "Blank Key">
<!ENTITY adminDetailsMessage "This smart card is not personalized.">
<!ENTITY advancedInfo "Diagnostics">
-<!ENTITY doViewCerts "View My Certificates">
-<!ENTITY getESCPassword "Password Information">
+<!ENTITY doViewCerts "View Certificates">
+<!ENTITY getESCPassword "Password">
<!ENTITY escOK "OK">
<!ENTITY escCancel "Cancel">
-<!ENTITY tpsConfigDesc "Smart Card Manager has detected a totally blank smart card. Smart Card Manager can not determine the location of the Smart Card Server for this card. Please enter the correct URL value so the Smart Card Server can be reached. The value should be of the form: http(s)://test.host.com:7888/home.cgi.">
+<!ENTITY tpsConfigDesc "You have inserted a smart card that the Smart Card Manager recognizes, but needs to be formatted.">
+<!ENTITY tpsConfigDesc1 "Before you can use this smart card, you need to do two things. First, you need to specify the location (URL) of the smart card server in the text box below. The Smart Card Manager will insert this location onto the smart card.">
+<!ENTITY tpsConfigDesc2 "Second, you must format it from the main Smart Card Manager window.">
+<!ENTITY tpsConfigDesc3 "Enter the location of the smart card server (such as https://smartcardserver.example.com:7888)">
<!ENTITY diagnosticsMessage "The information below is diagnostic information that your system generates as you use your smart card. If you are having smart card problems, you may be asked by your support engineer to send this information for analysis.">
Index: esc.properties
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/locale/en-US/esc.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.properties 13 Sep 2006 17:56:06 -0000 1.2
+++ esc.properties 27 Sep 2006 17:45:14 -0000 1.3
@@ -29,38 +29,60 @@
statusUninitialized=UNINITIALIZED
statusUnknown=UNKNOWN
statusBusy=BUSY
-unknownIssuer=Unknown Issuer
+unknownIssuer=Unknown
redHatUser=User
statusUnknown=Unknown
+appletVersion = Smart Card Applet Version:
+operationPINReset=Resetting Key Password..
+operationEnrollment=Enrolling Key..
+operationFormat=Formatting Key..
tokenInformation=CARD INFORMATION
advancedInformation=Diagnostics Information
keyID=Key ID:
-tpsURI=Server URL:
-tpsUI=External UI URL:
+tpsURI=Smart Card Server URL:
+tpsUI=Enrollment UI URL:
+tpsPhoneHomeURL=Phone Home URL:
status=Status:
issuer=Issuer:
-escLogEntries=Log Entries
-noLogFileOrData=No Log File or Log File Has No Data.
-certsOnToken=CERTIFICATES on KEY
+escLogEntries=Smart Card Activity
+noLogFileOrData=No log file or log file has no data.
+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
-enrolledDetectedMessage=Smart Card Manager has detected an enrolled card. If you would rather not re-enroll this card press "Close".
+enrolledDetectedMessage=Smart Card Manager has detected an already enrolled card. If you do not wish to re-enroll, press the "Close" button.
+unenrolledDetectedMessage=Smart Card Manager has detected that you have entered a new and un-enrolled smart card. Before you can use this smart card, you have to enroll it. Enrolling your smart card personalizes it so only you can use it for secure operations.
+enrollAnyway=If you would like to re-enroll anyway, click Enroll My Smart Card Now.
+readyToProceed=When you are ready to begin the process,click Enroll My Smart Card Now.
formatingToken=Formatting...
enrollingToken=Enrolling...
-resettingTokenPIN=Resetting Password...
-cancellingOperation=Cancelling...
-blinkingToken=Blinking...
+resettingTokenPIN=Password Reset..
+cancellingOperation=Cancelling..
+blinkingToken=Blinking..
keyInserted=Smart Card Inserted!
keyRemoved=Smart Card Removed!
-keyInsertedComputer=Security Smart Card Inserted into the computer.
-keyRemovedComputer=Security Smart Card Removed from the computer.
+keyInsertedComputer=smart card inserted.
+keyRemovedComputer=smart card removed.
diagnosticsMessage=The information below is diagnostic information that your system generates as you use your smart card. If you are having smart card problems, you may be asked by your support engineer to send this information for analysis.
+
+menuManageKeys=Manage Smart Cards
+menuExit=Exit Smart Card Manager
#ESC Error Messages from TPS
errorNone=Operation Completed Successfully.
serverError=Smart Card Server error.
-errorProblemResetTokenPin=Problem resetting smart card's pin.
+errorProblemResetTokenPin=Internal Smart Card Server error.
errorTokenEnrollment=Smart card enrollment error.
errorCommCA=Error communicating with the Certification Authority.
errorInternalServer=Internal Smart Card Server error.
@@ -75,7 +97,7 @@
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 smart card in smart card database.
+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.
@@ -130,15 +152,15 @@
errorGetAvailCoolKeys=coolkey.GetAvailableCoolKeys() failed!
errorEnollCoolKey=coolkey.EnrollCoolKey() failed!
errorCoolKeyIsEnrolled=coolkey.GetCoolKeyIsEnrolled failed!
-errorResetCoolKeyPIN=coolkey.ResestCoolKeyPIN() failed! Make sure Smart card is properly Enrolled.
+errorResetCoolKeyPIN=coolkey.ResestCoolKeyPASSWORD() failed! Make sure smart card is enrolled.
errorFormatCoolKey=coolkey.FormatCoolKey() failed!
errorCancelCoolKey=coolkeyCancelCoolKeyOperation() failed!
errorBlinkCoolKey=coolkey.BlinkCoolKey() failes!
noCurrentlySelectedToken=No currently selected smart card!
errorProvideScreenName=You must provide a valid screen name!
-errorProvideTokenPIN=You must provide a valid TokenPIN!
-errorMatchPinValues=The PIN values you entered don't match!
-errorValidUserPassword=You must provide a valid User Password!
+errorProvideTokenPIN=You must provide a valid card password!
+errorMatchPinValues=The Password values you entered don't match!
+errorValidUserPassword=You must provide a valid user password!
errorSelectKey=Please select a smart card.
errorEnrolledFirst=Smart card must be enrolled first! Enroll card and try again.
enrollmentFor=Enrollment for
@@ -146,10 +168,10 @@
pinResetSuccessful=Password Reset was successfull!
formatOf=Format of
error=Error
-serverResponse= \n\n Server Response:
+serverResponse= Server Response:
enrollmentOfKey=Enrollment of smart card
formatingOfKey=Formatting of smart card
-pinResetOfKey=PIN Reset for smart card
+pinResetOfKey=Password Reset for smart card
operationForKey=Operation for smart card
failed=failed.
cancelled=cancelled.
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc application.ini, 1.1.1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27266
Modified Files:
application.ini
Log Message:
Latest updates.
Index: application.ini
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/application.ini,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- application.ini 12 Jun 2006 23:39:50 -0000 1.1.1.1
+++ application.ini 27 Sep 2006 17:44:31 -0000 1.2
@@ -25,20 +25,16 @@
Name=ESC
;
; This field specifies your application's version. This field is optional.
-Version=0.1
+Version=1.0.0
;
; This field specifies your application's build ID (timestamp). This field is
; required.
-BuildID=0000000000
-;
-; This field specifies a compact copyright notice for your application. This
-; field is optional.
-Copyright=Copyright (c) 2004 Mozilla.org
+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
; irc.mozilla.org and /msg botbot uuid. This field is optional.
-ID={777f7150-4a2b-4301-ad10-5eab25b322aa}
+ID={6380471b-1924-4b48-b652-49f42951af86}
[Gecko]
;
@@ -54,8 +50,3 @@
MaxVersion=1.9
[Shell]
-;
-; This field specifies the location of your application's main icon with file
-; extension excluded. NOTE: Unix style file separators are required. This
-; field is optional.
-Icon=chrome/icons/default/simple
17 years, 6 months
[Fedora-directory-commits] esc/rpm esc,1.1,1.2 esc.spec,1.1,1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/rpm
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27229
Modified Files:
esc esc.spec
Log Message:
Latest updates.
Index: esc
===================================================================
RCS file: /cvs/dirsec/esc/rpm/esc,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- esc 27 Sep 2006 17:19:19 -0000 1.1
+++ esc 27 Sep 2006 17:42:38 -0000 1.2
@@ -1,4 +1,21 @@
#!/bin/sh
+#
+# 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
ESC_PROFILE_BASE=~/.redhat/esc
ESC_LOG_FILE=esc.log
Index: esc.spec
===================================================================
RCS file: /cvs/dirsec/esc/rpm/esc.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- esc.spec 27 Sep 2006 17:19:19 -0000 1.1
+++ esc.spec 27 Sep 2006 17:42:38 -0000 1.2
@@ -1,3 +1,22 @@
+# 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: 16%{?dist}
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc AdvancedInfo.js, 1.1, 1.2 ESC.js, 1.2, 1.3 GenericAuth.js, 1.2, 1.3 GenericAuth.xul, 1.1.1.1, 1.2 TRAY.js, 1.2, 1.3 config.xul, 1.2, 1.3 esc.css, 1.2, 1.3 esc.xul, 1.2, 1.3 settings.xul, 1.2, 1.3
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27136
Modified Files:
AdvancedInfo.js ESC.js GenericAuth.js GenericAuth.xul TRAY.js
config.xul esc.css esc.xul settings.xul
Log Message:
Latest updates.
Index: AdvancedInfo.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/AdvancedInfo.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AdvancedInfo.js 13 Sep 2006 18:01:01 -0000 1.1
+++ AdvancedInfo.js 27 Sep 2006 17:31:51 -0000 1.2
@@ -15,21 +15,21 @@
* All rights reserved.
* END COPYRIGHT BLOCK **/
+
+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);
}
}
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ESC.js 13 Sep 2006 17:56:49 -0000 1.2
+++ ESC.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -32,8 +32,6 @@
var gHiddenPageDone = 0;
var gExternalUI = 0;
-var gDiagnosticsCopyString=null;
-
loadStringBundle();
//ESC constants
@@ -46,6 +44,11 @@
const ISSUER_TAG = "IssuerName";
const SERVICE_INFO_TAG = "ServiceInfo";
+const UNINITIALIZED = 1;
+const UNINITIALIZED_NOAPPLET = 2;
+const ESC_ENROLL_WIDTH = 600;
+const ESC_ENROLL_HEIGHT = 570;
+
//Window names
const ENROLL_WINDOW = "esc.xul";
@@ -215,22 +218,33 @@
}
+// Main function that oversees obtaining Phone Home Info from the Server
+
function DoPhoneHome(keyType,keyID)
{
var callback = function (aResult) {
+ var issuer = "";
if(aResult == true)
{
+ issuer = GetCachedIssuer(keyID);
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
UpdateRowWithPhoneHomeData(keyType,keyID);
}
else
{
- launchCONFIG(keyType,keyID);
+ issuer = getBundleString("unknownIssuer");
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+ //launchCONFIG(keyType,keyID);
}
}
if(IsPhoneHomeCached(keyID))
{
+ issuer = GetCachedIssuer(keyID);
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
return true;
}
@@ -240,10 +254,10 @@
if(home)
{
- homeRes = phoneHome(home,keyID,callback);
+ homeRes = phoneHome(home,keyID,callback);
}
- if(!homeRes)
+ if(!home)
{
launchCONFIG(keyType,keyID);
}
@@ -797,69 +811,136 @@
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";
- //dump += "<p><br>" + getBundleString("diagnosticsMessage") + "<br></p>";
+ textDump += " " + getBundleString("coolkeyComponentVersion");
+ textDump += " " + coolkeyVersion + "\n";
- dump += "<p><br><b>" + getBundleString("coolkeyComponentVersion") + "</b>" ;
- dump += " " + coolkeyVersion ;
- dump += "<br><b>" + getBundleString("coolkeyDetectedNumberKeys") + "</b>";
- dump += " " + arr.length + "</p>" ;
+ textDump += " " + agent + "\n";
+
+ 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);
+
+ if(!tpsURI)
+ tpsURI="";
+
+ if(!tpsUI)
+ tpsUI = "";
+
+ if(!phoneHomeURI)
+ phoneHomeURI = "";
+
+ textDump += " " + getBundleString("tpsPhoneHomeURL") + " " + " " + phoneHomeURI + "\n";
+ textDump += " " + getBundleString("tpsURI") + " " + " " + tpsURI + "\n";
+ textDump += " " +getBundleString("tpsUI") + " " + " " + tpsUI + "\n";
- dump += "<b>" + getBundleString("tpsURI") + "</b>" + " " + tpsURI + "<br>";
- dump += "<b>" + getBundleString("tpsUI") + "</b>" + " " + tpsUI + "<br>";
+ 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";
+
+
+ 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>";
+ 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);
}
@@ -1338,15 +1419,29 @@
var detected_key_message = document.getElementById("detected-key-message");
var enroll_key_message = document.getElementById("enroll-key-message");
+
+ if(!enroll_key_message)
+ return;
+
var unenrolled_key_heading = document.getElementById("unenrolled-key-heading");
+ if(!unenrolled_key_heading)
+ return;
+
+
+ var enroll_proceed_message = document.getElementById("enroll-proceed-message");
+
+ if(!enroll_proceed_message)
+ return;
if(alreadyEnrolled)
{
unenrolled_key_heading.setAttribute("value",getBundleString("enrolledDetected"));
+ ChangeDescription(enroll_proceed_message,getBundleString("enrollAnyway"));
+ }
+ else
+ {
+ ChangeDescription(enroll_proceed_message,getBundleString("readyToProceed"));
}
-
- if(!unenrolled_key_heading)
- return;
var no_key_heading = document.getElementById("no-key-heading");
@@ -1407,7 +1502,9 @@
ShowItem(enroll_area);
HideItem(yes_key_area);
ShowItem(enroll_key_message);
- enrollBtn.setAttribute("oncommand","DoEnrollCoolKey()");
+
+ enrollBtn.setAttribute("onclick","DoEnrollCoolKey();");
+
ShowItem(enrollBtn);
}
else
@@ -1420,7 +1517,7 @@
HideItem(yes_key_area);
HideItem(enroll_key_message);
HideItem(enrollBtn);
- UpdateESCSize(600,550);
+ UpdateESCSize(ESC_ENROLL_WIDTH,ESC_ENROLL_HEIGHT);
}
}
@@ -1432,11 +1529,16 @@
if(alreadyEnrolled)
{
- detected_key_message.setAttribute("value",getBundleString("enrolledDetectedMessage"));
+ ChangeDescription(detected_key_message,getBundleString("enrolledDetectedMessage"));
+ }
+ else
+ {
+ ChangeDescription(detected_key_message,getBundleString("unenrolledDetectedMessage"));
+
}
ShowItem(detected_key_message);
- enrollBtn.setAttribute("oncommand","DoShowFullEnrollmentUI()");
+ enrollBtn.setAttribute("onclick","DoShowFullEnrollmentUI();");
ShowItem(enrollBtn);
}
@@ -1502,19 +1604,19 @@
return;
}
- if(pwstrength < 20)
+ if(pwstrength < 40)
{
qualityImage.setAttribute("src", "2-vweak.png");
return;
}
- if(pwstrength >= 20 && pwstrength < 40)
+ if(pwstrength >= 40 && pwstrength < 50)
{
qualityImage.setAttribute("src","3-weak.png");
return;
}
- if(pwstrength >=40 && pwstrength < 60)
+ if(pwstrength >=50 && pwstrength < 60)
{
qualityImage.setAttribute("src","4-fair.png");
return;
@@ -1580,16 +1682,16 @@
switch (status) {
case 7: // PINResetInProgress
- result = "Resetting Key Password..";
+ result = getBundleString("operationPINReset");
break;
case 5: // EnrollmentInProgress
- result = "Enrolling Key..";
+ result = getBundleString("operationEnrollment");
break;
case 9: // FormatInProgress
- result = "Formatting Key..";
+ result = getBundleString("operationFormat");
break;
}
@@ -1782,11 +1884,16 @@
InsertCoolKeyIntoAdminBindingList(arr[i][0], arr[i][1]);
if (!gCurrentSelectedRow)
+ {
SelectRowByKeyID(arr[i][0], arr[i][1]);
+ UpdateAdminKeyDetailsArea(arr[i][0],arr[i][1]);
+ }
}
if(i > 0)
+ {
UpdateESCSize();
+ }
}
function UpdateBindingTableAvailability()
@@ -1812,7 +1919,7 @@
gEnrollmentPage = 1;
UpdateCoolKeyAvailabilityForEnrollment();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
window.setTimeout("showOrHideTabsUI()",2);
}
@@ -1820,7 +1927,7 @@
{
UpdateBindingTableAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
+ //showOrHideEscOnLaunch();
}
function InitializeAdminBindingList()
@@ -1830,8 +1937,8 @@
UpdateAdminBindingListAvailability();
UpdateButtonStates();
- showOrHideEscOnLaunch();
- showOrHideTabsUI();
+ //showOrHideEscOnLaunch();
+ //showOrHideTabsUI();
}
//Window related functions
@@ -1844,7 +1951,8 @@
// We do want notify events though
var doPreserveNotify = true;
-
+
+ SetMenuItemsText();
TrayRemoveWindow(doPreserveNotify);
}
@@ -1954,12 +2062,27 @@
return result;
}
-function SelectESCPage(keyUninitialized)
+function SelectESCPage(keyType,keyID,phoneHomeFailed)
{
if(!gHiddenPage)
return;
+ var keyUninitialized = 0;
+ var keyStatus = GetCoolKeyStatus(keyType,keyID);
+
+ switch (keyStatus) {
+ case 1: //no applet
+ keyUninitialized = UNINITIALIZED_NOAPPLET;
+ break;
+ case 2: // uninitialized
+ keyUninitialized = UNINITIALIZED;
+ break;
+ case 4: // Enrolled
+ keyUninitialized = 0;
+ break;
+ }
+
//alert("SelectESCPage initialized " + keyUninitialized + " gEnrollmentPage " + gEnrollmentPage + " gFactoryMode " + gFactoryMode + " gHiddenPage " + gHiddenPage);
//Get the primary page windows if present
@@ -1967,7 +2090,7 @@
var enrollWnd = IsPageWindowPresent(ENROLL_WINDOW);
var adminWnd = IsPageWindowPresent(ADMIN_WINDOW);
- if(keyUninitialized)
+ if(keyUninitialized == UNINITIALIZED && !phoneHomeFailed) //formatted uninitialized card
{
if(!TrayLoadedOK()) // We have no tray icon, launch both
@@ -1975,10 +2098,11 @@
if(!adminWnd)
{
- launchSETTINGS();
+ // launchSETTINGS();
}
}
+
if(enrollWnd) //Enrollment window is already up
{
enrollWnd.focus();
@@ -1992,9 +2116,8 @@
else
{
//Launch admin page if factory mode is enabled
- // or we are without the tray icon.
- if(gFactoryMode)
+ if(gFactoryMode || phoneHomeFailed || keyUninitialized == UNINITIALIZED_NOAPPLET) //no applet
{
if(adminWnd) // Handle case where admin page is already up
@@ -2069,6 +2192,8 @@
function UpdateButtonStates()
{
+return;
+
var enroll_btn = document.getElementById("enrollbtn");
var reset_btn = document.getElementById("resetpinbtn");
@@ -2268,6 +2393,8 @@
if(!gAdminPage)
return;
+ var isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
+
var noKey = 0;
if(!keyType || !keyID)
@@ -2365,8 +2492,16 @@
DisableItem(enrollbtn);
- EnableItem(resetpinbtn);
- EnableItem(formatbtn);
+ if(isCool)
+ {
+ EnableItem(resetpinbtn);
+ EnableItem(formatbtn);
+ }
+ else
+ {
+ DisableItem(resetpinbtn);
+ DisableItem(formatbtn);
+ }
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("enrolledKey"));
@@ -2377,12 +2512,24 @@
if(keyStatus == "UNINITIALIZED")
{
DisableItem(viewcertsbtn);
- EnableItem(enrollbtn);
+
+ if(isCool)
+ {
+ EnableItem(enrollbtn);
+ }
+ else
+ {
+ DisableItem(enrollbtn);
+ }
+
DisableItem(resetpinbtn);
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("uninitializedKey"));
- EnableItem(formatbtn);
+ if(isCool)
+ EnableItem(formatbtn);
+ else
+ DisableItem(formatbtn);
return;
}
@@ -2396,7 +2543,11 @@
if(!isBusy)
detailsKeyLabel.setAttribute("value",getBundleString("blankKey"));
- EnableItem(formatbtn);
+ if(isCool)
+ EnableItem(formatbtn);
+ else
+ DisableItem(formatbtn);
+
return;
}
@@ -2940,7 +3091,7 @@
var keyID = keyInfo[1];
var screenname = null;
- var pin = null;
+ var pin = GetPINValue();
var screennamepwd = null;
if (GetCoolKeyIsEnrolled(keyType, keyID))
@@ -3053,7 +3204,6 @@
function OnCoolKeyInserted(keyType, keyID)
{
-
var row = null;
var uninitialized = 0;
@@ -3088,20 +3238,27 @@
SelectRowByKeyID(keyType, keyID);
}
- DoPhoneHome(keyType,keyID);
+ var phoneHomeSuccess = 1;
+
+ if(DoGetCoolKeyIsReallyCoolKey(keyType, keyID))
+ phoneHomeSuccess = DoPhoneHome(keyType,keyID);
ShowAllWindows();
- SelectESCPage(uninitialized);
+ SelectESCPage(keyType,keyID,1 - phoneHomeSuccess);
UpdateESCSize();
if(gHiddenPage)
{
var issuer = GetCachedIssuer(keyID);
- if(!issuer)
- issuer = getBundleString("unknownIssuer");
- TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+ if(!issuer )
+ {
+
+ issuer = getBundleString("unknownIssuer");
+
+ }
+ //TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
}
}
@@ -3195,6 +3352,9 @@
function OnCoolKeyPINResetComplete(keyType, keyID)
{
+ if(gHiddenPage)
+ return;
+
var keyStatus = PolicyToKeyType(GetCoolKeyPolicy(keyType, keyID));
var keyReqAuth = BoolToYesNoStr(GetCoolKeyRequiresAuth(keyType, keyID));
var keyIsAuthed = BoolToYesNoStr(GetCoolKeyIsAuthed(keyType, keyID));
@@ -3724,6 +3884,23 @@
return result;
}
+function DoGetCoolKeyIsReallyCoolKey(keyType,keyID)
+{
+
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ isCool = netkey.GetCoolKeyIsReallyCoolKey(keyType, keyID);
+
+ //alert("isCool " + isCool);
+
+ return isCool;
+ } catch (e) {
+
+ return 0;
+ }
+
+}
+
function DoCoolKeyGetIssuerUrl(keyType,keyID)
{
var url = null;
@@ -3749,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()
{
@@ -3769,7 +3959,8 @@
function launchCertViewer()
{
- var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+ var wind = window.openDialog("chrome://esc/content/certManager.xul", "","chrome,centerscreen,modal=yes");
+// var wind = window.openDialog("chrome://pippki/content/certManager.xul", "","chrome,centerscreen,modal=yes");
}
function launchSETTINGS()
@@ -3850,6 +4041,24 @@
//Utility DOM functions
+function ChangeDescription(theDesc,theNewText)
+{
+
+ if(!theDesc || !theNewText)
+ return;
+
+ RemoveAllChildNodes(theDesc);
+
+ var theLabel = document.createTextNode(theNewText);
+
+
+ theDesc.appendChild(theLabel);
+
+ UpdateESCSize();
+
+
+}
+
function HideItem(theItem)
{
if(theItem)
@@ -4223,3 +4432,54 @@
}
}
+
+
+//Utility function to sleep for a short time
+
+function Sleep(milliSeconds)
+{
+ var then = new Date(new Date().getTime() + milliSeconds ); while (new Date() < then) {}
+}
+
+
+function DoCopyAdvancedInfoToClipBoard()
+{
+ var textinfo = window.document.getElementById("advanced-info");
+
+
+ CopyDataToClipboard(gDiagnosticsDataText);
+}
+
+
+function CopyDataToClipboard(aDataText)
+{
+
+ if(!aDataText)
+ return;
+
+
+ var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
+
+
+ if (!str)
+ return false;
+
+ str.data = aDataText;
+
+ var trans = Components.classes["@mozilla.org/widget/transferable;1"]. createInstance(Components.interfaces.nsITransferable);
+
+ if (!trans)
+ return false;
+
+ trans.setTransferData("text/unicode",str,str.data.length *2);
+ var clipid = Components.interfaces.nsIClipboard;
+
+ var clip = Components.classes["@mozilla.org/widget/clipboard;1"].getService(clipid);
+
+ if (!clip)
+ return false;
+
+ clip.setData(trans,null,clipid.kGlobalClipboard);
+ MyAlert(getBundleString("dataCopiedToClipboard") );
+
+}
Index: GenericAuth.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- GenericAuth.js 13 Sep 2006 17:56:49 -0000 1.2
+++ GenericAuth.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -25,6 +25,9 @@
var gDescription = null;
var gStringBundle = null;
+var gFormSubmitted = 0;
+
+
loadStringBundle();
function ConfirmPassword(password_element)
@@ -122,9 +125,13 @@
return 1;
}
-function FormSubmit()
+function FormSubmit(noValidate)
{
- var result = Validate();
+ var result = true;
+
+ if(!noValidate)
+ Validate();
+
var thisParent = window.opener;
if(!thisParent)
@@ -185,6 +192,7 @@
}
}
+ gFormSubmitted = 1;
window.close();
}
@@ -630,6 +638,18 @@
}
}
+function UiUnload()
+{
+ if(gFormSubmitted)
+ {
+ return;
+ }
+
+ var noValidate = 1;
+
+ FormSubmit(noValidate);
+}
+
function GetRowsNodeFromGrid(theGrid)
{
if(!theGrid)
Index: GenericAuth.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- GenericAuth.xul 12 Jun 2006 23:39:51 -0000 1.1.1.1
+++ GenericAuth.xul 27 Sep 2006 17:31:51 -0000 1.2
@@ -23,6 +23,7 @@
id="esc-auth-window"
title="&genericAuthTitle;"
onload="UiLoad();"
+ onunload="UiUnload();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
Index: TRAY.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/TRAY.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TRAY.js 13 Sep 2006 17:56:49 -0000 1.2
+++ TRAY.js 27 Sep 2006 17:31:51 -0000 1.3
@@ -26,6 +26,7 @@
var gWindNotify = null;
+
loadStringBundle();
//
@@ -368,6 +369,33 @@
}
+function SetMenuItemsText()
+{
+
+ var manageKeys=getBundleString("menuManageKeys");
+
+ var exit= getBundleString("menuExit");
+
+ TrayChangeMenuItemText(0,manageKeys);
+ TrayChangeMenuItemText(1,exit);
+
+}
+
+function TrayChangeMenuItemText(aIndex, aText)
+{
+ if(gTray && gBaseWindow)
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")
+ gTray.setmenuitemtext(aIndex,aText);
+ gTray.showicon();
+ } catch(e) {
+alert("exception " + e);
+ return;
+ }
+
+ }
+}
//String bundling related functions
@@ -388,3 +416,4 @@
return str;
}
+
Index: config.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/config.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- config.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ config.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -23,8 +23,8 @@
id="esc-window"
title="&escTitle;"
onload="InitializePhoneHomeConfigUI();"
- width ="600"
- height= "350"
+ width ="650"
+ height= "400"
onunload="cleanup();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
@@ -40,6 +40,19 @@
<description class="messageText">
&tpsConfigDesc;
</description>
+
+ <spacer class="verticalSpacerShort"/>
+ <description class="messageText">
+ &tpsConfigDesc1;
+ </description>
+ <spacer class="verticalSpacerShort"/>
+ <description class="messageText">
+ &tpsConfigDesc2;
+ </description>
+ <spacer class="verticalSpacerShort"/>
+ <description class="messageText">
+ &tpsConfigDesc3;
+ </description>
<groupbox class="outerGroupBox" >
<caption label="&editConfigValues;"/>
<spacer flex="1" style="min-height: 10px" />
@@ -58,7 +71,7 @@
</rows>
</grid>
- <hbox>
+ <hbox flex="1">
<spacer flex ="1"/>
<button label="&escOK;" oncommand="DoPhoneHomeConfigClose();" />
</hbox>
Index: esc.css
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.css,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.css 13 Sep 2006 17:56:49 -0000 1.2
+++ esc.css 27 Sep 2006 17:31:51 -0000 1.3
@@ -87,7 +87,7 @@
}
.messageText {
- font-size: 9pt;
+ font-size: 10pt;
text-align: justify;
}
@@ -313,6 +313,13 @@
background-color: #ffffff;
}
+.DiagnosicsTextBox {
+
+ width: 600px;
+ height: 725px;
+ border: black solid 4px;
+
+}
.BorderedIFrame {
@@ -339,8 +346,14 @@
width: 100px;
}
+.largeWideBox {
+
+ min-width: 42em;
+
+}
+
.mediumWideBox {
- min-width: 20em;
+ min-width: 18em;
}
Index: esc.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/esc.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- esc.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ esc.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -71,7 +71,7 @@
</vbox>
<vbox id="yes_key_box">
<spacer flex="1" class="verticalSpacer"/>
- <description class="messageText">
+ <description class="messageText" id="enroll-proceed-message">
&readyToProceed;
</description>
Index: settings.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/settings.xul,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- settings.xul 13 Sep 2006 17:56:49 -0000 1.2
+++ settings.xul 27 Sep 2006 17:31:51 -0000 1.3
@@ -24,7 +24,7 @@
title="&escTitle;"
onload="InitializeAdminBindingList()"
onunload="cleanup()"
- width ="720"
+ width ="730"
height= "460"
name="admin"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
@@ -47,7 +47,7 @@
<spacer flex="1"/>
</vbox>
</hbox>
- <groupbox flex ="1" orient="vertical" class="outerGroupBox">
+ <!-- <groupbox flex ="1" orient="vertical" class="outerGroupBox"> -->
<vbox id="administer-message-id">
<spacer flex="1"/>
<description class="messageText">
@@ -55,14 +55,15 @@
</description>
</vbox>
<hbox flex="1">
- <groupbox flex="1" >
+ <groupbox flex="6" class="largeWideBox" >
<caption label="&pluggedInCards;" class="captionText"/>
<vbox id="admin-no-keys-area">
- <spacer flex ="1"/>
+ <!-- <spacer flex ="1"/>
<description class="messageText">
&adminNoKeysMessage;
- </description>
+ </description>
<spacer flex = "1"/>
+ -->
</vbox>
<listbox id="AdminBindingList" flex="2" >
<listcols>
@@ -74,9 +75,9 @@
</listcols>
<listhead>
<listheader />
- <listheader flex="1" class="headerText" label="&keyIssuer;"/>
- <listheader flex="1" class="headerText" label="&keyIssuedTo;"/>
- <listheader flex="1" class="headerText" label="&keyStatus;"/>
+ <listheader flex="3" class="headerText" label="&keyIssuer;"/>
+ <listheader flex="4" class="headerText" label="&keyIssuedTo;"/>
+ <listheader flex="3" class="headerText" label="&keyStatus;"/>
<listheader flex="1" class="headerText" label="&keyProgress;"/>
</listhead>
</listbox>
@@ -132,21 +133,25 @@
<button class="buttonText" id="formatbtn" label="&doFormat;" oncommand="DoFormatCoolKey()" disabled="true" hidden = "false"/>
+ <button class="buttonText" id="enrollbtn" label="&doEnroll;" oncommand="DoCollectPassword('enroll');" disabled="true" hidden="false"/>
+
<button class="buttonText" id="resetpinbtn" label="&doResetPin;" oncommand="DoCollectPassword('resetpin');" disabled="true" hidden="false"/>
- <button class="buttonText" id="enrollbtn" label="&doEnroll;" oncommand="DoCollectPassword('enroll');" disabled="true" hidden="false"/>
- <button class="buttonText" id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
+<!-- <button class="buttonText" id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
<button class="buttonText" id="advancedbtn" label="&advancedInfo;" disabled="true" hidden="false" oncommand="DoShowAdvancedInfo();"/>
-
+-->
</vbox>
</groupbox>
</hbox>
<hbox id = "enrollment_button_box" >
+ <button class="buttonText" id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false"/>
+ <button class="buttonText" id="advancedbtn" label="&advancedInfo;" disabled="true" hidden="false" oncommand="DoShowAdvancedInfo();"/>
+
<spacer flex = "1"/>
<button class="buttonText" id="closebtn" label ="&closeAdminLater;" oncommand="HideAdminPage();"/>
<spacer class="horSpacerShort"/>
</hbox>
- </groupbox>
+ <!-- </groupbox> -->
</window>
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc password.xul, NONE, 1.1
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27109
Added Files:
password.xul
Log Message:
License.
--- NEW FILE password.xul ---
<?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"
id="esc-window"
title="&getESCPassword;"
onload="PasswordLoad();"
onunload="cleanup();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script src="password.js"/>
<script src="ESC.js"/>
<script src="TRAY.js"/>
<spacer class = "horSpacerVeryShort"/>
<grid>
<rows>
<row>
<image id="logoImage"/>
<spacer class="horSpacerShort"/>
<vbox>
<spacer flex="1"/>
<label value="&keyPassword;" class = "boldMessageText"/>
<spacer flex="1"/>
</vbox>
</row>
</rows>
</grid>
<spacer class = "verticalSpacerShort"/>
<groupbox flex = "1">
<vbox id="standalone-password-area-id">
<grid>
<columns>
<column flex="0"/>
</columns>
<rows>
<row>
<label control="pintf" value="&pleaseEnterPassword;" maxlength="10"/>
</row>
<row>
<textbox id="pintf" type = "password" onkeypress="EvaluatePasswordQuality();"/>
</row>
<row>
<label control="reenterpintf" value="&pleaseReEnterPassword;" maxlength="10"/>
</row>
<row>
<textbox id="reenterpintf" type="password" />
</row>
<spacer class="verticalSpacer"/>
<row>
<label value="&passwordQuality;"/>
</row>
<row>
<image id="password-image" src="1-none.png"/>
<spacer flex = "1"/>
</row>
<row>
<spacer class="verticalSpacerShort"/>
</row>
</rows>
</grid>
</vbox>
<hbox>
<spacer flex="1"/>
<button id="okbtn" label ="&escOK;" oncommand="doOperation();"/>
<button id="cancel" label ="&escCancel;" oncommand ="window.close();"/>
<spacer flex = "1"/>
</hbox>
</groupbox>
</window>
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc password.js, 1.1, 1.2
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27057
Modified Files:
password.js
Log Message:
License.
Index: password.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/password.js,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- password.js 27 Sep 2006 17:25:23 -0000 1.1
+++ password.js 27 Sep 2006 17:30:36 -0000 1.2
@@ -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;
17 years, 6 months
[Fedora-directory-commits] esc/src/app/xul/esc/chrome/content/esc password.js, NONE, 1.1
by Doctor Conrad
Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26773
Added Files:
password.js
Log Message:
Latest updates.
--- NEW FILE password.js ---
var parentWindow = window.opener;
function doOperation()
{
//alert("doOperation opener " + parentWindow + " nam " + window.name);
var pin = GetLocalPINValue();
if(!pin)
return;
parentWindow.SetPINValue(pin);
var theOperation = window.name;
if(theOperation == "resetpin")
parentWindow.DoResetSelectedCoolKeyPIN();
if(theOperation == "enroll")
parentWindow.DoEnrollCoolKey();
window.close();
}
function GetLocalPINValue()
{
var pintf_obj = document.getElementById("pintf");
var reenterpintf_obj = document.getElementById("reenterpintf");
var pinVal = null;
var rpinVal = null;
if(pintf_obj)
pinVal = pintf_obj.value;
if(reenterpintf_obj)
rpinVal = reenterpintf_obj.value;
if (! pinVal && pintf_obj)
{
MyAlert("You must provide a valid Token PIN!");
return null;
}
if ( pinVal != rpinVal && reenterpintf_obj)
{
MyAlert("The PIN values you entered don't match!");
return null;
}
return pinVal;
}
function PasswordLoad()
{
window.sizeToContent();
}
17 years, 6 months