aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Brunschwig <[email protected]>2021-05-09 21:12:13 +0200
committerPatrick Brunschwig <[email protected]>2021-05-09 21:12:13 +0200
commit688f72064560e2412c728d122049af30cc2ed719 (patch)
tree2baef8e0e3754edebe9f58e6d53de3212f8113b6
parent81ff4241b4a7294d6f6ae195d06bfd842a9fbb67 (diff)
downloadenigmail-688f72064560e2412c728d122049af30cc2ed719.tar.gz
enigmail-688f72064560e2412c728d122049af30cc2ed719.tar.bz2
enigmail-688f72064560e2412c728d122049af30cc2ed719.zip
fixed gpg Path on Windows
-rw-r--r--package/cryptoAPI/gpgme.js23
1 files changed, 17 insertions, 6 deletions
diff --git a/package/cryptoAPI/gpgme.js b/package/cryptoAPI/gpgme.js
index 7b73926b..c10083e1 100644
--- a/package/cryptoAPI/gpgme.js
+++ b/package/cryptoAPI/gpgme.js
@@ -83,18 +83,18 @@ class GpgMECryptoAPI extends CryptoAPI {
for (let o of opts.components) {
if (o.name === "gpg") {
- this._gpgPath = o.program_name;
+ this._gpgPath = gpgUnescape(o.program_name);
break;
}
}
- if (! this._gpgPath) throw "GnuPG not available";
+ if (!this._gpgPath) throw "GnuPG not available";
let r = this.sync(determineGpgVersion(this._gpgPath));
this._gpgPath = r.gpgPath;
this._gpgVersion = r.gpgVersion;
}
- catch(ex) {
+ catch (ex) {
EnigmailLog.DEBUG(`gpgme.js: initialize: error: ${ex.toString()}\n`);
this._gpgmePath = null;
throw ex;
@@ -324,7 +324,7 @@ class GpgMECryptoAPI extends CryptoAPI {
* - {Number} importUnchanged: number of unchanged keys
*/
- async importKeyData(keyData, minimizeKey = false, limitedUids = []) {
+ async importKeyData(keyData, minimizeKey = false, limitedUids = []) {
let args = ["--no-verbose", "--status-fd", "2"];
if (minimizeKey) {
args = args.concat(["--import-options", "import-minimal"]);
@@ -895,7 +895,8 @@ class GpgMECryptoAPI extends CryptoAPI {
// returns a string
if (EnigmailVersioning.greaterThan(gpgVersion, "2.1")) {
return "save";
- } else
+ }
+ else
return "quit";
case "supports-sender":
return EnigmailVersioning.greaterThanOrEqual(gpgVersion, "2.1.15");
@@ -1302,7 +1303,7 @@ function convertNativeNumber(num) {
*
* @param statusMsg
*/
- function parseImportResult(statusMsg) {
+function parseImportResult(statusMsg) {
// IMPORT_RES <count> <no_user_id> <imported> 0 <unchanged>
// <n_uids> <n_subk> <n_sigs> <n_revoc> <sec_read> <sec_imported> <sec_dups> <not_imported>
@@ -1386,3 +1387,13 @@ async function determineGpgVersion(gpgPath) {
gpgPath: gpgPath
};
}
+
+function gpgUnescape(str) {
+ let i = str.search(/%../);
+ while (i >= 0) {
+ let s = str.substr(i, 3);
+ str = str.replace(s, unescape(s));
+ i = str.search(/%../);
+ }
+ return str;
+}