[git] GPGME - branch, master, updated. gpgme-1.11.1-234-g352c530

by Maximilian Krambach cvs at cvs.gnupg.org
Thu Aug 23 12:33:40 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  352c53040d75e70dcda16c153d10c21e8eee0e01 (commit)
      from  3fd6837fce9b339b8b09a800a969e0950e78250c (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 352c53040d75e70dcda16c153d10c21e8eee0e01
Author: Maximilian Krambach <maximilian.krambach at intevation.de>
Date:   Thu Aug 23 12:30:49 2018 +0200

    js: offer an always-trust parameter on encrypt
    
    --
    
    * src/gpgmejs.js: Setting the default to 'always trust' assumes that
      most api users will already have made their internal checks, but may
      not have the gnupg web-of-trust model implemented, thus trusting the
      key themselves, without gnupg having full or even any information.
      Still it should stay an option to have gnupg decide.

diff --git a/lang/js/src/gpgmejs.js b/lang/js/src/gpgmejs.js
index ffee719..1a5d557 100644
--- a/lang/js/src/gpgmejs.js
+++ b/lang/js/src/gpgmejs.js
@@ -128,6 +128,9 @@ export class GpgME {
      * block.
      * @param {Boolean} options.wildcard (optional) If true, recipient
      * information will not be added to the message.
+     * @param {Boolean} always_trust (optional, default true) This assumes that
+     * used keys are fully trusted. If set to false, encryption to a key not
+     * fully trusted in gnupg will fail
      * @param {Object} additional use additional valid gpg options as
      * defined in {@link permittedOperations}
      * @returns {Promise<encrypt_result>} Object containing the encrypted
@@ -135,7 +138,7 @@ export class GpgME {
      * @async
      */
     encrypt ({ data, publicKeys, secretKeys, base64 = false, armor = true,
-        wildcard, additional = {} }){
+        wildcard, always_trust = true, additional = {} }){
         if (!data || !publicKeys){
             return Promise.reject(gpgme_error('MSG_INCOMPLETE'));
         }
@@ -148,6 +151,9 @@ export class GpgME {
         if (base64 === true) {
             msg.setParameter('base64', true);
         }
+        if (always_trust === true) {
+            msg.setParameter('always-trust', true);
+        }
         let pubkeys = toKeyIdArray(publicKeys);
         if (!pubkeys.length) {
             return Promise.reject(gpgme_error('MSG_NO_KEYS'));

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

Summary of changes:
 lang/js/src/gpgmejs.js | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)


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




More information about the Gnupg-commits mailing list