summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
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;
}