[git] GnuPG - branch, master, updated. gnupg-2.1.15-92-gbbe940c

by Werner Koch cvs at cvs.gnupg.org
Thu Sep 8 00:48:59 CEST 2016


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 "The GNU Privacy Guard".

The branch, master has been updated
       via  bbe940c095f2bca7a1ca5f8e68ca1af98350a885 (commit)
      from  6308c300196ae85fd82ed383217219e0206640a4 (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 bbe940c095f2bca7a1ca5f8e68ca1af98350a885
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Sep 8 00:45:45 2016 +0200

    gpg: Make --output work with --verify.
    
    * g10/mainproc.c (proc_plaintext): Handle opt.output.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/doc/gpg.texi b/doc/gpg.texi
index 8864a0a..74977c5 100644
--- a/doc/gpg.texi
+++ b/doc/gpg.texi
@@ -3438,13 +3438,15 @@ show fingerprint
 
 @item gpg --verify @code{pgpfile}
 @itemx gpg --verify @code{sigfile}
-Verify the signature of the file but do not output the data. The
-second form is used for detached signatures, where @code{sigfile}
-is the detached signature (either ASCII armored or binary) and
-are the signed data; if this is not given, the name of
-the file holding the signed data is constructed by cutting off the
-extension (".asc" or ".sig") of @code{sigfile} or by asking the
-user for the filename.
+Verify the signature of the file but do not output the data unless
+requested. The second form is used for detached signatures, where
+ at code{sigfile} is the detached signature (either ASCII armored or
+binary) and are the signed data; if this is not given, the name of the
+file holding the signed data is constructed by cutting off the
+extension (".asc" or ".sig") of @code{sigfile} or by asking the user
+for the filename.  If the option @option{--output} is also used the
+signed data is written to the file specified by that option; use
+ at code{-} to write the signed data to stdout.
 @end table
 
 
diff --git a/g10/mainproc.c b/g10/mainproc.c
index 7bb4350..929e18a 100644
--- a/g10/mainproc.c
+++ b/g10/mainproc.c
@@ -757,7 +757,12 @@ proc_plaintext( CTX c, PACKET *pkt )
 
   if (!rc)
     {
-      rc = handle_plaintext (pt, &c->mfx, c->sigs_only, clearsig);
+      /* It we are in --verify mode, we do not want to output the
+       * signed text.  However, if --output is also used we do what
+       * has been requested and write out the signed data.  */
+      rc = handle_plaintext (pt, &c->mfx,
+                             (opt.outfp || opt.outfile)? 0 :  c->sigs_only,
+                             clearsig);
       if (gpg_err_code (rc) == GPG_ERR_EACCES && !c->sigs_only)
         {
           /* Can't write output but we hash it anyway to check the

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

Summary of changes:
 doc/gpg.texi   | 16 +++++++++-------
 g10/mainproc.c |  7 ++++++-
 2 files changed, 15 insertions(+), 8 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list