[git] GnuPG - branch, master, updated. gnupg-2.1.19-84-g211d71f

by Justus Winter cvs at cvs.gnupg.org
Tue Mar 28 12:11:58 CEST 2017


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  211d71f19c24da94f4c58014606125c1a29d86a2 (commit)
       via  6d3edfd972c1114f43f6b35773dc25e0256f48f4 (commit)
      from  caf00915532e6e8e509738962964edcd14fb0654 (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 211d71f19c24da94f4c58014606125c1a29d86a2
Author: Justus Winter <justus at g10code.com>
Date:   Tue Mar 28 12:07:32 2017 +0200

    tests: Add test for '--decrypt --unwrap'.
    
    * tests/openpgp/Makefile.am (XTESTS): Add new test.
    * tests/openpgp/decrypt-unwrap-verify.scm: New file.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 518af20..1a80bb6 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -48,6 +48,7 @@ XTESTS = \
 	decrypt-multifile.scm \
 	decrypt-dsa.scm \
 	decrypt-session-key.scm \
+	decrypt-unwrap-verify.scm \
 	sigs.scm \
 	sigs-dsa.scm \
 	encrypt.scm \
diff --git a/tests/openpgp/decrypt-unwrap-verify.scm b/tests/openpgp/decrypt-unwrap-verify.scm
new file mode 100755
index 0000000..97a72e4
--- /dev/null
+++ b/tests/openpgp/decrypt-unwrap-verify.scm
@@ -0,0 +1,41 @@
+#!/usr/bin/env gpgscm
+
+;; Copyright (C) 2017 g10 Code GmbH
+;;
+;; This file is part of GnuPG.
+;;
+;; GnuPG is free software; you can redistribute it and/or modify
+;; it under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3 of the License, or
+;; (at your option) any later version.
+;;
+;; GnuPG is distributed in the hope that it will be useful,
+;; but WITHOUT ANY WARRANTY; without even the implied warranty of
+;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;; GNU General Public License for more details.
+;;
+;; You should have received a copy of the GNU General Public License
+;; along with this program; if not, see <http://www.gnu.org/licenses/>.
+
+(load (with-path "defs.scm"))
+(setup-legacy-environment)
+
+(lettmp (steve's-key)
+  (call-check `(, at gpg --output ,steve's-key --export "1D777619BE310D79"))
+
+  (for-each-p
+   "Checking unwrapping the encryption."
+   (lambda (name)
+     ;; First, unwrap the encrypted message using Steve's secret key.
+     (lettmp (unwrapped)
+       (tr:do
+	(tr:open (in-srcdir "samplemsgs" (string-append name ".asc")))
+	(tr:gpg "" `(--yes --decrypt --unwrap))
+	(tr:write-to unwrapped))
+
+       ;; Then, verify the signature with a clean working directory
+       ;; containing only Steve's public key.
+       (with-ephemeral-home-directory
+	(call-check `(, at gpg --import ,steve's-key))
+	(call-check `(, at gpg --verify ,unwrapped)))))
+  '("encsig-2-keys-3" "encsig-2-keys-4")))

commit 6d3edfd972c1114f43f6b35773dc25e0256f48f4
Author: Justus Winter <justus at g10code.com>
Date:   Tue Mar 28 12:10:28 2017 +0200

    g10: Fix memory leak.
    
    * g10/decrypt-data.c (decrypt_data): Free 'filename'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/decrypt-data.c b/g10/decrypt-data.c
index 11a253f..96e2487 100644
--- a/g10/decrypt-data.c
+++ b/g10/decrypt-data.c
@@ -222,7 +222,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
 
   if (opt.unwrap_encryption)
     {
-      char *filename;
+      char *filename = NULL;
       estream_t fp;
       rc = get_output_file ("", 0, ed->buf, &filename, &fp);
       if (! rc)
@@ -248,6 +248,7 @@ decrypt_data (ctrl_t ctrl, void *procctx, PKT_encrypted *ed, DEK *dek)
           if (afx)
             release_armor_context (afx);
         }
+      xfree (filename);
     }
   else
     proc_packets (ctrl, procctx, ed->buf );

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

Summary of changes:
 g10/decrypt-data.c                                 |  3 ++-
 tests/openpgp/Makefile.am                          |  1 +
 .../{issue2941.scm => decrypt-unwrap-verify.scm}   | 29 ++++++++++++++--------
 3 files changed, 21 insertions(+), 12 deletions(-)
 copy tests/openpgp/{issue2941.scm => decrypt-unwrap-verify.scm} (53%)


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




More information about the Gnupg-commits mailing list