diff options
| author | Werner Koch <[email protected]> | 2014-05-08 09:31:30 +0000 | 
|---|---|---|
| committer | Werner Koch <[email protected]> | 2014-05-08 09:31:30 +0000 | 
| commit | 991cde9e79fec70aad093ded383c5574d30f9388 (patch) | |
| tree | b8739b6593d742b6cdf1b514da71d5af1ca86a39 /src | |
| parent | w32: Fix another memleak on error. (diff) | |
| download | gpgme-991cde9e79fec70aad093ded383c5574d30f9388.tar.gz gpgme-991cde9e79fec70aad093ded383c5574d30f9388.zip | |
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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine-gpg.c | 6 | ||||
| -rw-r--r-- | src/gpgme-tool.c | 6 | ||||
| -rw-r--r-- | src/gpgme.h.in | 3 | 
3 files changed, 12 insertions, 3 deletions
| diff --git a/src/engine-gpg.c b/src/engine-gpg.c index ce9e3494..ede098ef 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 a980347c..be8ed078 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 655602df..efc58ea5 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; | 
