[git] GPGME - branch, master, updated. gpgme-1.4.3-26-g991cde9

by Werner Koch cvs at cvs.gnupg.org
Thu May 8 11:30:29 CEST 2014


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  991cde9e79fec70aad093ded383c5574d30f9388 (commit)
      from  62711e5614e44e65a7c7bb7d21493d09d3081271 (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 991cde9e79fec70aad093ded383c5574d30f9388
Author: Werner Koch <wk at gnupg.org>
Date:   Thu May 8 11:31:30 2014 +0200

    Add GPGME_ENCRYPT_NO_COMPRESS flag.
    
    * src/gpgme.h.in (GPGME_ENCRYPT_NO_COMPRESS): New.
    * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign): Implement it.
    * src/gpgme-tool.c (_cmd_sign_encrypt): Add option --no-compress.

diff --git a/NEWS b/NEWS
index acba24d..5fb4808 100644
--- a/NEWS
+++ b/NEWS
@@ -12,6 +12,8 @@ Noteworthy changes in version 1.5.0 (unreleased)
  * Add feature to use the gpgme I/O subsystem to run arbitrary
    commands.
 
+ * Add flag to force encryption without the default comprtession step.
+
  * Interface changes relative to the 1.4.3 release:
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  gpgme_get_dirinfo              NEW.
@@ -20,6 +22,7 @@ Noteworthy changes in version 1.5.0 (unreleased)
  GPGME_PROTOCOL_SPAWN           NEW.
  GPGME_SPAWN_DETACHED           NEW.
  GPGME_SPAWN_ALLOW_SET_FG       NEW.
+ GPGME_ENCRYPT_NO_COMPRESS      NEW.
 
 
 Noteworthy changes in version 1.4.3 (2013-08-12)
diff --git a/doc/gpgme.texi b/doc/gpgme.texi
index 7697ff1..eaf1fcb 100644
--- a/doc/gpgme.texi
+++ b/doc/gpgme.texi
@@ -5141,6 +5141,21 @@ The @code{GPGME_ENCRYPT_NO_ENCRYPT_TO} symbol specifies that no
 default or hidden default recipients as configured in the crypto
 backend should be included.  This can be useful for managing different
 user profiles.
+
+ at item GPGME_ENCRYPT_NO_COMPRESS
+The @code{GPGME_ENCRYPT_NO_COMPRESS} symbol specifies that the
+plaintext shall not be compressed before it is encrypted.  This is
+in some cases useful if the length of the encrypted message
+may reveal information about the plaintext.
+
+ at item GPGME_ENCRYPT_PREPARE
+ at itemx GPGME_ENCRYPT_EXPECT_SIGN
+The @code{GPGME_ENCRYPT_PREPARE} symbol is used with the UI Server
+protocol to prepare an encryption (i.e. sending the
+ at code{PREP_ENCRYPT} command).  With the
+ at code{GPGME_ENCRYPT_EXPECT_SIGN} symbol the UI Server is advised to
+also expect a sign command.
+
 @end table
 
 If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in
diff --git a/src/engine-gpg.c b/src/engine-gpg.c
index ce9e349..ede098e 100644
--- a/src/engine-gpg.c
+++ b/src/engine-gpg.c
@@ -1662,6 +1662,9 @@ gpg_encrypt (void *engine, gpgme_key_t recp[], gpgme_encrypt_flags_t flags,
   if (!err && use_armor)
     err = add_arg (gpg, "--armor");
 
+  if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS))
+    err = add_arg (gpg, "--compress-algo=none");
+
   if (!symmetric)
     {
       /* If we know that all recipients are valid (full or ultimate trust)
@@ -1719,6 +1722,9 @@ gpg_encrypt_sign (void *engine, gpgme_key_t recp[],
   if (!err && use_armor)
     err = add_arg (gpg, "--armor");
 
+  if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS))
+    err = add_arg (gpg, "--compress-algo=none");
+
   if (!symmetric)
     {
       /* If we know that all recipients are valid (full or ultimate trust)
diff --git a/src/gpgme-tool.c b/src/gpgme-tool.c
index a980347..be8ed07 100644
--- a/src/gpgme-tool.c
+++ b/src/gpgme-tool.c
@@ -2806,6 +2806,8 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign)
     flags |= GPGME_ENCRYPT_PREPARE;
   if (strstr (line, "--expect-sign"))
     flags |= GPGME_ENCRYPT_EXPECT_SIGN;
+  if (strstr (line, "--no-compress"))
+    flags |= GPGME_ENCRYPT_NO_COMPRESS;
 
   inp_fd = server->input_fd;
   inp_fn = server->input_filename;
@@ -2842,7 +2844,7 @@ _cmd_sign_encrypt (assuan_context_t ctx, char *line, int sign)
 
 static const char hlp_encrypt[] =
   "ENCRYPT [--always-trust] [--no-encrypt-to]\n"
-  "  [--prepare] [--expect-sign]\n"
+  "  [--no-compress] [--prepare] [--expect-sign]\n"
   "\n"
   "Encrypt the object set by the last INPUT command to\n"
   "the keys specified by previous RECIPIENT commands.  \n"
@@ -2857,7 +2859,7 @@ cmd_encrypt (assuan_context_t ctx, char *line)
 
 static const char hlp_sign_encrypt[] =
   "SIGN_ENCRYPT [--always-trust] [--no-encrypt-to]\n"
-  "  [--prepare] [--expect-sign]\n"
+  "  [--no-compress] [--prepare] [--expect-sign]\n"
   "\n"
   "Sign the object set by the last INPUT command with the\n"
   "keys specified by previous SIGNER commands and encrypt\n"
diff --git a/src/gpgme.h.in b/src/gpgme.h.in
index 655602d..efc58ea 100644
--- a/src/gpgme.h.in
+++ b/src/gpgme.h.in
@@ -1283,7 +1283,8 @@ typedef enum
     GPGME_ENCRYPT_ALWAYS_TRUST = 1,
     GPGME_ENCRYPT_NO_ENCRYPT_TO = 2,
     GPGME_ENCRYPT_PREPARE = 4,
-    GPGME_ENCRYPT_EXPECT_SIGN = 8
+    GPGME_ENCRYPT_EXPECT_SIGN = 8,
+    GPGME_ENCRYPT_NO_COMPRESS = 16
   }
 gpgme_encrypt_flags_t;
 

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

Summary of changes:
 NEWS             |    3 +++
 doc/gpgme.texi   |   15 +++++++++++++++
 src/engine-gpg.c |    6 ++++++
 src/gpgme-tool.c |    6 ++++--
 src/gpgme.h.in   |    3 ++-
 5 files changed, 30 insertions(+), 3 deletions(-)


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




More information about the Gnupg-commits mailing list