[git] GPGME - branch, master, updated. gpgme-1.11.1-258-g61ac70c

by Maximilian Krambach cvs at cvs.gnupg.org
Wed Aug 29 17:47:38 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, master has been updated
       via  61ac70cfb5cf58f92cd97abdde7152040c51201c (commit)
      from  18ea83867168e8db0a2f2c8057d087363083486c (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 61ac70cfb5cf58f92cd97abdde7152040c51201c
Author: Maximilian Krambach <maximilian.krambach at intevation.de>
Date:   Wed Aug 29 17:45:55 2018 +0200

    js: return base64 after encrypt with armor=false
    
    --
    
    * src/gpgmejs.js/encrypt: the encrypted data were converted back to a
      (incorrect) string, whereas they should be data with no encoding
      specified. Returning base64 data is the expected way.
    * DemoExtension: caught yet another usage of old syntax.

diff --git a/lang/js/DemoExtension/maindemo.js b/lang/js/DemoExtension/maindemo.js
index 97a27f6..b472bcc 100644
--- a/lang/js/DemoExtension/maindemo.js
+++ b/lang/js/DemoExtension/maindemo.js
@@ -29,7 +29,7 @@ document.addEventListener('DOMContentLoaded', function () {
             function (){
                 let data = document.getElementById('inputtext').value;
                 let keyId = document.getElementById('pubkey').value;
-                gpgmejs.encrypt({ data: data, privateKeys: keyId }).then(
+                gpgmejs.encrypt({ data: data, publicKeys: keyId, armor:false }).then(
                     function (answer){
                         if (answer.data){
                             document.getElementById(
diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js
index 08f80fc..295cc04 100644
--- a/lang/js/src/gpgmejs.js
+++ b/lang/js/src/gpgmejs.js
@@ -154,8 +154,12 @@ export class GpgME {
         if (msg instanceof Error){
             return Promise.reject(msg);
         }
-        msg.setParameter('armor', armor);
-
+        if (armor === false){
+            msg.setParameter('armor', false);
+            msg.expected = 'base64';
+        } else if (armor === true) {
+            msg.setParameter('armor', true);
+        }
         if (base64 === true) {
             msg.setParameter('base64', true);
         }

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

Summary of changes:
 lang/js/DemoExtension/maindemo.js | 2 +-
 lang/js/src/gpgmejs.js            | 8 ++++++--
 2 files changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list