[git] GPGME - branch, javascript-binding, updated. gpgme-1.11.1-113-g6d72013
by Maximilian Krambach
cvs at cvs.gnupg.org
Tue Aug 21 15:26:51 CEST 2018
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".
The branch, javascript-binding has been updated
via 6d720137dd9564931bf313a7e7078e63fb00287c (commit)
from 9dd6c67cd5ae8bf394c4c257d6d16907018761c2 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6d720137dd9564931bf313a7e7078e63fb00287c
Author: Maximilian Krambach <maximilian.krambach at intevation.de>
Date: Tue Aug 21 15:26:17 2018 +0200
js: update decrypt/verify results
--
* src/gpgmejs.js: Decrypt now parses additional optional dec_info
information, as well as any verify information, if present
* src/permittedOperations: Now decrypt also expect the new return
object dec_inf (containing info such as is_mime and file_name)
diff --git a/lang/js/BrowserTestExtension/tests/decryptTest.js b/lang/js/BrowserTestExtension/tests/decryptTest.js
index a3f48da..ea88749 100644
--- a/lang/js/BrowserTestExtension/tests/decryptTest.js
+++ b/lang/js/BrowserTestExtension/tests/decryptTest.js
@@ -59,4 +59,20 @@ describe('Decryption', function () {
});
});
}).timeout(5000);
+
+
+ it('decrypt/verify operations return proper information', function (done){
+ const data = inputvalues.encryptSignedMessage;
+ context.decrypt(data).then(function (result){
+ expect(result).to.be.an('object');
+ expect(result.signatures).to.be.an('object');
+ expect(result.signatures.all_valid).to.be.true;
+ expect(result.signatures.count).to.equal(1);
+ expect(result.signatures.signatures.good).to.be.an('array');
+ expect(
+ result.signatures.signatures.good[0].fingerprint).to.equal(
+ good_fpr);
+ done();
+ });
+ });
});
\ No newline at end of file
diff --git a/lang/js/BrowserTestExtension/tests/inputvalues.js b/lang/js/BrowserTestExtension/tests/inputvalues.js
index f84ac95..5c2abf3 100644
--- a/lang/js/BrowserTestExtension/tests/inputvalues.js
+++ b/lang/js/BrowserTestExtension/tests/inputvalues.js
@@ -86,9 +86,27 @@ const inputvalues = {// eslint-disable-line no-unused-vars
'CfhY40nMXSYdfl8mDOhvnKcCvy8qxetFv9uCX06OqepAamu/bvxslrzocRyJ/eq0\n' +
'T2JfzEN+E7Y3PB8UwLgp/ZRmG8zRrQ==\n' +
'=ioB6\n' +
- '-----END PGP SIGNATURE-----\n',
+ '-----END PGP SIGNATURE-----\n'
},
-
+ encryptSignedMessage: '-----BEGIN PGP MESSAGE-----\n'+
+ '\n'+
+ 'hQEMA6B8jfIUScGEAQf/bmQ+xNMGTjPvQCktkxR4Svt2dVNVdSzKsCmvSv24QOQF\n'+
+ 'yBMK5w51S/6DTdiZI12IYD7hjvkr9NqxXXupjrVKwqEVpg4Pkwckac0OcElJIBsL\n'+
+ '3htr4iYsr8dhSgSS4BO0azcu4wZQTXy5v2P7yYPECMEagNEXnW+tE7sHLCq8Ysqz\n'+
+ 'LVxG0R0IUijKeEd3xQC2Tt20e1Z1j5tnqaPhE/9Smqf5OjSUDqpXxvRnSNRk/zEs\n'+
+ 'cGVgCF+cv68nUJM9lwEAbBQChplwL6ebnhunC6DsRCxnjLHVyKm127hmhSiMGC0e\n'+
+ 'Ns31mGeP1dxpDv6Gi2/oKmq67vG3i4fKeckj7bt30tLA1wH0Qn5Mn6Tzxzve0W0q\n'+
+ 'Ghqn9PY9qNK8EkrkzqaFk9dzu5tfSbaJBLS/uIhX2Wj70EMEBbFSkN0qlgOfLgGw\n'+
+ '5mwRvCgj4nvV1ByFhnx7uwgQixvOwLH4JLKvwCQpJm+O2R0eC7M6CzR/b9iL/oaO\n'+
+ 'JTkoD9hcLhxF7j+3ZYg7rbNwofuHST097vFjzItsucb0jHOzjlkCqbhdczICILTa\n'+
+ 'H76Q6YGdMLyG9a3s4yZUMruaeQyWGeXlryzLDvdEoSgoD5YrolsFOM+Z2apbzVs2\n'+
+ 'k5CltwtanjjWGnpAqSyr49C6CSU8G1QHpNygx5frtAS8bojR2ovB9OJp2wUklDvC\n'+
+ 'LtU7dLpTY/BIvfB1vzwcW/aNgmPadNHX8mAzlqTQJjeLoo69Wp804t+u36sgfd/J\n'+
+ 'ser7vdJJUm+86Q9csefItvFmHhqjMg5XXHoa8WZWJOHIQMxZkaIwKAzcEt/oEOdJ\n'+
+ 'rbVNVabhTdbmS5I1ok16wg5jMF07ZDM7nXWMcQNjwT646XKP+pp2N6YQROVidNXj\n'+
+ 'COyRyiXE/csr\n'+
+ '=Ik7G\n'+
+ '-----END PGP MESSAGE-----\n',
someInputParameter: 'bad string',
publicKeyNonAscii: {
diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js
index 9a0925b..3be5cdd 100644
--- a/lang/js/src/gpgmejs.js
+++ b/lang/js/src/gpgmejs.js
@@ -192,18 +192,21 @@ export class GpgME {
msg.post().then(function (result){
let _result = { data: result.data };
_result.base64 = result.base64 ? true: false;
- _result.is_mime = result.is_mime ? true: false;
- if (result.file_name){
- _result.file_name = result.file_name;
- } else {
+ if (result.hasOwnProperty('dec_info')){
+ _result.is_mime = result.dec_info.is_mime ? true: false;
+ if (result.dec_info.file_name) {
+ _result.file_name = result.dec_info.file_name;
+ }
+ }
+ if (!result.file_name) {
_result.file_name = null;
}
- if (
- result.hasOwnProperty('signatures') &&
- Array.isArray(result.signatures)
+ if (result.hasOwnProperty('info')
+ && result.info.hasOwnProperty('signatures')
+ && Array.isArray(result.info.signatures)
) {
_result.signatures = collectSignatures(
- result.signatures);
+ result.info.signatures);
}
resolve(_result);
}, function (error){
diff --git a/lang/js/src/permittedOperations.js b/lang/js/src/permittedOperations.js
index 3142725..6c05fc6 100644
--- a/lang/js/src/permittedOperations.js
+++ b/lang/js/src/permittedOperations.js
@@ -127,8 +127,8 @@ export const permittedOperations = {
'data': 'string',
'base64': 'boolean',
'mime': 'boolean',
- 'signatures': 'object',
- 'info': 'object'
+ 'info': 'object',
+ 'dec_info': 'object'
}
}
},
-----------------------------------------------------------------------
Summary of changes:
lang/js/BrowserTestExtension/tests/decryptTest.js | 16 ++++++++++++++++
lang/js/BrowserTestExtension/tests/inputvalues.js | 22 ++++++++++++++++++++--
lang/js/src/gpgmejs.js | 19 +++++++++++--------
lang/js/src/permittedOperations.js | 4 ++--
4 files changed, 49 insertions(+), 12 deletions(-)
hooks/post-receive
--
GnuPG Made Easy
http://git.gnupg.org
More information about the Gnupg-commits
mailing list