summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoralee <alee@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2010-07-27 19:05:20 +0000
committeralee <alee@c9f7a03b-bd48-0410-a16d-cbbf54688b0b>2010-07-27 19:05:20 +0000
commit85c45437fcf3e07e714d4f2fe775cae73dc06801 (patch)
treeb9bfa7a9f2ecce711e4f50571fe6c310ade7d721
parent2eb3243de06f1589991da47bfde6271e0d80abe6 (diff)
downloadpki-85c45437fcf3e07e714d4f2fe775cae73dc06801.tar.gz
pki-85c45437fcf3e07e714d4f2fe775cae73dc06801.tar.xz
pki-85c45437fcf3e07e714d4f2fe775cae73dc06801.zip
merge 8.1 -> tip, multiple bugs (dogtag)
git-svn-id: svn+ssh://svn.fedorahosted.org/svn/pki/trunk@1135 c9f7a03b-bd48-0410-a16d-cbbf54688b0b
-rw-r--r--pki/dogtag/common-ui/shared/admin/console/config/sizepanel.vm123
-rw-r--r--pki/dogtag/tps-ui/shared/docroot/tokendb/auditAdmin.template20
-rw-r--r--pki/dogtag/tps-ui/shared/docroot/tokendb/doToken.template45
-rw-r--r--pki/dogtag/tps-ui/shared/docroot/tokendb/show.template45
4 files changed, 222 insertions, 11 deletions
diff --git a/pki/dogtag/common-ui/shared/admin/console/config/sizepanel.vm b/pki/dogtag/common-ui/shared/admin/console/config/sizepanel.vm
index aa9d29bb4..448418904 100644
--- a/pki/dogtag/common-ui/shared/admin/console/config/sizepanel.vm
+++ b/pki/dogtag/common-ui/shared/admin/console/config/sizepanel.vm
@@ -30,7 +30,16 @@ div#simple
</style>
<SCRIPT type="text/JavaScript">
+
+var rsalist="${rsalist}";
+var ecclist="${ecclist}";
+
function myOnLoad() {
+ var form = document.forms[0];
+ var keyTypeSelect = form.elements['keytype'];
+ setAlgOptions(keyTypeSelect.value, "commontag");
+
+ setAllAlgOptions(keyTypeSelect.value);
}
function performPanel() {
@@ -50,6 +59,11 @@ function toggleLayer(whichLayer)
style2.display = "block";
}
}
+
+ var algIndex = document.forms[0].elements['keyalgorithm'].selectedIndex;
+ keyTypeChange("commontag");
+ document.forms[0].elements['keyalgorithm'].selectedIndex = algIndex;
+ keyAlgorithmChange();
}
function toggleLayer1(whichLayer)
@@ -67,18 +81,70 @@ function toggleLayer1(whichLayer)
}
}
-function keyTypeChange()
+function keyAlgorithmChange()
{
var form = document.forms[0];
- var keyTypeSelect = document.forms[0].elements['keytype'];
+ var keyTypeSelect = document.forms[0].elements['keyalgorithm'];
for (var i = 0; i < form.length; i++) {
var name = form[i].name;
- if (name.indexOf('_keytype') != -1) {
+ if (name.indexOf('_keyalgorithm') != -1) {
form.elements[name].selectedIndex = keyTypeSelect.selectedIndex;
}
}
}
+function setAllAlgOptions(keyType)
+{
+ var form = document.forms[0];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ var ind = name.indexOf('_keyalgorithm');
+ if (ind != -1) {
+ var tag = name.substring(0,ind);
+ setAlgOptions(keyType, tag);
+ }
+ }
+}
+
+function setAlgOptions(keyType, certTag)
+{
+ var algSelect;
+ var list;
+ if (certTag == "commontag") {
+ algSelect = document.forms[0].elements['keyalgorithm'];
+ } else {
+ algSelect = document.forms[0].elements[certTag + '_keyalgorithm'];
+ }
+ algSelect.options.length=0;
+ if (keyType == "rsa") {
+ list = rsalist.split(",");
+ } else {
+ list = ecclist.split(",");
+ }
+ for (i=0; i < list.length; i++) {
+ algSelect.options[algSelect.options.length] = new Option(list[i], list[i]);
+ }
+}
+
+function keyTypeChange(certTag)
+{
+ var form = document.forms[0];
+ var keyTypeSelect;
+ if (certTag == "commontag") {
+ keyTypeSelect = document.forms[0].elements['keytype'];
+ for (var i = 0; i < form.length; i++) {
+ var name = form[i].name;
+ if (name.indexOf('_keytype') != -1) {
+ form.elements[name].selectedIndex = keyTypeSelect.selectedIndex;
+ }
+ }
+ setAllAlgOptions(keyTypeSelect.value);
+ } else {
+ keyTypeSelect = document.forms[0].elements[certTag + '_keytype'];
+ }
+ setAlgOptions(keyTypeSelect.value, certTag);
+}
+
function defaultChange()
{
var form = document.forms[0];
@@ -122,7 +188,7 @@ function textChange()
}
</SCRIPT>
-Select the key pair type(s) from the pulldown menu, and enter the associated key pair size(s). <a href="javascript:toggle_details();">[Details]</a>
+Select the key pair type(s) and associated key pair size(s) and hashing algorithm(s) from the pulldown menus. <a href="javascript:toggle_details();">[Details]</a>
<SCRIPT type="text/JavaScript">
function toggle_details()
{
@@ -136,7 +202,8 @@ function toggle_details()
</script>
<div id=details style="display: none;">
<br/>
-Each key pair is comprised of a <b><i>key type</i></b> and a <b><i>key size</i></b>. Based upon the key type selected from the first pulldown menu, please enter appropriate key size (in bits).
+Each key pair is comprised of a <b><i>key type</i></b>, <b><i>key size</i></b> and <b><i>hashing algorithm</i></b>. Based upon the key type selected from the first pulldown menu, associated key sizes (in bits) and hashing algorithms will be selectable from the second pulldown menu. Hashing algorithm selection is disabled for non-CA subsystems. Please refer to the documentation for details.
+<br/>
<br/>
Within each key pair type (but not comparable between two different key pair types), the size of the key is a measure of how secure a given system is (i.e. - the longer the key pair size, the more secure the system). Unfortunately, longer key pair sizes increase the time required to perform operations such as signing certificates.
<br/>
@@ -162,9 +229,28 @@ For a cloned subsystem, only the key for an SSL server certificate is generated.
<table width=100% class="details">
<tr>
<th width="30%">Key Type:</th>
- <td><select name="keytype" onChange="keyTypeChange()"><option value="rsa">RSA</option><option value="ecc">ECC</option></select></td>
+ <td><select name="keytype" onChange="keyTypeChange('commontag')"><option value="rsa">RSA</option><option value="ecc">ECC</option></select></td>
+ </tr>
+</table>
+
+#if ($subsystemtype == "ca")
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Hashing Algorithm:</th>
+ <td><select name="keyalgorithm" onChange="keyAlgorithmChange()">
+ </select></td>
</tr>
</table>
+#else
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Hashing Algorithm:</th>
+ <td><select disabled="disabled" name="keyalgorithm" onChange="keyAlgorithmChange()">
+ </select></td>
+ </tr>
+</table>
+#end
+
<p>
<input checked onChange="defaultChange()" type=radio name="choice" value="default"><b>Use the default key size ($default_keysize bits for RSA, $default_ecc_keysize bits for ECC)</b>.
<p>
@@ -177,6 +263,7 @@ For a cloned subsystem, only the key for an SSL server certificate is generated.
<td><input onChange="textChange()" type="text" size="20" name="custom_size" value="2048" /></td>
</tr>
</table>
+
</div>
<p>
<div id="advance">
@@ -193,14 +280,33 @@ For a cloned subsystem, only the key for an SSL server certificate is generated.
<tr>
<th width="30%">Key Type:</th>
#if ($item.isEnable())
- <td><select name="$item.getCertTag()_keytype"><option value=rsa>RSA</option><option value="ecc">ECC</option></select></td>
+ <td><select name="$item.getCertTag()_keytype" onChange="keyTypeChange('$item.getCertTag()')"><option value=rsa>RSA</option><option value="ecc">ECC</option></select></td>
#else
- <td><select name="$item.getCertTag()_keytype" disabled="disabled"><option value=rsa>RSA</option><option value="ecc">ECC</option></select></td>
+ <td><select name="$item.getCertTag()_keytype" disabled="disabled" onChange="keyTypeChange('$item.getCertTag()')"><option value=rsa>RSA</option><option value="ecc">ECC</option></select></td>
#end
</tr>
</table>
<br/>
+#if ($subsystemtype == "ca")
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Hashing Algorithm:</th>
+ <td><select name="$item.getCertTag()_keyalgorithm">
+ </select></td>
+ </tr>
+</table>
+#else
+<table width=100% class="details">
+ <tr>
+ <th width="30%">Hashing Algorithm:</th>
+ <td><select disabled="disabled" name="$item.getCertTag()_keyalgorithm">
+ </select></td>
+ </tr>
+</table>
+#end
+<br/>
+
#if ($item.isEnable())
<input
#if ($item.useDefaultKey())
@@ -240,6 +346,7 @@ For a cloned subsystem, only the key for an SSL server certificate is generated.
#end
</tr>
</table>
+
#end
</div>
<br/>
diff --git a/pki/dogtag/tps-ui/shared/docroot/tokendb/auditAdmin.template b/pki/dogtag/tps-ui/shared/docroot/tokendb/auditAdmin.template
index 62691261a..46abadf6c 100644
--- a/pki/dogtag/tps-ui/shared/docroot/tokendb/auditAdmin.template
+++ b/pki/dogtag/tps-ui/shared/docroot/tokendb/auditAdmin.template
@@ -124,6 +124,26 @@ function doCancel() {
document.write("</td>\n");
document.write("</tr>\n");
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Audit Log Signing Interval (seconds):&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=logSigningInterval VALUE=\"" + signedAuditLogInterval + "\" />");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
+ document.write("<tr>\n");
+ document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
+ document.write("<font face=\"PrimaSans BT, Verdana, sans-serif\" size=\"-1\">"+
+ "Audit Log Signing Buffer Size (bytes, minimum 512):&nbsp;</font>\n");
+ document.write("</td>\n");
+ document.write("<td>\n");
+ document.write("<input TYPE=TEXT NAME=logSigningBufferSize VALUE=\"" + signedAuditLogBufferSize + "\" />");
+ document.write("</td>\n");
+ document.write("</tr>\n");
+
var nonselectable_array = signedAuditNonSelectableEvents.split(",");
document.write("<tr>\n");
document.write("<td ALIGN=LEFT width=30% bgcolor=#e5e5e5>\n");
diff --git a/pki/dogtag/tps-ui/shared/docroot/tokendb/doToken.template b/pki/dogtag/tps-ui/shared/docroot/tokendb/doToken.template
index aab1d0322..378c537a5 100644
--- a/pki/dogtag/tps-ui/shared/docroot/tokendb/doToken.template
+++ b/pki/dogtag/tps-ui/shared/docroot/tokendb/doToken.template
@@ -155,6 +155,14 @@ function doCancel() {
}
+function check_transition(state, tlist) {
+ for (var i=0; i < tlist.length; i++) {
+ if (state == tlist[i]) {
+ return true;
+ }
+ }
+ return false;
+}
if (rc == "0") {
document.write("<b>The operation has been successful.</b>");
@@ -294,7 +302,42 @@ if (rc == "0") {
document.write("<table BORDER=0 CELLSPACING=2 CELLPADDING=0>\n");
document.write("<tr>\n");
document.write("<td width=60%>\n");
- document.write("<form method='get' action='tus'><select name=\"question\"><option value=\"1\">This token has been physically damaged.</option><option value=\"2\">This token has been permanently lost.</option><option value=\"3\">This token has been temporarily lost.</option><option value=\"4\">This temporarily lost token has been found.</option><option value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option><option value=\"6\">This token has been terminated.</option></select><input type=hidden name=op value=do_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ var transitions = allowed_transitions.split(",");
+ if (allowed_transitions != "") {
+ document.write("<form method='get' action='tus'><select name=\"question\">");
+
+ if (check_transition(1, transitions)) {
+ document.write("<option value=\"1\" >This token has been physically damaged.</option>");
+ } else {
+ document.write("<option value=\"1\" disabled=true >This token has been physically damaged.</option>");
+ }
+ if (check_transition(2, transitions)) {
+ document.write("<option value=\"2\">This token has been permanently lost.</option>");
+ } else {
+ document.write("<option value=\"2\" disabled=true >This token has been permanently lost.</option>");
+ }
+ if (check_transition(3, transitions)) {
+ document.write("<option value=\"3\" >This token has been temporarily lost.</option>");
+ } else {
+ document.write("<option value=\"3\" disabled=true >This token has been temporarily lost.</option>");
+ }
+ if (check_transition(4, transitions)) {
+ document.write("<option value=\"4\" >This temporarily lost token has been found.</option>");
+ } else {
+ document.write("<option value=\"4\" disabled=true >This temporarily lost token has been found.</option>");
+ }
+ if (check_transition(5, transitions)) {
+ document.write("<option value=\"5\" >This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ } else {
+ document.write("<option value=\"5\" disabled=true >This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ }
+ if (check_transition(6, transitions)) {
+ document.write("<option value=\"6\" >This token has been terminated.</option>");
+ } else {
+ document.write("<option value=\"6\" disabled=true >This token has been terminated.</option>");
+ }
+ document.write("</select><input type=hidden name=op value=do_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+  }
document.write("</td>\n");
document.write("<td width=10%>\n");
document.write("<form method='get' action='tus'><input type=hidden name=op value=revoke><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Revoke\"></form>");
diff --git a/pki/dogtag/tps-ui/shared/docroot/tokendb/show.template b/pki/dogtag/tps-ui/shared/docroot/tokendb/show.template
index 0ac1a2a5e..e30365aa6 100644
--- a/pki/dogtag/tps-ui/shared/docroot/tokendb/show.template
+++ b/pki/dogtag/tps-ui/shared/docroot/tokendb/show.template
@@ -149,6 +149,15 @@ function doSave(form) {
}
}
+function check_transition(state, tlist) {
+ for (var i=0; i < tlist.length; i++) {
+ if (state == tlist[i]) {
+ return true;
+ }
+ }
+ return false;
+}
+
function doCancel() {
var uri = "";
if (typeof(uriBase) == "undefined") {
@@ -297,8 +306,40 @@ if (typeof(results) == "undefined" || results.length == 0) {
document.write("<tr>\n");
document.write("<td width=60%>\n");
- if ((typeof(topLevel) == "undefined") || (topLevel != "operator")) {
- document.write("<form method='get' action='tus'><select name=\"question\"><option value=\"1\">This token has been physically damaged.</option><option value=\"2\">This token has been permanently lost.</option><option value=\"3\">This token has been temporarily lost.</option><option value=\"4\">This temporarily lost token has been found.</option><option value=\"5\">This temporarily lost token cannot be found (becomes permanently lost).</option><option value=\"6\">This token has been terminated.</option></select><input type=hidden name=op value=do_confirm_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
+ if ((allowed_transitions != "") && ((typeof(topLevel) == "undefined") || (topLevel != "operator"))) {
+ var transitions = allowed_transitions.split(",");
+ document.write("<form method='get' action='tus'><select name=\"question\">");
+ if (check_transition(1, transitions)) {
+ document.write("<option value=\"1\" >This token has been physically damaged.</option>");
+ } else {
+ document.write("<option value=\"1\" disabled=true >This token has been physically damaged.</option>");
+ }
+ if (check_transition(2, transitions)) {
+ document.write("<option value=\"2\">This token has been permanently lost.</option>");
+ } else {
+ document.write("<option value=\"2\" disabled=true >This token has been permanently lost.</option>");
+ }
+ if (check_transition(3, transitions)) {
+ document.write("<option value=\"3\" >This token has been temporarily lost.</option>");
+ } else {
+ document.write("<option value=\"3\" disabled=true >This token has been temporarily lost.</option>");
+ }
+ if (check_transition(4, transitions)) {
+ document.write("<option value=\"4\" >This temporarily lost token has been found.</option>");
+ } else {
+ document.write("<option value=\"4\" disabled=true >This temporarily lost token has been found.</option>");
+ }
+ if (check_transition(5, transitions)) {
+ document.write("<option value=\"5\" >This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ } else {
+ document.write("<option value=\"5\" disabled=true >This temporarily lost token cannot be found (becomes permanently lost).</option>");
+ }
+ if (check_transition(6, transitions)) {
+ document.write("<option value=\"6\" >This token has been terminated.</option>");
+ } else {
+ document.write("<option value=\"6\" disabled=true >This token has been terminated.</option>");
+ }
+ document.write("</select><input type=hidden name=op value=do_confirm_token><input type=hidden name=tid value=" + results[0].cn + "><input TYPE=submit VALUE=\"Go\"></form>");
}
document.write("</td>\n");
document.write("<td align=right width=10%>\n");