[git] GPGME - branch, javascript-binding, updated. gpgme-1.11.1-115-gd8fd4aa

[email protected] (by Maximilian Krambach)
Newsgroups gmane.comp.encryption.gpg.cvs
Message-ID <[email protected]>
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  d8fd4aad8a93f7745c63814b3779469b610a8db0 (commit)
      from  93f674d33d4dacb115398196a7218c28323fd708 (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 d8fd4aad8a93f7745c63814b3779469b610a8db0
Author: Maximilian Krambach <[email protected]>
Date:   Wed Aug 22 12:44:05 2018 +0200

    js: changed verify signature result infos
    
    --
    
    * the resulting information of verify now are as documented,
      and the same as in a decrypt callback

diff --git a/lang/js/BrowserTestExtension/tests/verifyTest.js b/lang/js/BrowserTestExtension/tests/verifyTest.js
index 82aaf56..5788ed5 100644
--- a/lang/js/BrowserTestExtension/tests/verifyTest.js
+++ b/lang/js/BrowserTestExtension/tests/verifyTest.js
@@ -38,12 +38,12 @@ describe('Verifying data', function () {
         const message = inputvalues.signedMessage.good;
         context.verify(message).then(function (result){
             expect(result.data).to.be.a('string');
-            expect(result.all_valid).to.be.true;
-            expect(result.count).to.equal(1);
-            expect(result.signatures.good).to.be.an('array');
-            expect(result.signatures.good.length).to.equal(1);
-            expect(result.signatures.good[0].fingerprint).to.be.a('string');
-            expect(result.signatures.good[0].valid).to.be.true;
+            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.length).to.equal(1);
+            expect(result.signatures.signatures.good[0].fingerprint).to.be.a('string');
+            expect(result.signatures.signatures.good[0].valid).to.be.true;
             done();
         });
     });
@@ -52,12 +52,14 @@ describe('Verifying data', function () {
         const message = inputvalues.signedMessage.bad;
         context.verify(message).then(function (result){
             expect(result.data).to.be.a('string');
-            expect(result.all_valid).to.be.false;
-            expect(result.count).to.equal(1);
-            expect(result.signatures.bad).to.be.an('array');
-            expect(result.signatures.bad.length).to.equal(1);
-            expect(result.signatures.bad[0].fingerprint).to.be.a('string');
-            expect(result.signatures.bad[0].valid).to.be.false;
+            expect(result.signatures.all_valid).to.be.false;
+            expect(result.signatures.count).to.equal(1);
+            expect(result.signatures.signatures.bad).to.be.an('array');
+            expect(result.signatures.signatures.bad.length).to.equal(1);
+            expect(result.signatures.signatures.bad[0].fingerprint)
+                .to.be.a('string');
+            expect(result.signatures.signatures.bad[0].valid)
+                .to.be.false;
             done();
         });
     });
@@ -70,13 +72,16 @@ describe('Verifying data', function () {
                 context.verify(message_encsign.data).then(function (result){
                     expect(result.data).to.equal(message_enc.data);
                     expect(result.data).to.be.a('string');
-                    expect(result.all_valid).to.be.true;
-                    expect(result.count).to.equal(1);
-                    expect(result.signatures.good).to.be.an('array');
-                    expect(result.signatures.good.length).to.equal(1);
-                    expect(
-                        result.signatures.good[0].fingerprint).to.equal(fpr);
-                    expect(result.signatures.good[0].valid).to.be.true;
+                    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.length)
+                        .to.equal(1);
+                    expect(result.signatures.signatures.good[0].fingerprint)
+                        .to.equal(fpr);
+                    expect(result.signatures.signatures.good[0].valid)
+                        .to.be.true;
                     done();
                 });
             });
diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js
index 2886c6f..7692298 100644
--- a/lang/js/src/gpgmejs.js
+++ b/lang/js/src/gpgmejs.js
@@ -301,8 +301,10 @@ export class GpgME {
                 if (!message.info || !message.info.signatures){
                     reject(gpgme_error('SIG_NO_SIGS'));
                 } else {
-                    let _result = collectSignatures(message.info.signatures);
-                    if (_result instanceof Error){
+                    let _result = {
+                        signatures: collectSignatures(message.info.signatures)
+                    };
+                    if (_result.signatures instanceof Error){
                         reject(_result.signatures);
                     } else {
                         _result.is_mime = message.info.is_mime? true: false;

-----------------------------------------------------------------------

Summary of changes:
 lang/js/BrowserTestExtension/tests/verifyTest.js | 43 +++++++++++++-----------
 lang/js/src/gpgmejs.js                           |  6 ++--
 2 files changed, 28 insertions(+), 21 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.