summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Tänzer <neo@nhng.de>2012-08-08 00:16:42 +0200
committerMichael Tänzer <neo@nhng.de>2012-08-08 00:30:33 +0200
commit567efe68327ca4568ecc4de0c6c597d247b17a2c (patch)
treedf8ebe687b9a5214c377426e8c202d91be553da8
parentb65f5c60cd9d546584977504770c937254c68690 (diff)
downloadcacert-devel-567efe68327ca4568ecc4de0c6c597d247b17a2c.tar.gz
cacert-devel-567efe68327ca4568ecc4de0c6c597d247b17a2c.tar.xz
cacert-devel-567efe68327ca4568ecc4de0c6c597d247b17a2c.zip
bug 964: Show an explicit error message for non-connected crypto devices
Signed-off-by: Michael Tänzer <neo@nhng.de>
-rw-r--r--includes/keygen.php4
-rw-r--r--www/keygenIE.js5
2 files changed, 9 insertions, 0 deletions
diff --git a/includes/keygen.php b/includes/keygen.php
index b489640..bf8bc5a 100644
--- a/includes/keygen.php
+++ b/includes/keygen.php
@@ -100,6 +100,10 @@ if (array_key_exists('HTTP_USER_AGENT',$_SERVER) &&
<?=_('Could not generate certificate request. Please confirm the '.
'dialogue if you are asked if you want to generate the key.')?>
</p>
+ <p id="createRequestErrorConnectDevice" style="display:none">
+ <?=_('Could not generate certificate request. Please make sure the '.
+ 'cryptography device (e.g. the smartcard) is connected.')?>
+ </p>
<p id="createRequestError" style="display:none">
<?=_('Could not generate certificate request.')?>
</p>
diff --git a/www/keygenIE.js b/www/keygenIE.js
index c311b85..5e2b8c0 100644
--- a/www/keygenIE.js
+++ b/www/keygenIE.js
@@ -84,6 +84,7 @@ var CAcert_keygen_IE = function () {
var generatingKeyNotice = document.getElementById("generatingKeyNotice");
var createRequestErrorChooseAlgorithm = document.getElementById("createRequestErrorChooseAlgorithm");
var createRequestErrorConfirmDialogue = document.getElementById("createRequestErrorConfirmDialogue");
+ var createRequestErrorConnectDevice = document.getElementById("createRequestErrorConnectDevice"));
var createRequestError = document.getElementById("createRequestError");
var invalidKeySizeError = document.getElementById("invalidKeySizeError");
var unsupportedPlatformError = document.getElementById("unsupportedPlatformError");
@@ -593,7 +594,11 @@ var CAcert_keygen_IE = function () {
form.submit();
} catch (e) {
if (e.number === -2147023673) {
+ // 0x800704c7 => dialogue declined
showError(createRequestErrorConfirmDialogue.innerHTML, e);
+ } else if (e.number === -2146435043) {
+ // 0x8010001d => crypto-device not connected
+ showError(createRequestErrorConnectDevice.innerHTML, e);
} else {
showError(createRequestError.innerHTML, e);
}