Hello community, here is the log from the commit of package enigmail for openSUSE:Factory checked in at 2016-09-27 13:43:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/enigmail (Old) and /work/SRC/openSUSE:Factory/.enigmail.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "enigmail" Changes: -------- --- /work/SRC/openSUSE:Factory/enigmail/enigmail.changes 2016-07-14 09:50:45.000000000 +0200 +++ /work/SRC/openSUSE:Factory/.enigmail.new/enigmail.changes 2016-09-27 13:43:45.000000000 +0200 @@ -1,0 +2,12 @@ +Mon Sep 5 14:30:21 UTC 2016 - [email protected] + +- enigmail 1.9.5: + * fix failure during GnuPG installation + * Include AppData + * Forwarding an encrypted message results in empty body + * Fix parsing ofr last '=' in quoted-printable encoded + encrypted/signed parts + * fix regression in key selection for Per-Recipient-Rules +- license is MPL-2.0, include license text + +------------------------------------------------------------------- Old: ---- enigmail-1.9.4.tar.gz enigmail-1.9.4.tar.gz.asc New: ---- COPYING enigmail-1.9.5.tar.gz enigmail-1.9.5.tar.gz.asc ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ enigmail.spec ++++++ --- /var/tmp/diff_new_pack.9KR2z3/_old 2016-09-27 13:43:46.000000000 +0200 +++ /var/tmp/diff_new_pack.9KR2z3/_new 2016-09-27 13:43:46.000000000 +0200 @@ -18,10 +18,10 @@ Name: enigmail -Version: 1.9.4 +Version: 1.9.5 Release: 0 Summary: OpenPGP addon for Thunderbird and SeaMonkey -License: MPL-1.1 or GPL-2.0+ +License: MPL-2.0 Group: Productivity/Networking/Email/Clients Url: https://www.enigmail.net/ # git clone git://git.code.sf.net/p/enigmail/source enigmail @@ -29,6 +29,7 @@ Source1: https://www.enigmail.net/download/source/%{name}-%{version}.tar.gz.asc # https://www.enigmail.net/documentation/pgp-key.php Source2: enigmail.keyring +Source3: https://www.mozilla.org/media/MPL/2.0/index.815ca599c9df.txt#/COPYING BuildRequires: perl >= 5 BuildRequires: python >= 2.7 BuildRequires: unzip @@ -42,6 +43,7 @@ %prep %setup -q -n enigmail +cp %{SOURCE3} . %build # FIXME: you should use the %%configure macro @@ -61,8 +63,14 @@ (cd %{buildroot}%{_libdir}/mozilla/extensions/\{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a\}; \ ln -s ../\{3550f703-e582-4d05-9a08-453d09bdfdc6\}/\{847b3a00-7ab1-11d4-8f02-006008948af5\} ) +mkdir -p %{buildroot}%{_datadir}/appdata/ +install -m644 thunderbird-enigmail.metainfo.xml %{buildroot}%{_datadir}/appdata/enigmail.appdata.xml + %files %defattr(-,root,root) %{_libdir}/mozilla/ +%doc COPYING +%dir %{_datadir}/appdata +%{_datadir}/appdata/enigmail.appdata.xml %changelog ++++++ COPYING ++++++ Mozilla Public License Version 2.0 ================================== 1. Definitions -------------- 1.1. "Contributor" means each individual or legal entity that creates, contributes to the creation of, or owns Covered Software. 1.2. "Contributor Version" means the combination of the Contributions of others (if any) used by a Contributor and that particular Contributor's Contribution. 1.3. "Contribution" means Covered Software of a particular Contributor. 1.4. "Covered Software" means Source Code Form to which the initial Contributor has attached the notice in Exhibit A, the Executable Form of such Source Code Form, and Modifications of such Source Code Form, in each case including portions thereof. 1.5. "Incompatible With Secondary Licenses" means (a) that the initial Contributor has attached the notice described in Exhibit B to the Covered Software; or (b) that the Covered Software was made available under the terms of version 1.1 or earlier of the License, but not also under the terms of a Secondary License. 1.6. "Executable Form" means any form of the work other than Source Code Form. 1.7. "Larger Work" means a work that combines Covered Software with other material, in a separate file or files, that is not Covered Software. 1.8. "License" means this document. 1.9. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently, any and all of the rights conveyed by this License. 1.10. "Modifications" means any of the following: (a) any file in Source Code Form that results from an addition to, deletion from, or modification of the contents of Covered Software; or (b) any new file in Source Code Form that contains any Covered Software. 1.11. "Patent Claims" of a Contributor means any patent claim(s), including without limitation, method, process, and apparatus claims, in any patent Licensable by such Contributor that would be infringed, but for the grant of the License, by the making, using, selling, offering for sale, having made, import, or transfer of either its Contributions or its Contributor Version. 1.12. "Secondary License" means either the GNU General Public License, Version 2.0, the GNU Lesser General Public License, Version 2.1, the GNU Affero General Public License, Version 3.0, or any later versions of those licenses. 1.13. "Source Code Form" means the form of the work preferred for making modifications. 1.14. "You" (or "Your") means an individual or a legal entity exercising rights under this License. For legal entities, "You" includes any entity that controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. License Grants and Conditions -------------------------------- 2.1. Grants Each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license: (a) under intellectual property rights (other than patent or trademark) Licensable by such Contributor to use, reproduce, make available, modify, display, perform, distribute, and otherwise exploit its Contributions, either on an unmodified basis, with Modifications, or as part of a Larger Work; and (b) under Patent Claims of such Contributor to make, use, sell, offer for sale, have made, import, and otherwise transfer either its Contributions or its Contributor Version. 2.2. Effective Date The licenses granted in Section 2.1 with respect to any Contribution become effective for each Contribution on the date the Contributor first distributes such Contribution. 2.3. Limitations on Grant Scope The licenses granted in this Section 2 are the only rights granted under this License. No additional rights or licenses will be implied from the distribution or licensing of Covered Software under this License. Notwithstanding Section 2.1(b) above, no patent license is granted by a Contributor: (a) for any code that a Contributor has removed from Covered Software; or (b) for infringements caused by: (i) Your and any other third party's modifications of Covered Software, or (ii) the combination of its Contributions with other software (except as part of its Contributor Version); or (c) under Patent Claims infringed by Covered Software in the absence of its Contributions. This License does not grant any rights in the trademarks, service marks, or logos of any Contributor (except as may be necessary to comply with the notice requirements in Section 3.4). 2.4. Subsequent Licenses No Contributor makes additional grants as a result of Your choice to distribute the Covered Software under a subsequent version of this License (see Section 10.2) or under the terms of a Secondary License (if permitted under the terms of Section 3.3). 2.5. Representation Each Contributor represents that the Contributor believes its Contributions are its original creation(s) or it has sufficient rights to grant the rights to its Contributions conveyed by this License. 2.6. Fair Use This License is not intended to limit any rights You have under applicable copyright doctrines of fair use, fair dealing, or other equivalents. 2.7. Conditions Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted in Section 2.1. 3. Responsibilities ------------------- 3.1. Distribution of Source Form All distribution of Covered Software in Source Code Form, including any Modifications that You create or to which You contribute, must be under the terms of this License. You must inform recipients that the Source Code Form of the Covered Software is governed by the terms of this License, and how they can obtain a copy of this License. You may not attempt to alter or restrict the recipients' rights in the Source Code Form. 3.2. Distribution of Executable Form If You distribute Covered Software in Executable Form then: (a) such Covered Software must also be made available in Source Code Form, as described in Section 3.1, and You must inform recipients of the Executable Form how they can obtain a copy of such Source Code Form by reasonable means in a timely manner, at a charge no more than the cost of distribution to the recipient; and (b) You may distribute such Executable Form under the terms of this License, or sublicense it under different terms, provided that the license for the Executable Form does not attempt to limit or alter the recipients' rights in the Source Code Form under this License. 3.3. Distribution of a Larger Work You may create and distribute a Larger Work under terms of Your choice, provided that You also comply with the requirements of this License for the Covered Software. If the Larger Work is a combination of Covered Software with a work governed by one or more Secondary Licenses, and the Covered Software is not Incompatible With Secondary Licenses, this License permits You to additionally distribute such Covered Software under the terms of such Secondary License(s), so that the recipient of the Larger Work may, at their option, further distribute the Covered Software under the terms of either this License or such Secondary License(s). 3.4. Notices You may not remove or alter the substance of any license notices (including copyright notices, patent notices, disclaimers of warranty, or limitations of liability) contained within the Source Code Form of the Covered Software, except that You may alter any license notices to the extent required to remedy known factual inaccuracies. 3.5. Application of Additional Terms You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Software. However, You may do so only on Your own behalf, and not on behalf of any Contributor. You must make it absolutely clear that any such warranty, support, indemnity, or liability obligation is offered by You alone, and You hereby agree to indemnify every Contributor for any liability incurred by such Contributor as a result of warranty, support, indemnity or liability terms You offer. You may include additional disclaimers of warranty and limitations of liability specific to any jurisdiction. 4. Inability to Comply Due to Statute or Regulation --------------------------------------------------- If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Software due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be placed in a text file included with all distributions of the Covered Software under this License. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Termination -------------- 5.1. The rights granted under this License will terminate automatically if You fail to comply with any of its terms. However, if You become compliant, then the rights granted under this License from a particular Contributor are reinstated (a) provisionally, unless and until such Contributor explicitly and finally terminates Your grants, and (b) on an ongoing basis, if such Contributor fails to notify You of the non-compliance by some reasonable means prior to 60 days after You have come back into compliance. Moreover, Your grants from a particular Contributor are reinstated on an ongoing basis if such Contributor notifies You of the non-compliance by some reasonable means, this is the first time You have received notice of non-compliance with this License from such Contributor, and You become compliant prior to 30 days after Your receipt of the notice. 5.2. If You initiate litigation against any entity by asserting a patent infringement claim (excluding declaratory judgment actions, counter-claims, and cross-claims) alleging that a Contributor Version directly or indirectly infringes any patent, then the rights granted to You by any and all Contributors for the Covered Software under Section 2.1 of this License shall terminate. 5.3. In the event of termination under Sections 5.1 or 5.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or Your distributors under this License prior to termination shall survive termination. ************************************************************************ * * * 6. Disclaimer of Warranty * * ------------------------- * * * * Covered Software is provided under this License on an "as is" * * basis, without warranty of any kind, either expressed, implied, or * * statutory, including, without limitation, warranties that the * * Covered Software is free of defects, merchantable, fit for a * * particular purpose or non-infringing. The entire risk as to the * * quality and performance of the Covered Software is with You. * * Should any Covered Software prove defective in any respect, You * * (not any Contributor) assume the cost of any necessary servicing, * * repair, or correction. This disclaimer of warranty constitutes an * * essential part of this License. No use of any Covered Software is * * authorized under this License except under this disclaimer. * * * ************************************************************************ ************************************************************************ * * * 7. Limitation of Liability * * -------------------------- * * * * Under no circumstances and under no legal theory, whether tort * * (including negligence), contract, or otherwise, shall any * * Contributor, or anyone who distributes Covered Software as * * permitted above, be liable to You for any direct, indirect, * * special, incidental, or consequential damages of any character * * including, without limitation, damages for lost profits, loss of * * goodwill, work stoppage, computer failure or malfunction, or any * * and all other commercial damages or losses, even if such party * * shall have been informed of the possibility of such damages. This * * limitation of liability shall not apply to liability for death or * * personal injury resulting from such party's negligence to the * * extent applicable law prohibits such limitation. Some * * jurisdictions do not allow the exclusion or limitation of * * incidental or consequential damages, so this exclusion and * * limitation may not apply to You. * * * ************************************************************************ 8. Litigation ------------- Any litigation relating to this License may be brought only in the courts of a jurisdiction where the defendant maintains its principal place of business and such litigation shall be governed by laws of that jurisdiction, without reference to its conflict-of-law provisions. Nothing in this Section shall prevent a party's ability to bring cross-claims or counter-claims. 9. Miscellaneous ---------------- This License represents the complete agreement concerning the subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not be used to construe this License against a Contributor. 10. Versions of the License --------------------------- 10.1. New Versions Mozilla Foundation is the license steward. Except as provided in Section 10.3, no one other than the license steward has the right to modify or publish new versions of this License. Each version will be given a distinguishing version number. 10.2. Effect of New Versions You may distribute the Covered Software under the terms of the version of the License under which You originally received the Covered Software, or under the terms of any subsequent version published by the license steward. 10.3. Modified Versions If you create software not governed by this License, and you want to create a new license for such software, you may create and use a modified version of this License if you rename the license and remove any references to the name of the license steward (except to note that such modified license differs from this License). 10.4. Distributing Source Code Form that is Incompatible With Secondary Licenses If You choose to distribute Source Code Form that is Incompatible With Secondary Licenses under the terms of this version of the License, the notice described in Exhibit B of this License must be attached. Exhibit A - Source Code Form License Notice ------------------------------------------- This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/. If it is not possible or desirable to put the notice in a particular file, then You may include the notice in a location (such as a LICENSE file in a relevant directory) where a recipient would be likely to look for such a notice. You may add additional accurate notices of copyright ownership. Exhibit B - "Incompatible With Secondary Licenses" Notice --------------------------------------------------------- This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0. ++++++ enigmail-1.9.4.tar.gz -> enigmail-1.9.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/.eslintrc.js new/enigmail/.eslintrc.js --- old/enigmail/.eslintrc.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/.eslintrc.js 2016-08-20 16:02:21.000000000 +0200 @@ -12,14 +12,14 @@ "no-unused-vars": 0, "no-empty": 0, "comma-dangle": 0, - "consistent-return": 2, + "consistent-return": 0, "block-scoped-var": 2, "dot-notation": 2, "no-alert": 2, "no-caller": 2, "no-case-declarations": 2, "no-div-regex": 2, - "no-empty-label": 2, + "no-labels": 2, "no-empty-pattern": 2, "no-eq-null": 2, "no-eval": 2, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/Makefile new/enigmail/package/Makefile --- old/enigmail/package/Makefile 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/Makefile 2016-08-20 16:02:21.000000000 +0200 @@ -23,6 +23,7 @@ armor.jsm \ attachment.jsm \ card.jsm \ + clipboard.jsm \ commandLine.jsm \ configBackup.jsm \ configure.jsm \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/attachment.jsm new/enigmail/package/attachment.jsm --- old/enigmail/package/attachment.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/attachment.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -26,7 +26,7 @@ const args = EnigmailGpg.getStandardArgs(true). concat(EnigmailPassword.command()). - concat(["--list-packets"]); + concat(["--decrypt"]); const listener = EnigmailExecution.newSimpleListener( function _stdin(pipe) { @@ -36,6 +36,8 @@ pipe.close(); }); + listener.stdout = function(data) {}; + const proc = EnigmailExecution.execStart(EnigmailGpgAgent.agentPath, args, false, parent, listener, {}); if (!proc) { @@ -44,9 +46,12 @@ proc.wait(); - const matches = listener.stdoutData.match(/:literal data packet:\r?\n.*name="(.*)",/m); - if (matches && (matches.length > 1)) { - var filename = escape(matches[1]).replace(/%5Cx/g, "%"); + const matches = listener.stderrData.match(/^(\[GNUPG:\] PLAINTEXT [0-9]+ [0-9]+ )(.*)$/m); + if (matches && (matches.length > 2)) { + var filename = matches[2]; + if (filename.indexOf(" ") > 0) { + filename = filename.replace(/ .*$/, ""); + } return EnigmailData.convertToUnicode(unescape(filename), "utf-8"); } else { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/clipboard.jsm new/enigmail/package/clipboard.jsm --- old/enigmail/package/clipboard.jsm 1970-01-01 01:00:00.000000000 +0100 +++ new/enigmail/package/clipboard.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -0,0 +1,108 @@ +/*global Components: false */ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +"use strict"; + +var EXPORTED_SYMBOLS = ["EnigmailClipboard"]; + +// Import the Services module for future use, if we're not in +// a browser window where it's already loaded. +Components.utils.import('resource://gre/modules/Services.jsm'); + +const Ci = Components.interfaces; +const Cc = Components.classes; + +// Create a constructor for the built-in supports-string class. +const nsSupportsString = Components.Constructor("@mozilla.org/supports-string;1", "nsISupportsString"); + +function SupportsString(str) { + // Create an instance of the supports-string class + var res = nsSupportsString(); + + // Store the JavaScript string that we want to wrap in the new nsISupportsString object + res.data = str; + return res; +} + +// Create a constructor for the built-in transferable class +const nsTransferable = Components.Constructor("@mozilla.org/widget/transferable;1", "nsITransferable"); + +// Create a wrapper to construct an nsITransferable instance and set its source to the given window, when necessary +function Transferable(source) { + let res = nsTransferable(); + if ('init' in res) { + // When passed a Window object, find a suitable privacy context for it. + if (source instanceof Ci.nsIDOMWindow) + source = source.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation); + + res.init(source); + } + return res; +} + +var EnigmailClipboard = { + + /** + * Get the content string of a clipboard + * + * @param window : nsIWindow or nsIDOMWindow of caller + * @param clipBoardType: Number - clipboard type according to nsIClipboard + * + * @return String - content of clipBoard + */ + + getClipboardContent: function(window, clipBoardType) { + if (!window) throw "erorr - window must not be null"; + + let clipBoard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); + let data = {}; + let cBoardContent = ""; + + if (clipBoardType !== clipBoard.kSelectionClipboard || clipBoard.supportsSelectionClipboard()) { + try { + let transferable = Transferable(window); + transferable.addDataFlavor("text/unicode"); + clipBoard.getData(transferable, clipBoardType); + let flavour = {}; + let length = {}; + transferable.getAnyTransferData(flavour, data, length); + cBoardContent = data.value.QueryInterface(Ci.nsISupportsString).data; + } + catch (ex) {} + } + return cBoardContent; + }, + + /** + * Set the global (and if available, the selection clipboard) + * + * @param str: String - data to set + * @param clipBoardType: Number - clipboard type according to nsIClipboard. + * If not provided, the global plus the selection clipboard will be used + * + * @return Boolean: true - success / false - failure + */ + setClipboardContent: function(str, clipBoardType) { + let useClipboard = clipBoardType; + if (clipBoardType === undefined) { + useClipboard = Ci.nsIClipboard.kGlobalClipboard; + } + try { + let clipBoard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard); + let clipBoardHlp = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper); + clipBoardHlp.copyStringToClipboard(str, useClipboard); + if (clipBoard.supportsSelectionClipboard() && + (useClipboard === Ci.nsIClipboard.kSelectionClipboard || clipBoardType === undefined)) { + clipBoardHlp.copyStringToClipboard(str, Ci.nsIClipboard.kSelectionClipboard); + } + } + catch (ex) { + return false; + } + return true; + } +}; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/funcs.jsm new/enigmail/package/funcs.jsm --- old/enigmail/package/funcs.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/funcs.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -346,9 +346,10 @@ let a2 = mime2.split(/./); for (let i = 0; i < Math.min(a1.length, a2.length); i++) { - if (Number(mime1[i]) < Number(mime2[i])) return -1; - if (Number(mime1[i]) > Number(mime2[i])) return 1; + if (Number(a1[i]) < Number(a2[i])) return -1; + if (Number(a1[i]) > Number(a2[i])) return 1; } + if (a2.length > a1.length) return -2; if (a2.length < a1.length) return 2; return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/gpgAgent.jsm new/enigmail/package/gpgAgent.jsm --- old/enigmail/package/gpgAgent.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/gpgAgent.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -474,7 +474,7 @@ catch (ex) {} if (!agentPath) { - let gpgPath = gpgPath + "\\pub"; + let gpgPath = "C:\\Program Files\\GnuPG\\pub"; agentPath = EnigmailFiles.resolvePath(agentName, gpgPath, EnigmailOS.isDosLike()); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/install.rdf new/enigmail/package/install.rdf --- old/enigmail/package/install.rdf 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/install.rdf 2016-08-20 16:02:21.000000000 +0200 @@ -5,7 +5,7 @@ <Description about="urn:mozilla:install-manifest"> <em:id>{847b3a00-7ab1-11d4-8f02-006008948af5}</em:id> - <em:version>1.9.4</em:version> + <em:version>1.9.5</em:version> <em:type>2</em:type> <!-- type = extension --> <em:unpack>true</em:unpack> @@ -16,7 +16,7 @@ <Description> <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id> <em:minVersion>38.0</em:minVersion> - <em:maxVersion>50.0</em:maxVersion> + <em:maxVersion>51.0</em:maxVersion> </Description> </em:targetApplication> <em:targetApplication> @@ -24,7 +24,7 @@ <Description> <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id> <em:minVersion>2.35</em:minVersion> - <em:maxVersion>2.47</em:maxVersion> + <em:maxVersion>2.48</em:maxVersion> </Description> </em:targetApplication> <!-- em:targetApplication> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/installGnuPG.jsm new/enigmail/package/installGnuPG.jsm --- old/enigmail/package/installGnuPG.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/installGnuPG.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -1,5 +1,5 @@ /*global Components: false, escape: false, unescape: false, Uint8Array: false */ -/*jshint -W097 */ +/* eslint no-invalid-this: 0 */ /* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this @@ -36,6 +36,7 @@ Cu.import("resource://enigmail/os.jsm"); /*global EnigmailOS: false */ Cu.import("resource://enigmail/app.jsm"); /*global EnigmailApp: false */ Cu.import("resource://enigmail/promise.jsm"); /*global Promise: false */ +Cu.import("resource://enigmail/files.jsm"); /*global EnigmailFiles: false */ const Cc = Components.classes; const Ci = Components.interfaces; @@ -51,13 +52,6 @@ const queryUrl = "https://www.enigmail.net/service/getGnupdDownload.svc"; -function getTempDir() { - let ds = Cc[DIR_SERV_CONTRACTID].getService(); - let dsprops = ds.QueryInterface(Ci.nsIProperties); - let tmpFile = dsprops.get("TmpD", Ci.nsIFile); - - return tmpFile; -} function toHexString(charCode) { return ("0" + charCode.toString(16)).slice(-2); @@ -290,6 +284,44 @@ this.installerFile.remove(false); }, + /** + * Create the gpg4win installer config file + * @return nsIFile - config object file + */ + createGpg4WinCfgFile: function() { + EnigmailLog.DEBUG("installGnuPG.jsm: createGpg4WinCfgFile\n"); + + let tmpFile = EnigmailFiles.getTempDirObj().clone(); + tmpFile.append("gpg4win.ini"); + tmpFile.createUnique(tmpFile.NORMAL_FILE_TYPE, EXEC_FILE_PERMS); + + let dataStr = "[gpg4win]\r\n"; + + let cfgKeys = [ + "inst_gpgol", + "inst_gpgex", + "inst_kleopatra", + "inst_gpa", + "inst_claws_mail", + "inst_compendium", + "inst_desktop", + "inst_quick_launch_bar" + ]; + + // disable optional components by default + for (let i of cfgKeys) { + dataStr += " " + i + " = false\r\n"; + } + + dataStr += " inst_start_menu = true\r\n"; + + if (EnigmailFiles.writeFileContents(tmpFile, dataStr)) { + return tmpFile; + } + + return null; + }, + installWindows: function(deferred) { EnigmailLog.DEBUG("installGnuPG.jsm: installWindows\n"); @@ -312,9 +344,20 @@ } }; + this.gpg4WinCfgFile = this.createGpg4WinCfgFile(); + + let cfgFile = EnigmailFiles.getFilePath(this.gpg4WinCfgFile); + let params = []; + + if (cfgFile) { + if (cfgFile.indexOf('"') >= 0) cfgFile = '"' + cfgFile + '"'; + params.push('/C=' + cfgFile); + } + + EnigmailLog.DEBUG("installGnuPG.jsm: installWindows: executing " + this.installerFile.path + " " + params.join(" ") + "\n"); var proc = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess); proc.init(this.installerFile); - proc.runwAsync([], 0, obs, false); + proc.runwAsync(params, params.length, obs, false); } catch (ex) { deferred.reject("Installer could not be started"); @@ -325,6 +368,7 @@ cleanupWindows: function() { EnigmailLog.DEBUG("installGnuPG.jsm: cleanupWindows - remove package\n"); this.installerFile.remove(false); + if (this.gpg4WinCfgFile) this.gpg4WinCfgFile.remove(false); }, installUnix: function() {}, @@ -364,15 +408,16 @@ let deferred = Promise.defer(); function reqListener() { - if (typeof(on.responseXML) == "object") { - EnigmailLog.DEBUG("installGnuPG.jsm: getDownloadUrl.reqListener: got: " + on.responseText + "\n"); - if (!on.responseXML) { + // "this" is set by the calling XMLHttpRequest + if (typeof(this.responseXML) == "object") { + EnigmailLog.DEBUG("installGnuPG.jsm: getDownloadUrl.reqListener: got: " + this.responseText + "\n"); + if (!this.responseXML) { onError({ type: "Network" }); return; } - let doc = on.responseXML.firstChild; + let doc = this.responseXML.firstChild; self.url = unescape(doc.getAttribute("url")); self.hash = sanitizeHash(doc.getAttribute("hash")); self.command = sanitizeFileName(doc.getAttribute("command")); @@ -458,10 +503,8 @@ self.progressListener.onDownloaded(); try { - // this line used to read: - // performInstall(this.response).then(function _f() { performCleanup(); }); - // but since this.response is never actually set anywhere, it should always be null - performInstall(null).then(function _f() { + // "this" is set by the calling XMLHttpRequest + performInstall(this.response).then(function _f() { performCleanup(); }); } @@ -480,7 +523,7 @@ try { var flags = 0x02 | 0x08 | 0x20; var fileOutStream = Cc[NS_LOCALFILEOUTPUTSTREAM_CONTRACTID].createInstance(Ci.nsIFileOutputStream); - self.installerFile = getTempDir(); + self.installerFile = EnigmailFiles.getTempDirObj().clone(); switch (EnigmailOS.getOS()) { case "Darwin": diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/key.jsm new/enigmail/package/key.jsm --- old/enigmail/package/key.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/key.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -1,4 +1,4 @@ -/*global Components: false */ +/*global Components: false, Math: false */ /*jshint -W097 */ /* * This Source Code Form is subject to the terms of the Mozilla Public @@ -374,6 +374,35 @@ getKeyListFromKeyFile: function(path, errorMsgObj) { var contents = EnigmailFiles.readFile(path); return this.getKeyListFromKeyBlock(contents, errorMsgObj); + }, + + + /** + * Compare 2 KeyIds of possible different length (short, long, FPR-length, with or without prefixed + * 0x are accepted) + * + * @param keyId1 string + * @param keyId2 string + * + * @return true or false, given the comparison of the last minimum-length characters. + */ + compareKeyIds: function(keyId1, keyId2) { + var keyId1Raw = keyId1.replace(/^0x/, "").toUpperCase(); + var keyId2Raw = keyId2.replace(/^0x/, "").toUpperCase(); + + var minlength = Math.min(keyId1Raw.length, keyId2Raw.length); + + if (minlength < keyId1Raw.length) { + // Limit keyId1 to minlength + keyId1Raw = keyId1Raw.substr(-minlength, minlength); + } + + if (minlength < keyId2Raw.length) { + // Limit keyId2 to minlength + keyId2Raw = keyId2Raw.substr(-minlength, minlength); + } + + return (keyId1Raw === keyId2Raw); } }; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/keyRing.jsm new/enigmail/package/keyRing.jsm --- old/enigmail/package/keyRing.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/keyRing.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -203,13 +203,14 @@ /** * get 1st key object that matches a given key ID or subkey ID * - * @param keyId - String: key Id with 16 characters (preferred) or 8 characters), - * or fingerprint (40 or 32 characters). - * Optionally preceeded with "0x" + * @param keyId - String: key Id with 16 characters (preferred) or 8 characters), + * or fingerprint (40 or 32 characters). + * Optionally preceeded with "0x" + * @param noLoadKeys - Boolean [optional]: do not try to load the key list first * * @return Object - found KeyObject or null if key not found */ - getKeyById: function(keyId) { + getKeyById: function(keyId, noLoadKeys) { EnigmailLog.DEBUG("keyRing.jsm: getKeyById: " + keyId + "\n"); let s; @@ -217,7 +218,9 @@ keyId = keyId.substr(2); } - this.getAllKeys(); // ensure keylist is loaded; + if (!noLoadKeys) { + this.getAllKeys(); // ensure keylist is loaded; + } let keyObj = gKeyIndex[keyId]; @@ -1390,12 +1393,13 @@ } /** - * Create a list of objects representing the keys in a key list + * Create a list of objects representing the keys in a key list. + * The internal cache is first deleted. * - * @keyListString: array of |string| formatted output from GnuPG for key listing - * @keyListObj: |object| holding the resulting key list: - * obj.keyList: Array holding key objects - * obj.keySortList: Array holding values to make sorting easier + * @param keyListString: array of |string| formatted output from GnuPG for key listing + * @param keyListObj: |object| holding the resulting key list: + * obj.keyList: Array holding key objects + * obj.keySortList: Array holding values to make sorting easier * * no return value */ @@ -1404,6 +1408,20 @@ keyListObj.keySortList = []; keyListObj.trustModel = "?"; + appendKeyItems(keyListString, keyListObj); +} + +/** + * Append key objects to a given key cache + * + * @param keyListString: array of |string| formatted output from GnuPG for key listing + * @param keyListObj: |object| holding the resulting key list + * obj.keyList: Array holding key objects + * obj.keySortList: Array holding values to make sorting easier + * + * no return value + */ +function appendKeyItems(keyListString, keyListObj) { let keyObj = {}; let uatNum = 0; // counter for photos (counts per key) let numKeys = 0; @@ -1504,6 +1522,35 @@ } } +/** + * Handle secret keys for which gpg 2.0 does not create a public key record + */ +function appendUnkownSecretKey(keyId, aKeyList, startIndex, endIndex) { + EnigmailLog.DEBUG("keyRing.jsm: appendUnkownSecretKey: keyId: " + keyId + "\n"); + + let keyListStr = []; + for (let j = startIndex; j < endIndex; j++) { + keyListStr.push(aKeyList[j]); + } + + // make the listing a "public" key + keyListStr[0] = keyListStr[0].replace(/^sec/, "pub"); + + appendKeyItems(keyListStr, gKeyListObj); + EnigmailKeyRing.rebuildKeyIndex(); + + let k = EnigmailKeyRing.getKeyById(keyId, true); + + if (k) { + k.secretAvailable = true; + k.keyUseFor = ""; + k.keyTrust = "i"; + k.ownerTrust = "i"; + } + +} + + function createAndSortKeyList(aGpgUserList, aGpgSecretsList, sortColumn, sortDirection) { EnigmailLog.DEBUG("keyRing.jsm: createAndSortKeyList()\n"); @@ -1517,19 +1564,37 @@ EnigmailKeyRing.rebuildKeyIndex(); + let startRow = -1; + let lastKeyId = ""; // search and mark keys that have secret keys for (let i = 0; i < aGpgSecretsList.length; i++) { let listRow = aGpgSecretsList[i].split(/:/); if (listRow.length >= 0) { if (listRow[ENTRY_ID] == "sec") { - let k = EnigmailKeyRing.getKeyById(listRow[KEY_ID]); + + if (startRow >= 0) { + // handle secret key not found on public key ring + appendUnkownSecretKey(lastKeyId, aGpgSecretsList, startRow, i); + } + startRow = -1; + + let k = EnigmailKeyRing.getKeyById(listRow[KEY_ID], true); if (k && typeof(k) === "object") { k.secretAvailable = true; } + else { + startRow = i; + lastKeyId = listRow[KEY_ID]; + } } } } + if (startRow >= 0) { + // handle secret key not found on public key ring + appendUnkownSecretKey(lastKeyId, aGpgSecretsList, startRow, aGpgSecretsList.length); + } + gKeyListObj.keySortList.sort(getSortFunction(sortColumn.toLowerCase(), gKeyListObj, sortDirection)); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/mime.jsm new/enigmail/package/mime.jsm --- old/enigmail/package/mime.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/mime.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -57,6 +57,29 @@ }, /*** + * determine the "protocol" part of a mail content type. + * + * @contentTypeStr: the string containing all parts of a content-type. + * (e.g. multipart/signed; protocol="xyz") --> returns "xyz" + * + * @return: String containing the protocol parameter; or null + */ + + getProtocol: function(contentTypeStr) { + contentTypeStr = contentTypeStr.replace(/[\r\n]/g, ""); + let proto = ""; + let ct = contentTypeStr.split(/;/); + for (let i = 0; i < ct.length; i++) { + if (ct[i].search(/[ \t]*protocol[ \t]*=/i) >= 0) { + proto = ct[i]; + break; + } + } + proto = proto.replace(/\s*protocol\s*=/i, "").replace(/[\'\"]/g, ""); + return proto; + }, + + /*** * determine the "charset" part of a mail content type. * * @contentTypeStr: the string containing all parts of a content-type. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/mimeDecrypt.jsm new/enigmail/package/mimeDecrypt.jsm --- old/enigmail/package/mimeDecrypt.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/mimeDecrypt.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -56,6 +56,7 @@ this.statusStr = ""; this.outQueue = ""; this.dataLength = 0; + this.bytesWritten = 0; this.mimePartCount = 0; this.headerMode = 0; this.xferEncoding = ENCODING_DEFAULT; @@ -105,6 +106,7 @@ this.dataLength = 0; this.decryptedData = ""; this.mimePartCount = 0; + this.bytesWritten = 0; this.matchedPgpDelimiter = 0; this.outQueue = ""; this.statusStr = ""; @@ -180,17 +182,6 @@ this.outQueue += str; }, - flushInput: function() { - LOCAL_DEBUG("mimeDecrypt.jsm: flushInput: " + this.outQueue.length + " bytes\n"); - if (!this.pipe) { - LOCAL_DEBUG("mimeDecrypt.jsm: flushInput: no pipe\n"); - return; - } - - this.pipe.write(this.outQueue); - this.outQueue = ""; - }, - onStopRequest: function(request, win, status) { LOCAL_DEBUG("mimeDecrypt.jsm: onStopRequest\n"); --gNumProc; @@ -286,13 +277,21 @@ statusFlagsObj, errorMsgObj, null, maxOutput); if (!this.proc) return; - this.flushInput(); - if (!this.pipe) { - this.closePipe = true; + if (this.bytesWritten === 0 && this.outQueue.length === 0) { + // write something to gpg such that the process doesn't get stuck + this.outQueue = "NO DATA\n"; } - else + + if (this.pipe) { + this.pipe.write(this.outQueue); + this.bytesWritten += this.outQueue.length; + this.outQueue = ""; this.pipe.close(); + } + else { + this.closePipe = true; + } this.proc.wait(); @@ -307,6 +306,9 @@ this.displayStatus(); + this.returnData(this.decryptedData); + this.decryptedData = ""; + EnigmailLog.DEBUG("mimeDecrypt.jsm: onStopRequest: process terminated\n"); // always log this one this.proc = null; }, @@ -353,6 +355,7 @@ LOCAL_DEBUG("mimeDecrypt.jsm: stdin\n"); if (this.outQueue.length > 0) { pipe.write(this.outQueue); + this.bytesWritten += this.outQueue.length; this.outQueue = ""; if (this.closePipe) pipe.close(); } @@ -398,32 +401,60 @@ LOCAL_DEBUG("mimeDecrypt.jsm: done: adding multipart/mixed around " + hdr[j] + "\n"); let wrapper = EnigmailMime.createBoundary(); - this.decryptedData = 'Content-Type: multipart/mixed; boundary="' + wrapper + '"\r\n\r\n' + + this.decryptedData = 'Content-Type: multipart/mixed; boundary="' + wrapper + '"\r\n' + + 'Content-Disposition: inline\r\n\r\n' + '--' + wrapper + '\r\n' + - this.decryptedData + + this.decryptedData + '\r\n' + '--' + wrapper + '--\r\n'; break; } } } - this.returnData(this.decryptedData); - - this.decryptedData = ""; this.exitCode = exitCode; }, + extractContentType: function(data) { + let i = data.search(/\n\r?\n/); + if (i <= 0) return null; + + let headers = Cc["@mozilla.org/messenger/mimeheaders;1"].createInstance(Ci.nsIMimeHeaders); + headers.initialize(data.substr(0, i)); + return headers.extractHeader("content-type", false); + }, + // return data to libMime returnData: function(data) { + EnigmailLog.DEBUG("mimeDecrypt.jsm: returnData: " + data.length + " bytes\n"); gConv.setData(data, data.length); + + let proto = null; + let ct = this.extractContentType(data); + if (ct && ct.search(/multipart\/signed/i) >= 0) { + proto = EnigmailMime.getProtocol(ct); + } + try { - this.mimeSvc.onStartRequest(null, null); - this.mimeSvc.onDataAvailable(null, null, gConv, 0, data.length); - this.mimeSvc.onStopRequest(null, null, 0); + if (proto && proto.search(/application\/(pgp|pkcs7|x-pkcs7)-signature/i) >= 0) { + EnigmailLog.DEBUG("mimeDecrypt.jsm: returnData: using direct verification\n"); + this.mimeSvc.contentType = ct; + this.mimeSvc.mimePart = this.mimeSvc.mimePart + ".1"; + let proto = EnigmailMime.getProtocol(ct); + let veri = EnigmailVerify.newVerifier(proto); + veri.onStartRequest(this.mimeSvc, this.uri); + veri.onDataAvailable(null, null, gConv, 0, data.length + 1); + veri.onStopRequest(null, null, 0); + } + else { + gConv.setData(data, data.length); + this.mimeSvc.onStartRequest(null, null); + this.mimeSvc.onDataAvailable(null, null, gConv, 0, data.length); + this.mimeSvc.onStopRequest(null, null, 0); + } } catch (ex) { - // EnigmailLog.ERROR("mimeDecrypt.jsm: returnData(): mimeSvc.onDataAvailable failed:\n" + ex.toString()); + EnigmailLog.ERROR("mimeDecrypt.jsm: returnData(): mimeSvc.onDataAvailable failed:\n" + ex.toString()); } }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/mimeEncrypt.js new/enigmail/package/mimeEncrypt.js --- old/enigmail/package/mimeEncrypt.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/mimeEncrypt.js 2016-08-20 16:02:21.000000000 +0200 @@ -288,15 +288,15 @@ } } - let w = 'Content-Type: multipart/mixed; boundary="' + this.encHeader + '"\r\n' + allHdr + '\r\n' + + let w = 'Content-Type: multipart/mixed; boundary="' + this.encHeader + '";\r\n' + + ' protected-headers="v1"\r\n' + + allHdr + '\r\n' + "--" + this.encHeader + "\r\n"; if (this.cryptoMode == MIME_ENCRYPTED && this.enigSecurityInfo.sendFlags & Ci.nsIEnigmail.ENCRYPT_HEADERS) { - w += 'Content-Type: text/rfc822-headers; charset="utf-8";\r\n' + - ' protected-headers="v1"\r\n' + + w += 'Content-Type: text/rfc822-headers; protected-headers="v1"\r\n' + 'Content-Disposition: inline\r\n' + - 'Content-Transfer-Encoding: base64\r\n\r\n' + - EnigmailData.encodeBase64(visibleHdr) + + visibleHdr + "\r\n--" + this.encHeader + "\r\n"; } this.writeToPipe(w); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/package/mimeVerify.jsm new/enigmail/package/mimeVerify.jsm --- old/enigmail/package/mimeVerify.jsm 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/package/mimeVerify.jsm 2016-08-20 16:02:21.000000000 +0200 @@ -29,6 +29,7 @@ const Ci = Components.interfaces; const APPSHELL_MEDIATOR_CONTRACTID = "@mozilla.org/appshell/window-mediator;1"; +const PGPMIME_PROTO = "application/pgp-signature"; const maxBufferLen = 102400; @@ -38,7 +39,7 @@ // MimeVerify Constructor function MimeVerify(protocol) { if (!protocol) { - protocol = "application/pgp-signature"; + protocol = PGPMIME_PROTO; } this.protocol = protocol; @@ -279,7 +280,7 @@ if (this.readMode === 3) { // signature data - if (this.protocol === "application/pgp-signature") { + if (this.protocol === PGPMIME_PROTO) { let xferEnc = this.getContentTransferEncoding(); if (xferEnc.search(/base64/i) >= 0) { let bound = this.getBodyPart(); @@ -373,7 +374,7 @@ this.protectedHeaders = EnigmailMime.extractProtectedHeaders(this.signedData); - if (this.protectedHeaders && this.protectedHeaders.startPos >= 0 && this.protectedHeaders > this.protectedHeaders.startPos) { + if (this.protectedHeaders && this.protectedHeaders.startPos >= 0 && this.protectedHeaders.endPos > this.protectedHeaders.startPos) { let r = this.signedData.substr(0, this.protectedHeaders.startPos) + this.signedData.substr(this.protectedHeaders.endPos); this.returnData(r); } @@ -441,32 +442,35 @@ } } - var windowManager = Cc[APPSHELL_MEDIATOR_CONTRACTID].getService(Ci.nsIWindowMediator); - var win = windowManager.getMostRecentWindow(null); - - // create temp file holding signature data - this.sigFile = EnigmailFiles.getTempDirObj(); - this.sigFile.append("data.sig"); - this.sigFile.createUnique(this.sigFile.NORMAL_FILE_TYPE, 0x180); - EnigmailFiles.writeFileContents(this.sigFile, this.sigData, 0x180); - - var statusFlagsObj = {}; - var errorMsgObj = {}; - - this.proc = EnigmailDecryption.decryptMessageStart(win, true, true, this, - statusFlagsObj, errorMsgObj, - EnigmailFiles.getEscapedFilename(EnigmailFiles.getFilePath(this.sigFile))); - - if (this.pipe) { - EnigmailLog.DEBUG("Closing pipe\n"); // always log this one - this.pipe.close(); + if (this.protocol === PGPMIME_PROTO) { + var windowManager = Cc[APPSHELL_MEDIATOR_CONTRACTID].getService(Ci.nsIWindowMediator); + var win = windowManager.getMostRecentWindow(null); + + // create temp file holding signature data + this.sigFile = EnigmailFiles.getTempDirObj(); + this.sigFile.append("data.sig"); + this.sigFile.createUnique(this.sigFile.NORMAL_FILE_TYPE, 0x180); + EnigmailFiles.writeFileContents(this.sigFile, this.sigData, 0x180); + + var statusFlagsObj = {}; + var errorMsgObj = {}; + + this.proc = EnigmailDecryption.decryptMessageStart(win, true, true, this, + statusFlagsObj, errorMsgObj, + EnigmailFiles.getEscapedFilename(EnigmailFiles.getFilePath(this.sigFile))); + + if (this.pipe) { + EnigmailLog.DEBUG("mimeVerify.jsm: onStopRequest: closing pipe\n"); // always log this one + this.pipe.close(); + } + else + this.closePipe = true; } - else - this.closePipe = true; }, // return data to libMime returnData: function(data) { + EnigmailLog.DEBUG("mimeVerify.jsm: returnData: " + data.length + " bytes\n"); let m = data.match(/^(content-type: +)([\w\/]+)/im); if (m && m.length >= 3) { @@ -474,7 +478,8 @@ if (contentType.search(/^text/i) === 0) { // add multipart/mixed boundary to work around TB bug (empty forwarded message) let bound = EnigmailMime.createBoundary(); - data = 'Content-Type: multipart/mixed; boundary="' + bound + '"\n\n--' + + data = 'Content-Type: multipart/mixed; boundary="' + bound + '"\n' + + 'Content-Disposition: inline\n\n--' + bound + '\n' + data + '\n--' + bound + '--\n'; @@ -558,7 +563,7 @@ let headerSink = this.msgWindow.msgHeaderSink.securityInfo.QueryInterface(Ci.nsIEnigMimeHeaderSink); if (this.protectedHeaders) { - headerSink.modifyMessageHeaders(this.uri, JSON.stringify(this.protectedHeaders.newHeaders)); + headerSink.modifyMessageHeaders(this.uri, JSON.stringify(this.protectedHeaders.newHeaders), this.mimePartNumber); } if (headerSink) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/thunderbird-enigmail.metainfo.xml new/enigmail/thunderbird-enigmail.metainfo.xml --- old/enigmail/thunderbird-enigmail.metainfo.xml 1970-01-01 01:00:00.000000000 +0100 +++ new/enigmail/thunderbird-enigmail.metainfo.xml 2016-08-20 16:02:21.000000000 +0200 @@ -0,0 +1,17 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + AppStream metadata file for Linux distributions. + See spec at: http://www.freedesktop.org/software/appstream/docs/sect-Quickstart-Addons.html +--> +<component type="addon"> + <id>thunderbird-enigmail</id> + <extends>mozilla-thunderbird.desktop</extends> + <name>Enigmail</name> + <summary> + OpenPGP message encryption and authentication for Thunderbird and SeaMonkey. + </summary> + <url type="homepage">https://www.enigmail.net</url> + <metadata_license>CC0-1.0</metadata_license> + <project_license>MPL-2.0</project_license> + <updatecontact>[email protected]</updatecontact> +</component> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailAlertDlg.js new/enigmail/ui/content/enigmailAlertDlg.js --- old/enigmail/ui/content/enigmailAlertDlg.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailAlertDlg.js 2016-08-20 16:02:21.000000000 +0200 @@ -12,6 +12,9 @@ const Cc = Components.classes; const Ci = Components.interfaces; +Components.utils.import("resource://enigmail/clipboard.jsm"); /*global EnigmailClipboard: false */ + + EnigInitCommon("enigmailAlertDlg"); function onLoad() { @@ -151,8 +154,7 @@ function copyToClipbrd() { let s = window.getSelection().toString(); - let clip = Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper); - clip.copyString(s); + EnigmailClipboard.setClipboardContent(s); } function onKeyPress(event) { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailCommon.js new/enigmail/ui/content/enigmailCommon.js --- old/enigmail/ui/content/enigmailCommon.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailCommon.js 2016-08-20 16:02:21.000000000 +0200 @@ -57,9 +57,6 @@ const ENIG_MIME_CONTRACTID = "@mozilla.org/mime;1"; const ENIG_WMEDIATOR_CONTRACTID = "@mozilla.org/rdf/datasource;1?name=window-mediator"; const ENIG_ASS_CONTRACTID = "@mozilla.org/appshell/appShellService;1"; -const ENIG_CLIPBOARD_CONTRACTID = "@mozilla.org/widget/clipboard;1"; -const ENIG_CLIPBOARD_HELPER_CONTRACTID = "@mozilla.org/widget/clipboardhelper;1"; -const ENIG_TRANSFERABLE_CONTRACTID = "@mozilla.org/widget/transferable;1"; const ENIG_LOCALE_SVC_CONTRACTID = "@mozilla.org/intl/nslocaleservice;1"; const ENIG_DATE_FORMAT_CONTRACTID = "@mozilla.org/intl/scriptabledateformat;1"; const ENIG_ACCOUNT_MANAGER_CONTRACTID = "@mozilla.org/messenger/account-manager;1"; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailKeyManager.js new/enigmail/ui/content/enigmailKeyManager.js --- old/enigmail/ui/content/enigmailKeyManager.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailKeyManager.js 2016-08-20 16:02:21.000000000 +0200 @@ -15,7 +15,6 @@ /* global EnigEditKeyTrust: false, EnigEditKeyExpiry: false, EnigSignKey: false, EnigRevokeKey: false, EnigCreateRevokeCert: false */ /* global EnigLongAlert: false, EnigChangeKeyPwd: false, EnigDownloadKeys: false, EnigSetPref: false, EnigGetTrustCode: false */ /* global ENIG_KEY_DISABLED: false, ENIG_KEY_NOT_VALID: false, ENIG_IOSERVICE_CONTRACTID: false, ENIG_LOCAL_FILE_CONTRACTID: false */ -/* global ENIG_CLIPBOARD_CONTRACTID: false, ENIG_TRANSFERABLE_CONTRACTID: false, ENIG_CLIPBOARD_HELPER_CONTRACTID: false */ // imported packages /* global EnigmailLog: false, EnigmailEvents: false, EnigmailKeyRing: false, EnigmailWindows: false, EnigmailKeyEditor: false */ @@ -28,7 +27,8 @@ const Ci = Components.interfaces; const Cu = Components.utils; -Components.utils.import("resource://enigmail/streams.jsm"); /*global EnigmailStreams: false */ +Cu.import("resource://enigmail/streams.jsm"); /*global EnigmailStreams: false */ +Cu.import("resource://enigmail/clipboard.jsm"); /*global EnigmailClipboard: false */ const INPUT = 0; @@ -990,22 +990,7 @@ function enigGetClipboard() { - EnigmailLog.DEBUG("enigmailKeyManager.js: enigGetClipboard:\n"); - var cBoardContent = ""; - var clipBoard = Cc[ENIG_CLIPBOARD_CONTRACTID].getService(Ci.nsIClipboard); - try { - var transferable = Cc[ENIG_TRANSFERABLE_CONTRACTID].createInstance(Ci.nsITransferable); - transferable.addDataFlavor("text/unicode"); - clipBoard.getData(transferable, clipBoard.kGlobalClipboard); - var flavour = {}; - var data = {}; - var length = {}; - transferable.getAnyTransferData(flavour, data, length); - cBoardContent = data.value.QueryInterface(Ci.nsISupportsString).data; - EnigmailLog.DEBUG("enigmailKeyManager.js: enigGetClipboard: got data\n"); - } - catch (ex) {} - return cBoardContent; + return EnigmailClipboard.getClipboardContent(window, Ci.nsIClipboard.kGlobalClipboard); } function enigmailImportFromClipbrd() { @@ -1066,20 +1051,13 @@ EnigAlert(EnigGetString("copyToClipbrdFailed") + "\n\n" + errorMsgObj.value); return; } - var clipBoard = Cc[ENIG_CLIPBOARD_CONTRACTID].getService(Ci.nsIClipboard); - try { - let clipBoardHlp = Cc[ENIG_CLIPBOARD_HELPER_CONTRACTID].getService(Ci.nsIClipboardHelper); - clipBoardHlp.copyStringToClipboard(keyData, clipBoard.kGlobalClipboard); - if (clipBoard.supportsSelectionClipboard()) { - clipBoardHlp.copyStringToClipboard(keyData, clipBoard.kSelectionClipboard); - } - EnigmailLog.DEBUG("enigmailKeyManager.js: enigmailImportFromClipbrd: got data from clipboard"); + if (EnigmailClipboard.setClipboardContent(keyData)) { + EnigmailLog.DEBUG("enigmailKeyManager.js: enigmailImportFromClipbrd: set clipboard data"); EnigAlert(EnigGetString("copyToClipbrdOK")); } - catch (ex) { + else { EnigAlert(EnigGetString("copyToClipbrdFailed")); } - } function enigmailSearchKey() { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailKeySelection.js new/enigmail/ui/content/enigmailKeySelection.js --- old/enigmail/ui/content/enigmailKeySelection.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailKeySelection.js 2016-08-20 16:02:21.000000000 +0200 @@ -17,6 +17,7 @@ // Initialize enigmailCommon EnigInitCommon("enigmailKeySelection"); Components.utils.import("resource://enigmail/funcs.jsm"); /* global EnigmailFuncs: false */ +Components.utils.import("resource://enigmail/key.jsm"); /*global EnigmailKey: false */ const INPUT = 0; const RESULT = 1; @@ -310,6 +311,7 @@ var i; + var j; var toKeys = ""; try { if (typeof(window.arguments[INPUT].toKeys) == "string") { @@ -389,6 +391,8 @@ // work on key obj + var toKeyList = toKeys.split(/[, ]+/); + aUserList[i].activeState = (gAllowExpired ? 0 : 2); // default: not activated/activateable if (aUserList[i].keyTrust != KEY_IS_GROUP) { // handling of "normal" keys @@ -425,7 +429,14 @@ aUserList[i].activeState = 0; } if (aUserList[i].activeState === 0 && toKeys.length > 0) { - aUserList[i].activeState = (toKeys.indexOf("0x" + aUserList[i].keyId) >= 0 ? 1 : 0); + // Now loop through toKeyList and search for matching keyIds + for (j = 0; j < toKeyList.length; j++) { + if (toKeyList[j].length > 0) { + if (EnigmailKey.compareKeyIds(aUserList[i].keyId, toKeyList[j])) { + aUserList[i].activeState = 1; + } + } + } } } } @@ -466,11 +477,7 @@ } } catch (ex) { - EnigmailLog.ERROR("enigmailKeySelection.js: ERROR in buildList:\n"); - EnigmailLog.ERROR(" userId=" + aUserList[i].userId + " expiry=" + aUserList[i].expiryTime + "\n"); - if ((typeof user) == "number" && (typeof aUserList[i].userIds[user].userId) == "string") { - EnigmailLog.ERROR(" subUserId=" + aUserList[i].userIds[user].userId + "\n"); - } + EnigmailLog.ERROR("enigmailKeySelection.js: ERROR in buildList: " + ex.toString() + "\n" + ex.stack + "\n"); } // sort items according to sorting criterion @@ -533,7 +540,9 @@ if (toAddrList[i].length > 0) { let found = false; for (j = 0; j < aValidUsers.length; j++) { + EnigmailLog.DEBUG("enigmailKeySelection.js: buildNotFoundKeys: comparing aValidUsers member " + aValidUsers[j].toLowerCase() + " and toAddrList member " + toAddrList[i].toLowerCase() + "\n"); if (aValidUsers[j].toLowerCase() == toAddrList[i].toLowerCase()) { + EnigmailLog.DEBUG("enigmailKeySelection.js: buildNotFoundKeys: aValidUsers member matches toAddrList member...\n"); found = true; break; // the inner loop } @@ -549,7 +558,9 @@ if (toKeyList[i].length > 0) { let found = false; for (j = 0; j < aUserList.length; j++) { - if (aUserList[j].valid && "0x" + aUserList[j].keyId == toKeyList[i]) { + EnigmailLog.DEBUG("enigmailKeySelection.js: buildNotFoundKeys: comparing toKeyList member " + toKeyList[i] + " and aUserList member 0x" + aUserList[j].keyId + "\n"); + if (aUserList[j].valid && EnigmailKey.compareKeyIds(aUserList[j].keyId, toKeyList[i])) { + EnigmailLog.DEBUG("enigmailKeySelection.js: buildNotFoundKeys: aUserList member is valid and key Id matches...\n"); found = true; break; // the inner loop } @@ -933,6 +944,6 @@ } finally { // search for last ocurrence of < > - return uid.replace(/(.*)(<)([^<> ]+)(>[^<>]*)$/, "$3").toLowerCase(); + return uid.replace(/(.*)(<)([^<> ]+)(>[^<>]*)$/, "$3").toLowerCase(); // eslint-disable-line no-unsafe-finally } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailMsgComposeOverlay.js new/enigmail/ui/content/enigmailMsgComposeOverlay.js --- old/enigmail/ui/content/enigmailMsgComposeOverlay.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailMsgComposeOverlay.js 2016-08-20 16:02:21.000000000 +0200 @@ -35,6 +35,7 @@ Components.utils.import("resource://enigmail/constants.jsm"); /*global EnigmailConstants: false */ Components.utils.import("resource://enigmail/passwords.jsm"); /*global EnigmailPassword: false */ Components.utils.import("resource://enigmail/rules.jsm"); /*global EnigmailRules: false */ +Components.utils.import("resource://enigmail/clipboard.jsm"); /*global EnigmailClipboard: false */ try { Components.utils.import("resource:///modules/MailUtils.js"); /*global MailUtils: false */ @@ -4140,17 +4141,7 @@ var data; if (clipBoard.supportsSelectionClipboard()) { // get the clipboard contents for selected text (X11) - try { - var transferable = Components.classes["@mozilla.org/widget/transferable;1"]. - createInstance(Components.interfaces.nsITransferable); - transferable.addDataFlavor("text/unicode"); - clipBoard.getData(transferable, clipBoard.kSelectionClipboard); - var flavour = {}; - data = {}; - var length = {}; - transferable.getAnyTransferData(flavour, data, length); - } - catch (ex) {} + data = EnigmailClipboard.getClipboardContent(window, Components.interfaces.nsIClipboard.kSelectionClipboard); } // Replace encrypted quote with decrypted quote (destroys selection clipboard on X11) @@ -4175,14 +4166,8 @@ this.editorInsertText(tail); if (clipBoard.supportsSelectionClipboard()) { - try { - // restore the clipboard contents for selected text (X11) - var pasteClipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"]. - getService(Components.interfaces.nsIClipboardHelper); - data = data.value.QueryInterface(Components.interfaces.nsISupportsString).data; - pasteClipboard.copyStringToClipboard(data, clipBoard.kSelectionClipboard); - } - catch (ex) {} + // restore the clipboard contents for selected text (X11) + EnigmailClipboard.setClipboardContent(data, clipBoard.kSelectionClipboard); } if (interactive) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/ui/content/enigmailMsgHdrViewOverlay.js new/enigmail/ui/content/enigmailMsgHdrViewOverlay.js --- old/enigmail/ui/content/enigmailMsgHdrViewOverlay.js 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/ui/content/enigmailMsgHdrViewOverlay.js 2016-08-20 16:02:21.000000000 +0200 @@ -29,6 +29,7 @@ Components.utils.import("resource://enigmail/uris.jsm"); /*global EnigmailURIs: false */ Components.utils.import("resource://enigmail/constants.jsm"); /*global EnigmailConstants: false */ Components.utils.import("resource://enigmail/data.jsm"); /*global EnigmailData: false */ +Components.utils.import("resource://enigmail/clipboard.jsm"); /*global EnigmailClipboard: false */ if (!Enigmail) var Enigmail = {}; @@ -704,8 +705,7 @@ copyStatusInfo: function() { if (Enigmail.msg.securityInfo) { - var clipHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].createInstance(Components.interfaces.nsIClipboardHelper); - clipHelper.copyString(Enigmail.msg.securityInfo.statusInfo); + EnigmailClipboard.setClipboardContent(Enigmail.msg.securityInfo.statusInfo); } }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/enigmail/util/genxpi new/enigmail/util/genxpi --- old/enigmail/util/genxpi 2016-07-04 17:34:04.000000000 +0200 +++ new/enigmail/util/genxpi 2016-08-20 16:02:21.000000000 +0200 @@ -71,6 +71,7 @@ modules/armor.jsm \ modules/attachment.jsm \ modules/card.jsm \ + modules/clipboard.jsm \ modules/commandLine.jsm \ modules/configure.jsm \ modules/constants.jsm \
