aboutsummaryrefslogtreecommitdiffstats
path: root/g10/gpg.c
diff options
context:
space:
mode:
authorNeal H. Walfield <[email protected]>2015-11-05 11:20:42 +0000
committerNeal H. Walfield <[email protected]>2015-11-05 13:16:33 +0000
commitec409e62aea6cc829299be794f9d035d033cb51b (patch)
tree751b85be355f5e858c384cd0d2d771fc7b372878 /g10/gpg.c
parentcommon: Add a function for copying data from one iobuf to another. (diff)
downloadgnupg-ec409e62aea6cc829299be794f9d035d033cb51b.tar.gz
gnupg-ec409e62aea6cc829299be794f9d035d033cb51b.zip
gpg: Add support for unwrapping the outer level of encryption.
* g10/decrypt-data.c (decrypt_data): If OPT.UNWRAP_ENCRYPTION is set, copy the data to the output file instead of continuing to process it. * g10/gpg.c (enum cmd_and_opt_values): Add new value oUnwrap. (opts): Handle oUnwrap. (main): Likewise. * g10/options.h (opt): Add field unwrap_encryption. * g10/plaintext.c (handle_plaintext): Break the output file selection functionality into ... (get_output_file): ... this new function. -- Signed-off-by: Neal H. Walfield <[email protected]> GnuPG-bug-id: 1060 Debian-bug-id: 282061
Diffstat (limited to 'g10/gpg.c')
-rw-r--r--g10/gpg.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/g10/gpg.c b/g10/gpg.c
index cdf7b0d7f..ef283b487 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -391,6 +391,7 @@ enum cmd_and_opt_values
oTOFUDefaultPolicy,
oTOFUDBFormat,
oWeakDigest,
+ oUnwrap,
oNoop
};
@@ -753,6 +754,7 @@ static ARGPARSE_OPTS opts[] = {
"personal-compress-preferences", "@"),
ARGPARSE_s_s (oFakedSystemTime, "faked-system-time", "@"),
ARGPARSE_s_s (oWeakDigest, "weak-digest","@"),
+ ARGPARSE_s_n (oUnwrap, "unwrap", "@"),
/* Aliases. I constantly mistype these, and assume other people do
as well. */
@@ -3147,6 +3149,9 @@ main (int argc, char **argv)
case oWeakDigest:
additional_weak_digest(pargs.r.ret_str);
break;
+ case oUnwrap:
+ opt.unwrap_encryption = 1;
+ break;
case oDisplay:
set_opt_session_env ("DISPLAY", pargs.r.ret_str);