summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2013-02-20 00:14:47 +0100
committerBenny Baumann <BenBE@geshi.org>2013-02-20 00:14:47 +0100
commit92b6e7dfe7c8e2a3ee8fa9ecbcb38634d288a8f4 (patch)
treee4f905e5a5ae473402986828c20b007fd6df937f
parent324c036d5823739afd6735e4c2a23b95b4dbcea6 (diff)
downloadcacert-devel-refs/heads/bug-964.tar.gz
cacert-devel-refs/heads/bug-964.tar.xz
cacert-devel-refs/heads/bug-964.zip
Revert "bug 964: Reduce variable scope where possible"bug-964
This reverts commit 387fde16ca52b6ccfc5a46be99219cd09a7411ce. Decision based on discussion with Michael Tänzer.
-rw-r--r--www/keygenIE.js20
1 files changed, 14 insertions, 6 deletions
diff --git a/www/keygenIE.js b/www/keygenIE.js
index 50faf76..be2d184 100644
--- a/www/keygenIE.js
+++ b/www/keygenIE.js
@@ -167,6 +167,8 @@ var CAcert_keygen_IE = function () {
/// Fill the algorithm list
var getAlgorithmList = function () {
+ var i;
+
if (!providerList) {
return false;
}
@@ -182,7 +184,7 @@ var CAcert_keygen_IE = function () {
);
removeChildren(algorithm);
- for (var i = 0; i < cspStats.Count; i++) {
+ for (i = 0; i < cspStats.Count; i++) {
var alg = cspStats.ItemByIndex(i).CspAlgorithm;
algorithm.appendChild(option(alg.Name, i));
}
@@ -192,6 +194,8 @@ var CAcert_keygen_IE = function () {
/// Fill the crypto provider list
var getProviderList = function () {
+ var i;
+
var csps = factory.CreateObject("X509Enrollment.CCspInformations");
// Get provider information
@@ -199,7 +203,7 @@ var CAcert_keygen_IE = function () {
removeChildren(provider);
- for (var i = 0; i < csps.Count; i++) {
+ for (i = 0; i < csps.Count; i++) {
var csp = csps.ItemByIndex(i);
provider.appendChild(option(csp.Name, i));
}
@@ -473,12 +477,14 @@ var CAcert_keygen_IE = function () {
/// Fill the algorithm selection box
var getAlgorithmList = function () {
+ var i, j;
+
refreshProvider();
removeChildren(algorithm);
- for (var i = 0; i < algClasses.length; ++i) {
- for (var j = 0; true; ++j) {
+ for (i = 0; i < algClasses.length; ++i) {
+ for (j = 0; true; ++j) {
try {
var algId = cenroll.EnumAlgs(j, algClasses[i]);
var algName = cenroll.GetAlgName(algId);
@@ -494,13 +500,15 @@ var CAcert_keygen_IE = function () {
/// Fill the provider selection box
var getProviderList = function () {
+ var i, j;
+
removeChildren(provider);
- for (var i = 0; i < providerTypes.length; ++i) {
+ for (i = 0; i < providerTypes.length; ++i) {
cenroll.providerType = providerTypes[i];
var providerName = "invalid";
- for (var j = 0; true; ++j) {
+ for (j = 0; true; ++j) {
try {
providerName = cenroll.enumProviders(j, 0);
provider.appendChild(option(providerName, providerTypes[i]));