Author: jmagne
Update of /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv17947/app/xul/esc/chrome/content/esc
Modified Files:
ESC.js MineOverlay.xul certManager.xul password.js
password.xul
Log Message:
Latest RHEL fixes.
Index: ESC.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/ESC.js,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -r1.17 -r1.18
--- ESC.js 28 May 2008 03:00:33 -0000 1.17
+++ ESC.js 4 Feb 2009 01:43:47 -0000 1.18
@@ -51,8 +51,6 @@
const ESC_FACE_TO_FACE_MODE = "esc.face.to.face.mode";
const ESC_SECURITY_URL="esc.security.url";
const ESC_SECURE_URL="esc.secure.url";
-const ESC_GLOBAL_PHONE_HOME_URL= "esc.global.phone.home.url";
-const SPECIAL_ATR="3B76940000FF6276010000";
const CLEAN_TOKEN = "cleanToken";
const UNINITIALIZED = 1;
@@ -292,10 +290,6 @@
//Check for special key since we have no phone home info.
- if(!home) {
- home = GetGlobalPhoneHomeUrl(keyType,keyID);
- }
-
var homeRes = false;
if(home)
@@ -317,43 +311,6 @@
return homeRes;
}
-//Get global phone home url only for a special key
-
-function GetGlobalPhoneHomeUrl(keyType,keyID)
-{
-
- var globalIssuerURL=null;
- var specialATR=SPECIAL_ATR;
- var phonHomeURL= DoCoolKeyGetATR(keyType,keyID);
-
- var specialAppletVerMaj=1;
- var specialAppletVerMin=1;
-
-
- var appletVerMaj = DoGetCoolKeyGetAppletVer(keyType, keyID , true);
- var appletVerMin = DoGetCoolKeyGetAppletVer(keyType, keyID, false);
-
-
- if( (appletVerMaj != specialAppletVerMaj) ||
- ( appletVerMin > specialAppletVerMin)) {
-
- return null;
- }
-
- var keyATR = DoCoolKeyGetATR(keyType,keyID);
-
-
- if( keyATR != specialATR) {
- return null;
- }
-
- globalIssuerURL = DoCoolKeyGetConfigValue(ESC_GLOBAL_PHONE_HOME_URL);
-
-
- return globalIssuerURL;
-
-}
-
//Test Phone Home url in config UI
function DoPhoneHomeTest()
@@ -724,7 +681,6 @@
issuer = GetCachedIssuer(keyID);
-
// Now try to read off the certs if applicable
if(!issuer && (GetStatusForKeyID(keyType, keyID) ==
getBundleString("statusEnrolled")))
@@ -733,6 +689,22 @@
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
issuer = netkey.GetCoolKeyIssuer(keyType,keyID);
+ var issuer_url = ConfigValueWithKeyID(keyID,KEY_ISSUER_URL);
+ var issuer_url_value = null;
+
+ if(issuer_url)
+ {
+ issuer_url_value = DoCoolKeyGetConfigValue(issuer_url);
+ }
+
+ if(issuer && !issuer_url_value)
+ {
+ var issuer_config_value = ConfigValueWithKeyID(keyID,KEY_ISSUER);
+ if(issuer_config_value)
+ {
+ DoCoolKeySetConfigValue(issuer_config_value,issuer);
+ }
+ }
} catch (e)
{
issuer = null;
Index: MineOverlay.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/MineOverlay.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MineOverlay.xul 27 Sep 2006 17:52:54 -0000 1.1
+++ MineOverlay.xul 4 Feb 2009 01:43:47 -0000 1.2
@@ -19,11 +19,9 @@
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- - Portions created by Jack Magne are Copyright (C) 2006 Red Hat, Inc.
- Contributor(s):
- Bob Lord <lord(a)netscape.com>
- Ian McGreer <mcgreer(a)netscape.com>
- - Jack Magne <jmagne(a)redhat.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -60,9 +58,13 @@
<treecol id="tokencol" label="&certmgr.tokenname;"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
+<!-- disable the purposes column until we get a solution
+ to fill in this information that is compatible with OCSP
+ and does not block the whole interface
<treecol id="purposecol" label="&certmgr.purpose;"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
+-->
<treecol id="serialnumcol" label="&certmgr.serial;"
persist="hidden width ordinal" flex="1"/>
<splitter class="tree-splitter"/>
@@ -80,20 +82,28 @@
<hbox>
<button id="mine_viewButton" class="normal"
- label="&certmgr.view.label;"
+ label="&certmgr.view2.label;"
+ accesskey="&certmgr.view2.accesskey;"
disabled="true" oncommand="viewCerts();"/>
+
+<!--
<button id="mine_backupButton" class="normal"
- label="&certmgr.backup.label;"
- hidden="true" oncommand="backupCerts();"/>
- <button hidden="true" id="mine_backupAllButton"
class="normal"
- label="&certmgr.backupall.label;"
+ label="&certmgr.backup2.label;"
+ accesskey="&certmgr.backup2.accesskey;"
+ disabled="true" oncommand="backupCerts();"/>
+ <button id="mine_backupAllButton" class="normal"
+ label="&certmgr.backupall2.label;"
+ accesskey="&certmgr.backupall2.accesskey;"
oncommand="backupAllCerts();"/>
<button id="mine_restoreButton" class="normal"
- hidden="true" label="&certmgr.restore.label;"
+ label="&certmgr.restore2.label;"
+ accesskey="&certmgr.restore2.accesskey;"
oncommand="restoreCerts();"/>
<button id="mine_deleteButton" class="normal"
- hidden="true" label="&certmgr.delete.label;"
+ label="&certmgr.delete2.label;"
+ accesskey="&certmgr.delete2.accesskey;"
disabled="true" oncommand="deleteCerts();"/>
+-->
</hbox>
</vbox>
</overlay>
Index: certManager.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/certManager.xul,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- certManager.xul 27 Sep 2006 17:52:54 -0000 1.1
+++ certManager.xul 4 Feb 2009 01:43:47 -0000 1.2
@@ -19,12 +19,9 @@
- Portions created by the Initial Developer are Copyright (C) 2001
- the Initial Developer. All Rights Reserved.
-
- - Portions created by Jack Magne are Copyright (C) 2006 Red Hat, Inc.
-
- Contributor(s):
- Bob Lord <lord(a)netscape.com>
- Ian McGreer <mcgreer(a)netscape.com>
- - Jack Magne<jmagne(a)redhat.com>
-
- Alternatively, the contents of this file may be used under the terms of
- either the GNU General Public License Version 2 or later (the "GPL"), or
@@ -46,6 +43,7 @@
<?xul-overlay href="chrome://pippki/content/OthersOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/WebSitesOverlay.xul"?>
<?xul-overlay href="chrome://pippki/content/CAOverlay.xul"?>
+<?xul-overlay href="chrome://pippki/content/OrphanOverlay.xul"?>
<!DOCTYPE dialog SYSTEM "chrome://pippki/locale/certManager.dtd">
@@ -54,30 +52,34 @@
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul...
title="&certmgr.title;"
onload="LoadCerts();"
- ondialoghelp="return doHelpButton();"
+ buttons="accept"
style="width: 48em; height: 32em;"
persist="screenX screenY width height">
- <script type="application/x-javascript"
src="chrome://help/content/contextHelp.js"/>
<script type="application/x-javascript"
src="chrome://global/content/strres.js"/>
<script type="application/x-javascript"
src="chrome://pippki/content/pippki.js"/>
<script type="application/x-javascript"
src="chrome://pippki/content/certManager.js"/>
+ <script type="application/x-javascript"
src="escCertManager.js"/>
<vbox flex="1">
- <tabbox flex="1" style="margin:5px">
+ <tabbox id="certmanagertabs" flex="1"
style="margin:5px" persist="selectedIndex">
<tabs id="certMgrTabbox">
- <tab id="mine_tab" label="&certmgr.tab.mine;"/>
- <tab id="others_tab" hidden="true"
label="&certmgr.tab.others;"/>
- <tab id="websites_tab" hidden="true"
label="&certmgr.tab.websites;"/>
- <tab id="ca_tab" hidden="true"
label="&certmgr.tab.ca;" selected="true"/>
+ <tab id="mine_tab" label="&certmgr.tab.mine;"
selected="true"/>
+ <tab id="others_tab" hidden="true"
label="&certmgr.tab.others2;"/>
+ <tab id="websites_tab" hidden="true"
label="&certmgr.tab.websites3;"/>
+ <tab id="ca_tab" hidden="true"
label="&certmgr.tab.ca;"/>
+ <tab id="orphan_tab" hidden="true"
label="&certmgr.tab.orphan2;"/>
+
</tabs>
<tabpanels flex="1">
<vbox id="myCerts" flex="1"/>
<vbox id="othersCerts" flex="1"/>
<vbox id="webCerts" flex="1"/>
<vbox id="CACerts" flex="1"/>
+ <vbox id="OrphanCerts" flex="1"/>
</tabpanels>
</tabbox>
+
</vbox>
</dialog>
Index: password.js
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/password.js,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- password.js 7 May 2007 23:49:23 -0000 1.3
+++ password.js 4 Feb 2009 01:43:47 -0000 1.4
@@ -39,7 +39,7 @@
if(theOperation == "enroll")
parentWindow.DoEnrollCoolKey();
- window.close();
+ window.close();
}
@@ -102,3 +102,84 @@
return str;
}
+//Evaulate Password Quality
+
+function EvaluatePasswordQuality()
+{
+ var qualityImage = document.getElementById("password-image");
+ var pw = document.getElementById("pintf").value;
+ var pwlength = 0;
+
+ var qualityMeter = document.getElementById("pass-progress-id");
+
+
+ if(pw)
+ pwlength = pw.length;
+
+ if (pwlength>5)
+ pwlength=5;
+
+//use of numbers in the password
+ var numnumeric = pw.replace (/[0-9]/g, "");
+ var numeric=(pw.length - numnumeric.length);
+ if (numeric>3)
+ numeric=3;
+
+//use of symbols in the password
+ var symbols = pw.replace (/\W/g, "");
+ var numsymbols=(pw.length - symbols.length);
+ if (numsymbols>3)
+ numsymbols=3;
+
+//use of uppercase in the password
+ var numupper = pw.replace (/[A-Z]/g, "");
+ var upper=(pw.length - numupper.length);
+ if (upper>3)
+ upper=3;
+
+ var pwstrength=((pwlength*10)-20) + (numeric*10) + (numsymbols*15) + (upper*10);
+
+// make sure we're give a value between 0 and 100
+ if ( pwstrength < 0 ) {
+ pwstrength = 0;
+ }
+ if ( pwstrength > 100 ) {
+ pwstrength = 100;
+ }
+ if(qualityMeter)
+ {
+ qualityMeter.setAttribute("value", pwstrength);
+
+ }
+ if(qualityImage)
+ {
+ if(pwlength==0)
+ {
+ qualityImage.setAttribute("src","1-none.png");
+ return;
+ }
+ if(pwstrength < 40)
+ {
+ qualityImage.setAttribute("src", "2-vweak.png");
+ return;
+ }
+ if(pwstrength >= 40 && pwstrength < 50)
+ {
+ qualityImage.setAttribute("src","3-weak.png");
+ return;
+ }
+ if(pwstrength >=50 && pwstrength < 60)
+ {
+ qualityImage.setAttribute("src","4-fair.png");
+ return;
+ }
+ if(pwstrength >= 60 && pwstrength < 80)
+ {
+ qualityImage.setAttribute("src","5-good.png");
+ return;
+ }
+ if(pwstrength >= 80)
+ qualityImage.setAttribute("src","6-strong.png");
+ }
+}
+
Index: password.xul
===================================================================
RCS file: /cvs/dirsec/esc/src/app/xul/esc/chrome/content/esc/password.xul,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- password.xul 7 May 2007 23:53:27 -0000 1.3
+++ password.xul 4 Feb 2009 01:43:47 -0000 1.4
@@ -28,7 +28,6 @@
<stringbundle id="esc_strings"
src="chrome://esc/locale/esc.properties"/>
<script src="password.js"/>
-<script src="ESC.js"/>
<script src="TRAY.js"/>
<spacer class = "horSpacerVeryShort"/>