aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Brunschwig <[email protected]>2021-05-16 15:22:05 +0200
committerPatrick Brunschwig <[email protected]>2021-05-16 15:22:05 +0200
commit43ab823f9adc9e682582dac9b7d539d2f57b8d32 (patch)
tree34880eef44798a19f668bfb66b74002b1e16a79f
parent13b20185b469dd00f8d28e089360cb722d53e5dd (diff)
downloadenigmail-43ab823f9adc9e682582dac9b7d539d2f57b8d32.tar.gz
enigmail-43ab823f9adc9e682582dac9b7d539d2f57b8d32.tar.bz2
enigmail-43ab823f9adc9e682582dac9b7d539d2f57b8d32.zip
implement a dialog if minimum GnuPG version is not met
-rw-r--r--package/cryptoAPI/gpgme.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/package/cryptoAPI/gpgme.js b/package/cryptoAPI/gpgme.js
index 904778ff..1ffda7c5 100644
--- a/package/cryptoAPI/gpgme.js
+++ b/package/cryptoAPI/gpgme.js
@@ -19,6 +19,7 @@ if (typeof CryptoAPI === "undefined") {
/* eslint no-invalid-this: 0 */
XPCOMUtils.defineLazyModuleGetter(this, "EnigmailKeyRing", "chrome://enigmail/content/modules/keyRing.jsm", "EnigmailKeyRing"); /* global EnigmailKeyRing: false */
+XPCOMUtils.defineLazyModuleGetter(this, "EnigmailDialog", "chrome://enigmail/content/modules/dialog.jsm", "EnigmailDialog"); /* global EnigmailDialog: false */
const EnigmailLog = ChromeUtils.import("chrome://enigmail/content/modules/log.jsm").EnigmailLog;
const EnigmailExecution = ChromeUtils.import("chrome://enigmail/content/modules/execution.jsm").EnigmailExecution;
@@ -65,7 +66,7 @@ class GpgMECryptoAPI extends CryptoAPI {
*
* @param {nsIWindow} parentWindow: parent window, may be NULL
* @param {Object} esvc: Enigmail service object
- * @param {String } preferredPath: try to use specific path to locate tool (gpg)
+ * @param {String } preferredPath: try to use specific path to locate tool (not used for gpgme)
*/
initialize(parentWindow, esvc, preferredPath) {
EnigmailLog.DEBUG(`gpgme.js: initialize()\n`);
@@ -94,9 +95,10 @@ class GpgMECryptoAPI extends CryptoAPI {
let r = this.sync(determineGpgVersion(this._gpgPath));
if (EnigmailVersioning.lessThan(r.gpgVersion, MINIMUM_GPG_VERSION)) {
- EnigmailLog.ERROR(`gpgme.js: found GnuPG version ${r.gpgVersion} does not meet minimum required version ${MINIMUM_GPG_VERSION}\n`);
+ EnigmailLog.ERROR(`gpgme.js: found GnuPG version ${r.gpgVersion} older than minimum version ${MINIMUM_GPG_VERSION}\n`);
- throw new Error("GnuPG does not fulfil minimum required version");
+ EnigmailDialog.alert(parentWindow, EnigmailLocale.getString("oldGpgVersion20", [r.gpgVersion, MINIMUM_GPG_VERSION]));
+ throw Components.results.NS_ERROR_FAILURE;
}
this._gpgPath = r.gpgPath;