summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-07-25 00:36:21 +0200
committerMichael Tänzer <neo@nhng.de>2012-07-25 00:36:21 +0200
commit7743c2cdaaaf3d2c1817e668b26fa5e16c144b85 (patch)
tree57bcad44e85b66a934dd32038ad97db7781eaa96 /www
parent1a0d931c9902bb7a4aa6ea7e2914741601033e16 (diff)
downloadcacert-devel-7743c2cdaaaf3d2c1817e668b26fa5e16c144b85.tar.gz
cacert-devel-7743c2cdaaaf3d2c1817e668b26fa5e16c144b85.tar.xz
cacert-devel-7743c2cdaaaf3d2c1817e668b26fa5e16c144b85.zip
bug 964: Add check for key size to the Xenroll code
Signed-off-by: Michael Tänzer <neo@nhng.de>
Diffstat (limited to 'www')
-rw-r--r--www/keygenIE.js10
1 files changed, 9 insertions, 1 deletions
diff --git a/www/keygenIE.js b/www/keygenIE.js
index 51da0ef..7b5aed2 100644
--- a/www/keygenIE.js
+++ b/www/keygenIE.js
@@ -452,7 +452,15 @@
/// Get the selected key size
var getKeySize = function () {
var bits = parseInt(keySize.value, 10);
- //TODO: check if the bits are sane
+ if ( bits < getMinSigKeyLength() || bits > getMaxSigKeyLength() ||
+ (getStepSigKeyLength() &&
+ (bits - getMinSigKeyLength()) %
+ getStepSigKeyLength() !== 0)
+ )
+ {
+ return false;
+ }
+
return bits;
}