[git] GPGME - branch, master, updated. gpgme-1.11.1-240-g4f28fbd

by Maximilian Krambach cvs at cvs.gnupg.org
Mon Aug 27 11:48:41 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  4f28fbddd3d70eb7e3ce874b1673630142110b72 (commit)
      from  557fec600248e6ad413af01c9a53d4993f36af0c (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 4f28fbddd3d70eb7e3ce874b1673630142110b72
Author: Maximilian Krambach <maximilian.krambach at intevation.de>
Date:   Mon Aug 27 11:50:09 2018 +0200

    js: extend information on decoding in decrypt
    
    --
    
    * src/Connection.js: resulting data, if not pure ascii, is base64
      encoded in the result message. A further decoding attempt into
      javascript 'string' will be attempted by default, unless specified
      at the decrypt() method. The return value 'format' now shows which
      of the possibilities has been applied. The old boolean 'base64'
      now turns into format:'base64' if the returned payload is a base64
      string after decryption.

diff --git a/lang/js/src/Connection.js b/lang/js/src/Connection.js
index 3fd1810..c4921d5 100644
--- a/lang/js/src/Connection.js
+++ b/lang/js/src/Connection.js
@@ -232,7 +232,9 @@ class Answer{
             return gpgme_error('CONN_UNEXPECTED_ANSWER');
         }
         let _decodedResponse = JSON.parse(atob(this._response_b64));
-        let _response = {};
+        let _response = {
+            format: 'ascii'
+        };
         let messageKeys = Object.keys(_decodedResponse);
         let poa = permittedOperations[this.operation].answer;
         if (messageKeys.length === 0){
diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js
index 5bdffeb..b86b5f1 100644
--- a/lang/js/src/gpgmejs.js
+++ b/lang/js/src/gpgmejs.js
@@ -55,8 +55,12 @@ import { createSignature } from './Signature';
 /**
  * @typedef {Object} encrypt_result The result of an encrypt operation
  * @property {String} data The encrypted message
- * @property {Boolean} base64 Indicating whether returning payload data is
- * base64 encoded
+ * @property {String} format Indicating how the data was converted after being
+ *  received from gpgme.
+ *      'ascii': Data was ascii-encoded and no further processed
+ *      'string': Data was decoded into an utf-8 string,
+ *      'base64': Data was not processed and is a base64 string
+ *      'uint8': Data was turned into a Uint8Array
  */
 
 /**

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

Summary of changes:
 lang/js/src/Connection.js | 4 +++-
 lang/js/src/gpgmejs.js    | 8 ++++++--
 2 files changed, 9 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list