esc/esc-1.0.1-ui-fixes-1.patch

1907 lines
56 KiB
Diff
Raw Normal View History

2007-04-26 16:58:57 +00:00
--- ./esc/src/lib/coolkey/NSSManager.cpp.fix4 2007-04-25 10:52:35.000000000 -0700
+++ ./esc/src/lib/coolkey/NSSManager.cpp 2007-04-25 10:52:47.000000000 -0700
@@ -51,6 +51,9 @@
char tBuff[56];
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::NSSManager:\n",GetTStamp(tBuff,56)));
mpSCMonitoringThread = NULL;
+#ifdef LINUX
+ systemCertDB = NULL;
+#endif
}
NSSManager::~NSSManager()
@@ -61,6 +64,7 @@
delete mpSCMonitoringThread;
mpSCMonitoringThread = NULL;
}
+
}
HRESULT NSSManager::InitNSS(const char *aAppDir)
@@ -110,6 +114,21 @@
return E_FAIL;
}
+#ifdef LINUX
+
+ // Load our Linux only database
+
+
+ const char *modspec = "configdir='/etc/pki/nssdb' tokenDescripton='SystemDB' flags='readOnly'";
+ PK11SlotInfo *systemCertDB = SECMOD_OpenUserDB(modspec);
+
+ if(!systemCertDB)
+ {
+ PR_LOG( coolKeyLogNSS, PR_LOG_ALWAYS, ("%s NSSManager::InitNSS problem loading Linux System Cert Database!\n",GetTStamp(tBuff,56)));
+ }
+
+#endif
+
mpSCMonitoringThread = new SmartCardMonitoringThread(userModule);
if (!mpSCMonitoringThread) {
SECMOD_UnloadUserModule(userModule);
@@ -132,6 +151,17 @@
// Logout all tokens.
PK11_LogoutAll();
+
+#ifdef LINUX
+ if(systemCertDB)
+ {
+ SECMOD_CloseUserDB(systemCertDB);
+
+ PK11_FreeSlot(systemCertDB);
+ systemCertDB = NULL;
+ }
+
+#endif
}
bool
@@ -326,7 +356,7 @@
return S_OK;
}
-HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+HRESULT NSSManager::GetKeyIssuer(const CoolKey *aKey, char *aBuf, int aBufLength)
{
char tBuff[56];
if(!aBuf)
@@ -337,17 +367,89 @@
PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo \n",GetTStamp(tBuff,56)));
if(!aKey )
- {
return E_FAIL;
- }
PK11SlotInfo *slot = GetSlotForKeyID(aKey);
if (!slot)
+ return E_FAIL;
+
+ CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
+
+ if (!certs)
{
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuer no certs found! \n",GetTStamp(tBuff,56)));
+ PK11_FreeSlot(slot);
return E_FAIL;
}
+ CERTCertListNode *node= NULL;
+
+ char *orgID = NULL;
+
+ for( node = CERT_LIST_HEAD(certs);
+ ! CERT_LIST_END(node, certs);
+ node = CERT_LIST_NEXT(node))
+ {
+ if(node->cert)
+ {
+ CERTCertificate *cert = node->cert;
+
+ if(cert)
+ {
+ if(cert->slot == slot)
+ {
+ if(IsCACert(cert))
+ {
+ continue;
+ }
+ orgID = CERT_GetOrgName(&cert->subject);
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p org %s \n",GetTStamp(tBuff,56),slot,cert->slot,orgID));
+
+ }
+
+ if(orgID)
+ break;
+ }
+ }
+
+ }
+
+ if(orgID && ((int)strlen(orgID) < aBufLength))
+ {
+ strcpy(aBuf,orgID);
+ }
+
+ if(certs)
+ CERT_DestroyCertList(certs);
+
+ if(slot)
+ PK11_FreeSlot(slot);
+
+ if(orgID)
+ PORT_Free(orgID);
+
+ return S_OK;
+}
+
+HRESULT NSSManager::GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+ char tBuff[56];
+ if(!aBuf)
+ return E_FAIL;
+
+ aBuf[0]=0;
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo \n",GetTStamp(tBuff,56)));
+
+ if(!aKey )
+ return E_FAIL;
+
+ PK11SlotInfo *slot = GetSlotForKeyID(aKey);
+
+ if (!slot)
+ return E_FAIL;
+
CERTCertList *certs = PK11_ListCerts(PK11CertListAll,NULL);
if (!certs)
@@ -373,8 +475,14 @@
{
if(cert->slot == slot)
{
+ if(IsCACert(cert))
+ {
+ continue;
+ }
+
certID = CERT_GetCommonName(&cert->subject);
- PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",GetTStamp(tBuff,56),slot,cert->slot,certID));
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%s NSSManager::GetKeyIssuedTo ourSlot %p curSlot %p certID %s \n",GetTStamp(tBuff,56),slot,cert->slot,certID));
}
@@ -627,3 +735,41 @@
return isAuthenticated;
}
+
+bool
+NSSManager::IsCACert(CERTCertificate *cert)
+{
+ char tBuff[56];
+ bool isCA = false;
+
+ if(!cert)
+ return isCA;
+
+ SECItem basicItem;
+ basicItem.data = 0;
+
+ SECStatus s = CERT_FindCertExtension(cert, SEC_OID_X509_BASIC_CONSTRAINTS, &basicItem);
+
+ if(s != SECSuccess || !basicItem.data)
+ return isCA;
+
+ CERTBasicConstraints basic_value;
+
+ s = CERT_DecodeBasicConstraintValue(&basic_value,&basicItem);
+
+ if(s != SECSuccess)
+ return isCA;
+
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuedTo isCA %d \n",GetTStamp(tBuff,56),basic_value.isCA));
+
+ if(basic_value.isCA)
+ {
+ PR_LOG( coolKeyLogNSS, PR_LOG_DEBUG, ("%sNSSManager::GetKeyIssuedTo found a CA cert , skipping! \n",GetTStamp(tBuff,56)));
+ isCA = true;
+ }
+
+ PORT_Free(basicItem.data);
+ basicItem.data = NULL;
+
+ return isCA;
+}
--- ./esc/src/lib/coolkey/CoolKey.h.fix4 2007-04-25 10:52:20.000000000 -0700
+++ ./esc/src/lib/coolkey/CoolKey.h 2007-04-25 11:02:56.000000000 -0700
@@ -134,6 +134,7 @@
COOLKEY_API HRESULT CoolKeyGetCertInfo(const CoolKey *aKey, char *aCertNickname, std::string & aCertInfo);
COOLKEY_API HRESULT CoolKeyGetIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength);
+COOLKEY_API HRESULT CoolKeyGetIssuer(const CoolKey *aKey, char *aBuf, int aBufLength);
COOLKEY_API bool CoolKeyRequiresAuthentication(const CoolKey *aKey);
COOLKEY_API bool CoolKeyIsAuthenticated(const CoolKey *aKey);
--- ./esc/src/lib/coolkey/CoolKey.cpp.fix4 2007-04-25 10:51:58.000000000 -0700
+++ ./esc/src/lib/coolkey/CoolKey.cpp 2007-04-25 10:52:06.000000000 -0700
@@ -844,6 +844,16 @@
return NSSManager::GetKeyIssuedTo(aKey,aBuf,aBufLength);
}
+HRESULT
+CoolKeyGetIssuer(const CoolKey *aKey, char *aBuf, int aBufLength)
+{
+ if (!aKey || !aKey->mKeyID || !aBuf || aBufLength < 1)
+ return E_FAIL;
+
+ return NSSManager::GetKeyIssuer(aKey,aBuf,aBufLength);
+}
+
+
HRESULT CoolKeyGetATR(const CoolKey *aKey, char *aBuf, int aBufLen)
{
char tBuff[56];
--- ./esc/src/lib/coolkey/NSSManager.h.fix4 2007-04-25 11:08:44.000000000 -0700
+++ ./esc/src/lib/coolkey/NSSManager.h 2007-04-25 10:53:08.000000000 -0700
@@ -68,11 +68,16 @@
static HRESULT GetKeyIssuedTo(const CoolKey *aKey, char *aBuf, int aBufLength);
-
+ static HRESULT GetKeyIssuer(const CoolKey *aKey, char *aBuf, int aBufLength);
private:
+ static bool IsCACert(CERTCertificate *cert);
+
+#ifdef LINUX
+ PK11SlotInfo *systemCertDB;
+#endif
SmartCardMonitoringThread *mpSCMonitoringThread;
};
--- ./esc/src/app/xpcom/rhICoolKey.idl.fix4 2007-04-25 10:41:08.000000000 -0700
+++ ./esc/src/app/xpcom/rhICoolKey.idl 2007-04-25 10:41:36.000000000 -0700
@@ -66,9 +66,13 @@
string GetCoolKeyCertInfo(in unsigned long aKeyType, in string aKeyID, in string aCertNickname);
string GetCoolKeyIssuedTo(in unsigned long aKeyType, in string aKeyID);
+
+ string GetCoolKeyIssuer(in unsigned long aKeyType, in string aKeyID);
string GetCoolKeyATR(in unsigned long aKeyType, in string aKeyID);
+ string GetCoolKeyTokenName(in unsigned long aKeyType, in string aKeyID);
+
boolean GetCoolKeyRequiresAuthentication(in unsigned long aKeyType,in string aKeyID);
boolean GetCoolKeyIsAuthenticated(in unsigned long aKeyType,in string aKeyID);
--- ./esc/src/app/xpcom/rhCoolKey.cpp.fix4 2007-04-25 10:40:43.000000000 -0700
+++ ./esc/src/app/xpcom/rhCoolKey.cpp 2007-04-25 10:40:53.000000000 -0700
@@ -1074,7 +1074,7 @@
char tBuff[56];
PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyIsReallyCoolKey thread: %p \n",GetTStamp(tBuff,56),PR_GetCurrentThread()));
- if (ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) {
+ if (aKeyType && aKeyID && ASCCoolKeyIsAvailable(aKeyType, (char *) aKeyID)) {
if (aKeyID) {
AutoCoolKey key(aKeyType, aKeyID);
PRBool isCool = CoolKeyIsReallyCoolKey(&key);
@@ -1164,6 +1164,34 @@
return NS_OK;
}
+/* string GetCoolKeyTokenName (in unsigned long aKeyType, in string aKeyID); */
+ NS_IMETHODIMP rhCoolKey::GetCoolKeyTokenName(PRUint32 aKeyType, const char *aKeyID, char **_retval)
+{
+ char tBuff[56];
+
+ *_retval = NULL;
+
+ if(!aKeyType && !aKeyID)
+ return NS_OK;
+
+ AutoCoolKey key(aKeyType,aKeyID);
+
+ char *tokenName = NULL;
+
+ tokenName = (char *) CoolKeyGetTokenName(&key);
+
+ PR_LOG( coolKeyLog, PR_LOG_DEBUG, ("%s rhCoolKey::GetCoolKeyTokenName %s \n",GetTStamp(tBuff,56),tokenName));
+ if(tokenName)
+ {
+ char *temp = (char *) nsMemory::Clone(tokenName,sizeof(char) * strlen((char *)tokenName) + 1);
+ *_retval = temp;
+
+ }
+
+ return NS_OK;
+
+}
+
/* string GetCoolKeyIssuerInfo (in unsigned long aKeyType, in string aKeyID); */ NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuerInfo(PRUint32 aKeyType, const char *aKeyID, char **_retval)
{
char tBuff[56];
@@ -1251,6 +1279,40 @@
return NS_OK;
}
+
+/* string GetCoolKeyIssuer (in unsigned long aKeyType, in string aKeyID); */
+NS_IMETHODIMP rhCoolKey::GetCoolKeyIssuer(PRUint32 aKeyType, const char *aKeyID, char **issuer)
+{
+ char tBuff[56];
+ if (!aKeyID) {
+ return NS_ERROR_FAILURE;
+ }
+
+ AutoCoolKey key(aKeyType, ( char *)aKeyID);
+
+ // const char *keyName = CoolKeyGetTokenName(&key);
+
+ char buff[512];
+ int bufLength = 512;
+ buff[0] = 0;
+
+ CoolKeyGetIssuer(&key, (char *) buff, bufLength);
+
+ if(!buff[0])
+ {
+ return NS_OK;
+ }
+
+ PR_LOG(coolKeyLog,PR_LOG_DEBUG,("%s rhCoolKey::RhGetCoolKeyGetIssuer %s \n",GetTStamp(tBuff,56),(char *) buff));
+
+ char *temp = (char *) nsMemory::Clone(buff,sizeof(char) * strlen(buff) + 1);
+
+ *issuer = temp;
+
+ return NS_OK;
+
+}
+
/* boolean SetCoolKeyConfigValue (in string aName, in string aValue); */
NS_IMETHODIMP rhCoolKey::SetCoolKeyConfigValue(const char *aName, const char *aValue, PRBool *_retval)
{
--- ./esc/src/app/xpcom/tray/rhTray.h.fix4 2007-04-25 10:55:28.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhTray.h 2007-04-25 10:55:35.000000000 -0700
@@ -263,6 +263,7 @@
// Icon menu related
static GtkWidget *mIconMenu;
+ static GtkWidget *mIconBoxWidget;
static void IconMenuCBProc(GtkWidget *widget, gpointer data);
HRESULT CreateIconMenu();
--- ./esc/src/app/xpcom/tray/rhLinuxTray.cpp.fix4 2007-04-25 10:42:40.000000000 -0700
+++ ./esc/src/app/xpcom/tray/rhLinuxTray.cpp 2007-04-25 10:42:51.000000000 -0700
@@ -22,11 +22,13 @@
#include <prlog.h>
#include "notifytray.h"
#include "intl/nsIStringBundle.h"
+#include <gdk/gdkx.h>
NS_IMPL_ISUPPORTS1(rhTray, rhITray)
GtkWidget* rhTray::mWnd = NULL;
GtkWidget* rhTray::mIconMenu = NULL;
+GtkWidget* rhTray::mIconBoxWidget = NULL;
int rhTray::mInitialized = 0;
@@ -37,6 +39,44 @@
static PRLogModuleInfo *trayLog = PR_NewLogModule("tray");
+static void popup_position(GtkMenu *menu,
+ gint *x,
+ gint *y,
+ gboolean *push_in,
+ gpointer user_data)
+{
+
+ char tBuff[56];
+ GtkWidget *icon_box_widget = GTK_WIDGET(user_data);
+
+ if(icon_box_widget)
+ {
+ GdkWindow* window = icon_box_widget->window;
+
+ gint width;
+ gint height;
+
+ gint px;
+ gint py;
+
+ gdk_drawable_get_size(window,&width,&height);
+
+ gdk_window_get_position(window,
+ &px,
+ &py);
+
+ PR_LOG( trayLog, PR_LOG_DEBUG, ("%s popup_position width %d height %d px %d py %d \n",GetTStamp(tBuff,56),width,height,px,py));
+
+
+ gint x_coord = px;
+ gint y_coord = (py + height);
+
+ *x = x_coord;
+ *y = y_coord;
+
+ }
+
+}
rhTray::rhTray()
{
@@ -232,11 +272,12 @@
return E_FAIL;
}
- GtkWidget *icon_widget = notify_icon_get_box_widget();
+ mIconBoxWidget = notify_icon_get_box_widget();
- if(icon_widget)
+ if(mIconBoxWidget)
{
- g_signal_connect(G_OBJECT(icon_widget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL);
+ g_signal_connect(G_OBJECT(mIconBoxWidget), "button-press-event", G_CALLBACK(rhTray::IconCBProc), NULL);
+
}
res = CreateEventWindow();
@@ -352,11 +393,23 @@
GtkWidget *min_item = gtk_menu_item_new_with_label ("Hide");
GtkWidget *max_item = gtk_menu_item_new_with_label ("Manage Keys");
- GtkWidget *exit_item = gtk_menu_item_new_with_label ("Exit");
+ GtkWidget *exit_item = gtk_image_menu_item_new_with_label ("Exit");
- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item);
+ GtkWidget* quit_icon = gtk_image_new_from_stock(GTK_STOCK_QUIT,GTK_ICON_SIZE_SMALL_TOOLBAR);
+
+ if(max_item)
+ gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), max_item);
//gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), min_item);
- gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item);
+ if(exit_item)
+ {
+ gtk_menu_shell_append (GTK_MENU_SHELL (mIconMenu), exit_item);
+
+ if(quit_icon)
+ {
+ gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(exit_item), quit_icon);
+
+ }
+ }
g_signal_connect(G_OBJECT (min_item), "activate",
G_CALLBACK (rhTray::IconMenuCBProc),
@@ -404,8 +457,8 @@
gtk_menu_popup(GTK_MENU(mIconMenu),
NULL,
NULL,
- NULL,
- NULL,
+ (GtkMenuPositionFunc) popup_position,
+ mIconBoxWidget,
event->button,
event->time);
@@ -725,6 +778,7 @@
if(widget->window)
{
+ gdk_x11_window_set_user_time (widget->window, gdk_x11_get_server_time (widget->window));
if(GTK_WIDGET_VISIBLE(mWnd))
{
gdk_window_show(widget->window);
--- ./esc/src/app/xul/esc/application.ini.fix4 2007-04-25 10:43:17.000000000 -0700
+++ ./esc/src/app/xul/esc/application.ini 2007-04-25 10:44:00.000000000 -0700
@@ -19,13 +19,13 @@
;
; This field specifies your organization's name. This field is recommended,
; but optional.
-Vendor=RedHat
+Vendor=RedHat
;
; This field specifies your application's name. This field is required.
Name=ESC
;
; This field specifies your application's version. This field is optional.
-Version=1.0.0
+Version=1.0.1-3
;
; This field specifies your application's build ID (timestamp). This field is
; required.
--- ./esc/src/app/xul/esc/chrome/content/esc/security.xul.fix4 2007-04-25 10:48:49.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/security.xul 2007-04-25 10:48:59.000000000 -0700
@@ -38,6 +38,6 @@
</groupbox>
<hbox >
<spacer flex="3"/>
- <button id="closebtn" label ="&closeNow;" oncommand="window.close();"/>
+ <button id="closebtn" label ="&closeNow;" oncommand="window.close();" accesskey="&Close.accesskey;"/>
</hbox>
</window>
--- ./esc/src/app/xul/esc/chrome/content/esc/password.xul.fix4 2007-04-25 10:48:31.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/password.xul 2007-04-25 10:48:40.000000000 -0700
@@ -26,6 +26,7 @@
onunload="cleanup();"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<stringbundle id="esc_strings" src="chrome://esc/locale/esc.properties"/>
<script src="password.js"/>
<script src="ESC.js"/>
<script src="TRAY.js"/>
@@ -50,7 +51,7 @@
<vbox id="standalone-password-area-id">
<grid>
<columns>
- <column flex="0"/>
+ <column flex="1"/>
</columns>
<rows>
<row>
@@ -70,7 +71,7 @@
<label value="&passwordQuality;"/>
</row>
<row>
- <image id="password-image" src="1-none.png"/>
+ <progressmeter id="pass-progress-id" value="0"/>
<spacer flex = "1"/>
</row>
<row>
@@ -82,8 +83,8 @@
<hbox>
<spacer flex="1"/>
- <button id="okbtn" label ="&escOK;" oncommand="doOperation();"/>
- <button id="cancel" label ="&escCancel;" oncommand ="window.close();"/>
+ <button id="okbtn" label ="&escOK;" oncommand="doOperation();" accesskey="&OK.accesskey;" />
+ <button id="cancel" label ="&escCancel;" oncommand ="window.close();" accesskey="&Cancel.accesskey;"/>
<spacer flex = "1"/>
</hbox>
</groupbox>
--- ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul.fix4 2007-04-25 10:46:22.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.xul 2007-04-25 10:46:36.000000000 -0700
@@ -1,5 +1,4 @@
<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?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
--- ./esc/src/app/xul/esc/chrome/content/esc/password.js.fix4 2007-04-25 10:48:11.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/password.js 2007-04-25 10:48:20.000000000 -0700
@@ -16,6 +16,9 @@
* END COPYRIGHT BLOCK **/
var parentWindow = window.opener;
+var gStringBundle=null;
+
+loadStringBundle();
function doOperation()
{
@@ -57,16 +60,16 @@
if(reenterpintf_obj)
rpinVal = reenterpintf_obj.value;
- if (! pinVal && pintf_obj)
+ if (!pinVal && pintf_obj)
{
- MyAlert("You must provide a valid Token PIN!");
- return null;
+ MyAlert(getBundleString("errorProvideTokenPIN"));
+ return null;
}
- if ( pinVal != rpinVal && reenterpintf_obj)
+ if ( pinVal != rpinVal )
{
- MyAlert("The PIN values you entered don't match!");
- return null;
+ MyAlert(getBundleString("errorMatchPinValues"));
+ return null;
}
return pinVal;
@@ -75,4 +78,27 @@
function PasswordLoad()
{
window.sizeToContent();
+ var pintf_obj = document.getElementById("pintf");
+ if(pintf_obj)
+ pintf_obj.focus();
+}
+
+//String bundling related functions
+
+function loadStringBundle()
+{
+ gStringBundle = document.getElementById("esc_strings");
+}
+
+function getBundleString(string_id)
+{
+ var str = null;
+
+ if(!string_id || !gStringBundle)
+ return null;
+
+ str = gStringBundle.getString(string_id);
+
+ return str;
}
+
--- ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js.fix4 2007-04-25 10:45:55.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/GenericAuth.js 2007-04-25 10:46:05.000000000 -0700
@@ -529,6 +529,7 @@
}
var i = 0;
+ var first_box = 1;
for(i = 0 ; i < len ; i ++)
{
@@ -594,6 +595,11 @@
if(field)
{
row.appendChild(field);
+ if(first_box)
+ {
+ field.focus();
+ first_box = 0;
+ }
}
}
@@ -602,19 +608,20 @@
}
- var last_row = AddRowToGrid(grid);
-
- if(last_row)
+ var ui_hbox = document.createElement("hbox");
+ if(ui_hbox)
{
- AddSpacerToNode(last_row,"1","min-height: 20px");
- AddSpacerToNode(last_row,"1","min-height: 20px");
- var button = AddButton("","Submit");
+ box.appendChild(ui_hbox);
+ AddSpacerToNode(ui_hbox,"1","");
+ var button = AddButton("",getBundleString("authSubmit"));
if(button)
+ {
button.setAttribute("oncommand" , "FormSubmit();");
-
+ button.setAttribute("accesskey", getBundleString("authSubmitAccessKey"));
+ }
if(button)
- last_row.appendChild(button);
+ ui_hbox.appendChild(button);
}
}
--- ./esc/src/app/xul/esc/chrome/content/esc/ESC.js.fix4 2007-04-25 10:44:57.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/ESC.js 2007-04-25 10:45:39.000000000 -0700
@@ -229,9 +229,10 @@
var issuer = "";
if(aResult == true)
{
- issuer = GetCachedIssuer(keyID);
+ issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
+ recordMessage("In DoPhoneHome callback success issuer " + issuer);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
UpdateRowWithPhoneHomeData(keyType,keyID);
@@ -248,7 +249,11 @@
}
else
{
- issuer = getBundleString("unknownIssuer");
+
+ issuer = GetCoolKeyIssuer(keyType,keyID);
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
+ recordMessage("Phone home callback failed , issuer " + issuer);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
}
@@ -265,7 +270,7 @@
var phoneHomeURI = GetCachedPhoneHomeURL(keyID);
recordMessage("Phone home info cached...");
- issuer = GetCachedIssuer(keyID);
+ issuer = GetCoolKeyIssuer(keyType,keyID);
TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
LogKeyInfo(keyType,keyID,"Key Inserted ...");
@@ -415,6 +420,11 @@
function InitializePhoneHomeConfigUI()
{
+ var uri_box = document.getElementById("phonehomeuri");
+
+ if(uri_box)
+ uri_box.focus();
+
window.sizeToContent();
}
@@ -666,8 +676,24 @@
issuer = GetCachedIssuer(keyID);
- if(!issuer)
- issuer = getBundleString("unknownIssuer");
+
+ // Now try to read off the certs if applicable
+
+ if(!issuer && (GetStatusForKeyID(keyType, keyID) == getBundleString("statusEnrolled")))
+ {
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ issuer = netkey.GetCoolKeyIssuer(keyType,keyID);
+
+ } catch (e)
+ {
+ issuer = null;
+ }
+ }
+
+
+ if(!issuer)
+ issuer = getBundleString("unknownIssuer");
return issuer;
}
@@ -719,11 +745,16 @@
var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
- var issuer = GetCachedIssuer(keyID);
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
- textDump += getBundleString("smartCardU") + " " + i + ":" + "\n\n";
+ var cardName = DoCoolKeyGetTokenName(keyType,keyID);
+
+ if(!cardName)
+ cardName = i;
+
+ textDump += getBundleString("smartCardU") + " " + cardName + ":" + "\n\n";
textDump += " " + getBundleString("appletVersion") + " " + appletVerMaj + "." + appletVerMin + "\n";
@@ -1008,24 +1039,24 @@
{
var image_src = "";
- if(observeBusy && (keyStatus == "BUSY" ))
+ if(observeBusy && (keyStatus == getBundleString("statusBusy")))
{
return "throbber-anim5.gif";
}
- if(keyStatus == "UNAVAILABLE")
+ if(keyStatus == getBundleString("statusUnavailable"))
{
return "";
}
- if(keyStatus == "ENROLLED")
+ if(keyStatus == getBundleString("statusEnrolled"))
{
image_src = "enrolled-key";
}
else
{
- if(keyStatus == "UNINITIALIZED")
+ if(keyStatus == getBundleString("statusUninitialized"))
image_src = "initializecard";
else
- if(keyStatus == "NO APPLET")
+ if(keyStatus == getBundleString("statusNoApplet"))
image_src = "blank-card";
}
@@ -1205,6 +1236,7 @@
function UpdateEnrollmentArea(keyType,keyID,inserted,showFullUI,showExternalUI)
{
+
if(!gEnrollmentPage)
return;
@@ -1215,12 +1247,11 @@
{
alreadyEnrolled = true;
}
- var arr = GetAvailableCoolKeys();
- var numKeys = arr.length;
- //alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled);
+ var numUnenrolledKeys = DoGetNumUnenrolledCoolKeys();
+
+ //alert("inserted " + inserted + " showFulUI " + showFullUI + " showExternalUI " + showExternalUI + " already enrolled " + alreadyEnrolled + " numUnenrolledKeys " + numUnenrolledKeys);
- //If we already have external UI and keys left, don't mess it up
var ui_id = document.getElementById("esc-ui");
@@ -1232,7 +1263,7 @@
if(!inserted)
{
- if(!numKeys)
+ if(!numUnenrolledKeys)
{
ui_id.setAttribute("src",null);
}
@@ -1389,6 +1420,9 @@
var pw = document.getElementById("pintf").value;
var pwlength = 0;
+ var qualityMeter = document.getElementById("pass-progress-id");
+
+
if(pw)
pwlength = pw.length;
@@ -1422,6 +1456,11 @@
if ( pwstrength > 100 ) {
pwstrength = 100;
}
+ if(qualityMeter)
+ {
+ qualityMeter.setAttribute("value", pwstrength);
+
+ }
if(qualityImage)
{
if(pwlength==0)
@@ -1522,13 +1561,14 @@
break;
case 4: // Available
case 6: // UnblockInProgress
- case 7: // PINResetInProgress
case 8: // RenewInProgress
keyStatus = PolicyToKeyType(GetCoolKeyPolicy(keyType, keyID));
break;
- case 5: // EnrollmentInProgress
+ case 7: // PINResetInProgress
keyStatus = getBundleString("statusBusy");
break;
+ case 5: // EnrollmentInProgress
+ keyStatus = getBundleString("statusBusy");
break;
case 9: // FormatInProgress
keyStatus = getBundleString("statusBusy");
@@ -1604,7 +1644,7 @@
function UpdateCoolKeyAvailabilityForEnrollment()
{
//Here we only allow ONE key
- //Take the first one that shows up.
+ //Take the first unenrolled one that shows up.
var arr = GetAvailableCoolKeys();
@@ -1616,17 +1656,24 @@
var i=0;
- for (i=0; i < 1; i++)
+ for (i=0; i < arr.length; i++)
{
- var row = InsertCoolKeyIntoEnrollmentPage(arr[i][0],arr[i][1]);
+ var status = GetStatusForKeyID(arr[i][0],arr[i][1]);
- if(row)
- gCurrentSelectedRow = row;
+ if(status != getBundleString("statusEnrolled"))
+ {
+ var row = InsertCoolKeyIntoEnrollmentPage(arr[i][0],arr[i][1]);
+
+ if(row)
+ gCurrentSelectedRow = row;
- var keyInserted = 1;
- var showFullUI = 0;
+ var keyInserted = 1;
+ var showFullUI = 0;
- UpdateEnrollmentArea(arr[i][0],arr[i][1],keyInserted,showFullUI);
+ UpdateEnrollmentArea(arr[i][0],arr[i][1],keyInserted,showFullUI);
+
+ break;
+ }
}
UpdateESCSize();
@@ -1660,6 +1707,8 @@
{
UpdateESCSize();
}
+
+ window.focus();
}
function SetCurrentSelectedRowForEnrollment()
@@ -1703,6 +1752,9 @@
DoSetEnrolledBrowserLaunchState();
DoHandleEnrolledBrowserLaunch();
+
+ window.setTimeout('ShowWindow()',250);
+
}
//Window related functions
@@ -2039,11 +2091,15 @@
if(!gAdminPage)
return;
- var isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
+ var isCool = null;
+
+ //alert("blub " + " keyType " + keyType + " keyID " + keyID);
+
+ isCool = DoGetCoolKeyIsReallyCoolKey(keyType, keyID);
var noKey = 0;
- if(!keyType || !keyID)
+ if(!keyType && !keyID)
{
noKey = 1;
}
@@ -2053,7 +2109,6 @@
if(!noKey)
keyStatus = GetStatusForKeyID(keyType, keyID);
-
recordMessage("No Key: " + noKey + " status " + keyStatus);
var passwordArea = document.getElementById("password-area-id");
@@ -2101,11 +2156,6 @@
if(!viewcertsbtn)
return;
- //hack for CAC cards that now have no CUID reported
-
- if(!isCool && !noKey)
- keyStatus = "ENROLLED";
-
var image_src = SelectImageForKeyStatus(keyStatus,1,1);
recordMessage("image_src " + image_src);
@@ -2116,13 +2166,38 @@
ShowItem(detailsImage);
detailsImage.setAttribute("src", image_src);
}
+
+ // Now take care of the right click context menu that is
+ // Invisible at this point
+
+ var adminkeymenu = document.getElementById("adminkeymenu");
+ var menu_format = null;
+ var menu_enroll = null;
+ var menu_resetpassword = null;
+
+ if(adminkeymenu)
+ {
+ menu_format = document.getElementById("menu-format");
+ menu_enroll = document.getElementById("menu-enroll");
+ menu_resetpassword = document.getElementById("menu-resetpassword");
+
+ if(!menu_format || !menu_enroll || !menu_resetpassword)
+ {
+ menu_format = null;
+ menu_enroll = null;
+ menu_resetpassword = null;
+ adminkeymenu = null;
+ }
+ }
+
+ recordMessage("Obtained admin popup menu object.");
ShowItem(advancedbtn);
EnableItem(advancedbtn);
var isBusy = 0;
var operationLabel = null;
- if(keyStatus == "BUSY" || keyStatus == "UNAVAILABLE")
+ if(keyStatus == getBundleString("statusBusy") || keyStatus == getBundleString("statusUnavailable"))
isBusy = 1;
if(isBusy)
@@ -2132,9 +2207,15 @@
if(!keyStatus)
{
-
DisableItem(viewcertsbtn);
DisableItem(enrollbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_resetpassword);
+ DisableItem(menu_format);
+ }
+
DisableItem(resetpinbtn);
DisableItem(formatbtn);
@@ -2144,21 +2225,44 @@
return;
}
- if(keyStatus == "ENROLLED")
+ if(keyStatus == getBundleString("statusEnrolled"))
{
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
EnableItem(viewcertsbtn);
DisableItem(enrollbtn);
+ if(adminkeymenu)
+ DisableItem(menu_enroll);
if(isCool)
{
+ if(adminkeymenu)
+ EnableItem(menu_resetpassword);
+
EnableItem(resetpinbtn);
- EnableItem(formatbtn);
+
+ if(!isLoginKey)
+ {
+ EnableItem(formatbtn);
+ if(adminkeymenu)
+ EnableItem(menu_format);
+ }
+ else
+ {
+ DisableItem(formatbtn);
+ if(adminkeymenu)
+ DisableItem(menu_format);
+ }
}
else
{
DisableItem(resetpinbtn);
DisableItem(formatbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_format);
+ DisableItem(menu_resetpassword);
+ }
}
if(!isBusy)
@@ -2167,51 +2271,75 @@
return;
}
- if(keyStatus == "UNINITIALIZED")
+ if(keyStatus == getBundleString("statusUninitialized"))
{
DisableItem(viewcertsbtn);
if(isCool)
{
EnableItem(enrollbtn);
+ if(adminkeymenu)
+ EnableItem(menu_enroll);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_enroll);
+
DisableItem(enrollbtn);
}
DisableItem(resetpinbtn);
+ if(adminkeymenu)
+ DisableItem(menu_resetpassword);
+
if(!isBusy)
- detailsKeyLabel.setAttribute("value",getBundleString("uninitializedKey"));
+ detailsKeyLabel.setAttribute("value",getBundleString("statusUninitialized"));
if(isCool)
{
EnableItem(formatbtn);
-
+ if(adminkeymenu)
+ EnableItem(menu_format);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_format);
+
DisableItem(formatbtn);
}
return;
}
- if(keyStatus == "NO APPLET")
+ if(keyStatus == getBundleString("statusNoApplet"))
{
DisableItem(viewcertsbtn);
DisableItem(enrollbtn);
DisableItem(resetpinbtn);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_resetpassword);
+ }
+
if(!isBusy)
- detailsKeyLabel.setAttribute("value",getBundleString("blankKey"));
+ detailsKeyLabel.setAttribute("value",getBundleString("statusNoApplet"));
if(isCool)
{
+ if(adminkeymenu)
+ EnableItem(menu_format);
+
EnableItem(formatbtn);
}
else
{
+ if(adminkeymenu)
+ DisableItem(menu_format);
+
DisableItem(formatbtn);
}
@@ -2229,6 +2357,12 @@
if(operationLabel)
detailsKeyLabel.setAttribute("value",operationLabel);
+ if(adminkeymenu)
+ {
+ DisableItem(menu_enroll);
+ DisableItem(menu_format);
+ DisableItem(menu_resetpassword);
+ }
}
}
@@ -2249,7 +2383,6 @@
}
function UpdateAdminListRow( keyType, keyID)
{
-
if(!gAdminPage)
return;
@@ -2262,6 +2395,8 @@
if(!listbox)
return;
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
+
var issuer = GetCoolKeyIssuer(keyType,keyID);
var issuedTo = GetCoolKeyIssuedTo(keyType,keyID);
var keyStatus = GetStatusForKeyID(keyType, keyID);
@@ -2278,7 +2413,13 @@
issuedToCell.setAttribute("label",issuedTo);
if(statusCell)
- statusCell.setAttribute("label",keyStatus);
+ {
+ if(!isLoginKey)
+ statusCell.setAttribute("label",keyStatus);
+ else
+ statusCell.setAttribute("label",getBundleString("statusLoggedIn"));
+
+ }
if(imageCell)
imageCell.setAttribute("image",SelectImageForKeyStatus(keyStatus,1,0));
@@ -2332,7 +2473,13 @@
return null;
status.setAttribute("class","rowLabelText");
- status.setAttribute("label",keyStatus);
+
+ var isLoginKey = IsKeyLoginKey(keyType,keyID);
+ if(!isLoginKey)
+ status.setAttribute("label",keyStatus);
+ else
+ status.setAttribute("label",getBundleString("statusLoggedIn"));
+
status.setAttribute("id",KeyToCellID(keyType,keyID,"status"));
var progressCell = InsertListCell(listrow);
@@ -2351,9 +2498,12 @@
progressMeter.setAttribute("value", "0%");
progressMeter.setAttribute("class","progressMeter");
+ HideItem(progressMeter);
}
listrow.setAttribute("onclick","DoSelectAdminListRow(this);");
+ listrow.setAttribute("ondblclick","launchCertViewerIfCerts();");
+ listrow.setAttribute("context","adminkeymenu");
adminListBox.appendChild(listrow);
return listrow;
@@ -2396,6 +2546,12 @@
{
SetProgressMeterValue(progMeterID, 0);
SetProgressMeterStatus(progMeterID, "");
+
+ var meter = document.getElementById(progMeterID);
+ if(meter)
+ HideItem(meter);
+
+
}
function KeyToProgressBarID(keyType, keyID)
@@ -2504,6 +2660,8 @@
var screennamepwd = null;
var tokencode = null;
+
+ var failed = 0;
if (type == "userKey")
{
@@ -2526,6 +2684,7 @@
if (!EnrollCoolKey(keyType, keyID, type, screenname, pin,screennamepwd,tokencode))
{
+ failed = 1;
recordMessage("EnrollCoolKey failed.");
}
@@ -2533,7 +2692,11 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("enrollingToken"));
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+ UpdateAdminKeyAreaDetailsLabel(getBundleString("enrollingToken"));
+ }
}
}
@@ -2558,16 +2721,20 @@
var pin = GetPINValue();
var screennamepwd = null;
+ var failed = 0;
+
if (GetCoolKeyIsEnrolled(keyType, keyID))
{
if (!ResetCoolKeyPIN(keyType, keyID, screenname, pin,screennamepwd))
{
+ failed = 1;
recordMessage("ResetCoolKeyPIN failed.");
}
}
else
{
+ failed = 1;
MyAlert(getBundleString("errorEnrolledFirst"));
}
@@ -2575,7 +2742,12 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("resettingTokenPIN"));
+
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+ UpdateAdminKeyAreaDetailsLabel(getBundleString("resettingTokenPIN"));
+ }
}
}
@@ -2590,6 +2762,7 @@
var keyType = keyInfo[0];
var keyID = keyInfo[1];
+ var failed = 0;
var globalType = GetCachedTokenType(keyID);
if(!type)
@@ -2609,6 +2782,7 @@
if (!FormatCoolKey(keyType, keyID, lType, screenname, pin,screennamepwd,tokencode))
{
+ failed = 1;
recordMessage("FormatCoolKey failed.");
}
@@ -2616,7 +2790,11 @@
{
UpdateAdminListRow(keyType,keyID);
UpdateAdminKeyDetailsArea(keyType,keyID);
- UpdateAdminKeyAreaDetailsLabel(getBundleString("formatingToken"));
+ if(!failed)
+ {
+ AdminToggleStatusProgress(1,keyType,keyID);
+ UpdateAdminKeyAreaDetailsLabel(getBundleString("formatingToken"));
+ }
}
}
function DoCancelOperation()
@@ -2677,18 +2855,25 @@
{
var phoneHomeSuccess = 1;
if(DoGetCoolKeyIsReallyCoolKey(keyType, keyID))
+ {
phoneHomeSuccess = DoPhoneHome(keyType,keyID);
+ }
+ else
+ {
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
+ if(!issuer )
+ issuer = getBundleString("unknownIssuer");
+
+ TraySendNotificationMessage(getBundleString("keyInserted"),"\"" + issuer +"\"" + " " + getBundleString("keyInsertedComputer"),3,4000,GetESCNotifyIconPath(keyType,keyID));
+
+ }
+
ShowAllWindows();
if(!CheckForSecurityMode())
{
SelectESCPage(keyType,keyID,1 - phoneHomeSuccess);
}
- var issuer = GetCachedIssuer(keyID);
- if(!issuer )
- {
- issuer = getBundleString("unknownIssuer");
- }
}
}
@@ -2699,7 +2884,6 @@
var row = GetRowForKey(keyType, keyID);
-
if(gHiddenPage)
{
if(curChildWindow)
@@ -2707,7 +2891,7 @@
curChildWindow.close();
curChildWindow = null;
}
- var issuer = GetCachedIssuer(keyID);
+ var issuer = GetCoolKeyIssuer(keyType,keyID);
if(!issuer)
issuer = getBundleString("unknownIssuer");
TraySendNotificationMessage(getBundleString("keyRemoved"),"\"" + issuer + "\"" + " " + getBundleString("keyRemovedComputer"),1,4000,GetESCNotifyIconPath(keyType,keyID));
@@ -2723,9 +2907,17 @@
{
RemoveAdminRow(row);
if (row == gCurrentSelectedRow)
+ {
gCurrentSelectedRow = null;
-
- UpdateAdminKeyDetailsArea(null,null);
+ UpdateAdminBindingListAvailability();
+ }
+ else
+ {
+ if(DoGetNumCoolKeys() == 0)
+ {
+ UpdateAdminKeyDetailsArea(null,null);
+ }
+ }
}
}
@@ -2765,6 +2957,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
ClearProgressBar(KeyToProgressBarID(keyType, keyID));
@@ -2789,6 +2982,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
}
@@ -2812,6 +3006,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
}
@@ -2858,6 +3053,7 @@
{
UpdateAdminKeyDetailsArea(keyType,keyID);
UpdateAdminListRow(keyType,keyID);
+ AdminToggleStatusProgress(0,keyType,keyID);
}
if(!CheckForSecurityMode())
@@ -3319,9 +3515,35 @@
return num;
}
+
+//Return how many unenrolled cards are plugged in.
+function DoGetNumUnenrolledCoolKeys()
+{
+ var num = 0;
+ var arr = GetAvailableCoolKeys();
+ if (arr && arr.length )
+ {
+ for (i=0; i < arr.length; i++)
+ {
+ var status = GetStatusForKeyID(arr[i][0],arr[i][1]);
+
+ if(status != getBundleString("statusEnrolled"))
+ num++;
+
+ }
+ }
+
+ return num;
+
+}
+
+
//Is this really a CoolKey and not a CAC card?
function DoGetCoolKeyIsReallyCoolKey(keyType,keyID)
{
+ if(!keyType && !keyID)
+ return 0;
+
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var isCool = netkey.GetCoolKeyIsReallyCoolKey(keyType, keyID);
@@ -3351,10 +3573,25 @@
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ var tries = 0;
+ while(tries < 3)
+ {
+ url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ if(url.length < 10) // Check for bogus junk
+ {
+ recordMessage("Bogus url found ....");
+ url = null;
+ Sleep(150);
+ recordMessage("Going to try again... ");
+ }
+ else
+ break;
+
+ tries ++;
+ }
- if(url.length < 10) // Check for bogus junk
- url = null;
if(url)
{
@@ -3362,7 +3599,26 @@
var result = DoCoolKeySetConfigValue(issuer_config_value,url);
}
} catch (e) {
- ReportException(getBundleString("errorIssuerInfo") + " " , e);
+ recordMessage("Exception attempting to get token issuer info.");
+
+ var tries = 0;
+ while(tries < 3)
+ {
+ url = netkey.GetCoolKeyIssuerInfo(keyType, keyID);
+
+ if(url.length < 10) // Check for bogus junk
+ {
+ recordMessage("Bogus url found from exception....");
+ url = null;
+ sleep(150);
+ recordMessage("From exception. Going to try again... ");
+ }
+ else
+ break;
+
+ tries ++;
+ }
+ recordMessage("From exception returning " + url);
return url;
}
@@ -3381,6 +3637,24 @@
return atr;
}
+
+//Get Token Name of card
+function DoCoolKeyGetTokenName(keyType,keyID)
+{
+ if(!keyType && !keyID)
+ return null;
+
+ var name = null;
+ try {
+ netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
+ name = netkey.GetCoolKeyTokenName(keyType, keyID);
+ } catch (e) {
+ return name;
+ }
+
+ return name;
+}
+
//Get applet version of card
function DoGetCoolKeyGetAppletVer(keyType, keyID , isMajor)
{
@@ -3418,6 +3692,13 @@
MyAlert(usageStr);
}
+function ShowVersion()
+{
+ var verStr = getBundleString("coolkeyComponentVersion") + "\n\n";
+
+ MyAlert(verStr + " " + GetCoolKeyVersion());
+
+}
//Is the security mode up?
function CheckForSecurityMode()
@@ -3458,6 +3739,33 @@
}
}
+//Launch cert viewer if key has certs
+
+function launchCertViewerIfCerts()
+{
+ var row = null;
+
+ if(gCurrentSelectedRow)
+ row = gCurrentSelectedRow;
+
+ if(!row)
+ return;
+
+ var theID = row.getAttribute("id");
+
+ if (!theID)
+ return;
+
+ var keyInfo = RowIDToKeyInfo(theID);
+
+ var status = GetStatusForKeyID(keyInfo[0],keyInfo[1]);
+
+ if(status == getBundleString("statusEnrolled"))
+ {
+ launchCertViewer();
+ }
+}
+
//Launch page to view card's certificates
function launchCertViewer()
{
@@ -3473,7 +3781,6 @@
if(!adminWnd)
{
var wind = window.open("chrome://esc/content/settings.xul","","chrome,resizable,centerscreen,dialog");
-
} else
{
adminWnd.focus();
@@ -3746,7 +4053,7 @@
function LogKeyInfo(aKeyType,aKeyID,aMessage)
{
- var issuer = GetCachedIssuer(aKeyID);
+ var issuer = GetCoolKeyIssuer(aKeyType,aKeyID);
var status = GetStatusForKeyID(aKeyType, aKeyID);
var atr = DoCoolKeyGetATR(aKeyType,aKeyID);
var tpsURI = GetCachedTPSURL(aKeyID);
@@ -4096,3 +4403,84 @@
if(consoleService)
consoleService.logStringMessage("esc: " + message + "\n");
}
+
+function GetEnvironmentVar(aVar)
+{
+ if(!aVar)
+ return null;
+
+ var environ = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+
+
+ var retVar = null;
+
+ if(environ)
+ retVar = environ.get(aVar);
+
+ //alert("var: " + aVar + " value: " + retVar);
+
+ return retVar;
+}
+
+function SetEnvironmentVar(aVar,aValue)
+{
+ if(!aVar || !aValue)
+ return ;
+
+ var environ = Components.classes["@mozilla.org/process/environment;1"]
+ .getService(Components.interfaces.nsIEnvironment);
+
+ if(environ)
+ retVar = environ.set(aVar,aValue);
+}
+
+function IsKeyLoginKey(keyType,keyID)
+{
+ var result = 0;
+
+ var token_name = DoCoolKeyGetTokenName(keyType,keyID);
+ var login_token_name = GetEnvironmentVar("PKCS11_LOGIN_TOKEN_NAME");
+
+ if(token_name == login_token_name)
+ {
+ result = 1;
+ }
+
+ return result;
+}
+
+function AdminToggleStatusProgress(aOn,keyType,keyID)
+{
+ if(!gAdminPage)
+ return;
+
+ var statusCell = document.getElementById(KeyToCellID(keyType,keyID,"status"));
+
+ if(!statusCell)
+ return;
+
+ var progMeterID = KeyToProgressBarID(keyType, keyID);
+ if(!progMeterID)
+ return;
+
+ var meter = document.getElementById(progMeterID);
+
+ if(!meter)
+ return;
+
+ if(aOn)
+ {
+ HideItem(statusCell);
+ ShowItem(meter);
+ }
+ else
+ {
+ HideItem(meter);
+ ShowItem(statusCell);
+
+ var adminList = document.getElementById("AdminBindingList");
+ if(adminList)
+ adminList.focus();
+ }
+}
--- ./esc/src/app/xul/esc/chrome/content/esc/esc.xul.fix4 2007-04-25 10:47:51.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/esc.xul 2007-04-25 10:47:58.000000000 -0700
@@ -151,8 +151,8 @@
</groupbox>
<hbox id = "enrollment_button_box">
<spacer flex = "4"/>
- <button id="closebtn" label ="&closeNow;" oncommand="HideEnrollmentPage()"/>
- <button id="enrollbtn" label = "&enrollKeyNow;" oncommand="DoShowFullEnrollmentUI();" hidden="true" disabled="false"/>
+ <button id="closebtn" label ="&closeNow;" oncommand="HideEnrollmentPage()" accesskey="&Close.accesskey;"/>
+ <button id="enrollbtn" label = "&enrollKeyNow;" oncommand="DoShowFullEnrollmentUI();" hidden="true" disabled="false" accesskey="&Enroll.accesskey;"/>
<spacer class="horSpacerShort"/>
</hbox>
</vbox>
--- ./esc/src/app/xul/esc/chrome/content/esc/esc.css.fix4 2007-04-25 10:47:28.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/esc.css 2007-04-25 10:47:41.000000000 -0700
@@ -40,7 +40,7 @@
#logoImage {
- list-style-image: url(logo.gif);
+ list-style-image: url(esc.png);
}
#cylonImage {
--- ./esc/src/app/xul/esc/chrome/content/esc/settings.xul.fix4 2007-04-25 10:49:09.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/settings.xul 2007-04-25 10:49:20.000000000 -0700
@@ -72,14 +72,14 @@
<listcol flex="1"/>
<listcol flex="1"/>
<listcol flex="1"/>
- <listcol flex="1"/>
+ <!-- <listcol flex="1"/> -->
</listcols>
<listhead>
<listheader />
<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;"/>
+ <!-- <listheader flex="1" class="headerText" label="&keyProgress;"/> -->
</listhead>
</listbox>
</groupbox>
@@ -132,31 +132,34 @@
<spacer class="verticalSpacer"/>
</description>
- <button class="buttonText" id="formatbtn" label="&doFormat;" oncommand="DoFormatCoolKey('userKey')" disabled="true" hidden = "false"/>
-
- <button class="buttonText" id="enrollbtn" label="&doEnroll;" oncommand="DoCollectPassword('enroll');" disabled="true" hidden="false"/>
+ <button class="buttonText" id="formatbtn" label="&doFormat;" oncommand="DoFormatCoolKey('userKey')" disabled="true" hidden = "false" accesskey="&Format.accesskey;"/>
- <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" accesskey="&Enroll.accesskey;"/>
+ <button class="buttonText" id="resetpinbtn" label="&doResetPin;" oncommand="DoCollectPassword('resetpin');" disabled="true" hidden="false" accesskey="&ResetPin.accesskey;"/>
-<!-- <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();"/>
+ <button class="buttonText" id="viewcertsbtn" label="&doViewCerts;" oncommand="launchCertViewer()" disabled="true" hidden="false" accesskey="&ViewCerts.accesskey;"/>
+ <button class="buttonText" id="advancedbtn" label="&advancedInfo;" disabled="true" hidden="false" oncommand="DoShowAdvancedInfo();" accesskey="&Diagnostics.accesskey;"/>
<spacer flex = "1"/>
<checkbox id="enrolled_key_browser" label="&dontLaunchBrowser;" checked="false" oncommand="DoHandleEnrolledBrowserLaunch(); " hidden="true" disabled="false" />
<spacer flex = "1"/>
- <button class="buttonText" id="closebtn" label ="&closeAdminLater;" oncommand="HideAdminPage();"/>
+ <button class="buttonText" id="closebtn" label ="&closeAdminLater;" oncommand="HideAdminPage();" accesskey="&Close.accesskey;"/>
<spacer class="horSpacerShort"/>
</hbox>
<!-- </groupbox> -->
+
+ <popupset>
+ <menupopup id="adminkeymenu">
+ <menuitem label="&doFormat;" id="menu-format" oncommand="DoFormatCoolKey('userKey');"/>
+ <menuitem label="&doEnroll;" id="menu-enroll" oncommand="DoCollectPassword('enroll');"/>
+ <menuitem label="&doResetPin;" id="menu-resetpassword" oncommand="DoCollectPassword('resetpin');"/>
+ </menupopup>
+</popupset>
</window>
--- ./esc/src/app/xul/esc/chrome/content/esc/config.xul.fix4 2007-04-25 10:47:10.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/config.xul 2007-04-25 10:47:20.000000000 -0700
@@ -67,14 +67,14 @@
<row pack="center">
<label class="titleText" value="&tpsURIHeader;" />
<textbox size="70" class="configTextBox" id="phonehomeuri" value="" />
- <button class="mediumButon" id="testtpsurl" label="&doTest;" oncommand="DoPhoneHomeTest();"/>
+ <button class="mediumButon" id="testtpsurl" label="&doTest;" oncommand="DoPhoneHomeTest();" accesskey="&Test.accesskey;"/>
</row>
</rows>
</grid>
<hbox flex="1">
<spacer flex ="1"/>
- <button label="&escOK;" oncommand="DoPhoneHomeConfigClose();" />
+ <button label="&escOK;" oncommand="DoPhoneHomeConfigClose();" accesskey="&OK.accesskey;" />
</hbox>
<spacer flex="1" style="min-height: 20px" />
</groupbox>
--- ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul.fix4 2007-04-25 10:46:51.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/content/esc/advancedinfo.xul 2007-04-25 10:47:00.000000000 -0700
@@ -55,8 +55,8 @@
</groupbox>
<hbox >
<spacer flex = "1"/>
-<button id="copytocp" label = "&copyToClipboard;" oncommand="DoCopyAdvancedInfoToClipBoard();"/>
-<button id="closebtn" label="&closeNow;" oncommand="window.close();" />
+<button id="copytocp" label = "&copyToClipboard;" oncommand="DoCopyAdvancedInfoToClipBoard();" accesskey="&CopyClip.accesskey;"/>
+<button id="closebtn" label="&closeNow;" oncommand="window.close();" accesskey="&Close.accesskey;" />
</hbox>
--- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd.fix4 2007-04-25 10:50:07.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.dtd 2007-04-25 10:50:19.000000000 -0700
@@ -86,3 +86,14 @@
<!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.">
<!ENTITY dontLaunchBrowser "Don't launch the default browser when enrolled card is inserted.">
+<!ENTITY Close.accesskey "C">
+<!ENTITY OK.accesskey "O">
+<!ENTITY Format.accesskey "F">
+<!ENTITY Enroll.accesskey "E">
+<!ENTITY ResetPin.accesskey "R">
+<!ENTITY Test.accesskey "T">
+<!ENTITY Diagnostics.accesskey "D">
+<!ENTITY Cancel.accesskey "C">
+<!ENTITY Submit.accesskey "S">
+<!ENTITY ViewCerts.accesskey "V">
+<!ENTITY CopyClip.accesskey "T">
--- ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties.fix4 2007-04-25 10:50:25.000000000 -0700
+++ ./esc/src/app/xul/esc/chrome/locale/en-US/esc.properties 2007-04-25 10:50:32.000000000 -0700
@@ -23,12 +23,13 @@
noKeysPresent=No Cards Present
blankKey=Blank
uninitializedKey=Uninitialized
-statusEnrolled=ENROLLED
-statusUnavailable=UNAVAILABLE
-statusNoApplet=NO APPLET
-statusUninitialized=UNINITIALIZED
-statusUnknown=UNKNOWN
-statusBusy=BUSY
+statusEnrolled=Enrolled
+statusUnavailable=Unavailable
+statusNoApplet=Unformatted
+statusUninitialized=Formatted
+statusLoggedIn=Logged In
+statusUnknown=Unknown
+statusBusy=Busy
unknownIssuer=Unknown
redHatUser=User
statusUnknown=Unknown
@@ -79,8 +80,8 @@
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
+menuManageKeys=Manage Smart Cards...
+menuExit=Quit
#ESC Error Messages from TPS
errorNone=Operation Completed Successfully.
serverError=Smart Card Server error.
@@ -165,7 +166,7 @@
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
+enrollmentFor=Enrollment of your
errorNeedKeyForSecMode=Please insert enrolled smart card before attempting secure mode.
wasSuccessful=was successful.
pinResetSuccessful=Password Reset was successfull!
@@ -201,3 +202,5 @@
mustHaveValue=Must have value set for field:
noParentWindow=No parent window.
authDialogNoParent=Auth dialog has no parent!
+authSubmit=Submit
+authSubmitAccessKey=S