diff options
author | Justus Winter <justus@g10code.com> | 2016-04-04 17:05:50 +0200 |
---|---|---|
committer | Justus Winter <justus@g10code.com> | 2016-04-04 17:53:03 +0200 |
commit | abb352de51bc964c06007fce43ed6f6caea87c15 (patch) | |
tree | 2086813d191c3387e1cf295adcfa7a85ae0a261d /g10/dearmor.c | |
parent | tests: Fix default key test. (diff) | |
download | gnupg2-abb352de51bc964c06007fce43ed6f6caea87c15.tar.xz gnupg2-abb352de51bc964c06007fce43ed6f6caea87c15.zip |
g10: Support armored keyrings in gpgv.
* doc/gpgv.texi: Document the feature.
* g10/Makefile.am (gpgv2_SOURCES): Add dearmor.c.
* g10/dearmor.c (dearmor_file): Add sink argument.
* g10/gpg.c (main): Adapt accordingly.
* g10/gpgv.c (make_temp_dir): New function.
(main): De-armor keyrings.
* g10/main.h (dearmor_file): Adapt prototype.
GnuPG-bug-id: 2290
Signed-off-by: Justus Winter <justus@g10code.com>
Diffstat (limited to 'g10/dearmor.c')
-rw-r--r-- | g10/dearmor.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/dearmor.c b/g10/dearmor.c index 3fdd57dae..3f1976f96 100644 --- a/g10/dearmor.c +++ b/g10/dearmor.c @@ -35,10 +35,11 @@ #include "i18n.h" /**************** - * Take an armor file and write it out without armor + * Take an armor file and write it out without armor. If outfd is not + * -1, the output will be written to the given file descriptor. */ int -dearmor_file( const char *fname ) +dearmor_file( const char *fname, int outfd ) { armor_filter_context_t *afx; IOBUF inp = NULL, out = NULL; @@ -64,7 +65,7 @@ dearmor_file( const char *fname ) push_armor_filter ( afx, inp ); - if( (rc = open_outfile (-1, fname, 0, 0, &out)) ) + if( (rc = open_outfile (outfd, fname, 0, 0, &out)) ) goto leave; while( (c = iobuf_get(inp)) != -1 ) |