[git] GnuPG - branch, master, updated. gnupg-2.1.16-85-gb778d8d

by Justus Winter cvs at cvs.gnupg.org
Fri Dec 9 13:23:28 CET 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  b778d8deedf344c8116362633925b8153c7f1bf1 (commit)
       via  59f1562c25119a4fe27411e6350f2149d6147148 (commit)
       via  c8100fc0faadf8ba35e4df32b4760cc975e3a83d (commit)
       via  3de9bad359e28ced4a2539e411d222ffd82a4a62 (commit)
      from  5c7d58222834793629a30248e72b6ea96e832dc4 (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 b778d8deedf344c8116362633925b8153c7f1bf1
Author: Justus Winter <justus at g10code.com>
Date:   Thu Dec 8 15:40:27 2016 +0100

    tests: Add a test for '--quick-addkey'.
    
    * tests/openpgp/quick-key-manipulation.scm: Test '--quick-addkey'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/quick-key-manipulation.scm b/tests/openpgp/quick-key-manipulation.scm
index d6bdde0..360c48e 100755
--- a/tests/openpgp/quick-key-manipulation.scm
+++ b/tests/openpgp/quick-key-manipulation.scm
@@ -97,3 +97,68 @@
 ;; And remove the expiration date.
 (call-check `(, at gpg --quick-set-expire ,fpr "0"))
 (assert (equal? "" (expiration-time fpr)))
+
+
+;;
+;; Check --quick-addkey
+;;
+
+;; Get the subkeys.
+(define (get-subkeys)
+  (filter (lambda (x) (equal? "sub" (car x)))
+	  (gpg-with-colons `(-k ,fpr))))
+
+;; This keeps track of the number of subkeys.
+(define count (length (get-subkeys)))
+
+;; Convenient accessors for the colon output.
+(define (:length x) (string->number (list-ref x 2)))
+(define (:alg x) (string->number (list-ref x 3)))
+(define (:expire x) (list-ref x 6))
+(define (:cap x) (list-ref x 11))
+
+(for-each-p
+ "Checking that we can add subkeys..."
+ (lambda (args check)
+   (set! count (+ 1 count))
+   (call-check `(, at gpg --quick-addkey ,fpr , at args))
+   (let ((subkeys (get-subkeys)))
+     (assert (= count (length subkeys)))
+     (if check (check (last subkeys)))))
+ ;; A bunch of arguments...
+ '(()
+   (- - -)
+   (default default never)
+   (rsa sign "2d")
+   (rsa1024 sign "2w")
+   (rsa2048 encr "2m")
+   (rsa4096 sign,auth "2y")
+   (future-default))
+ ;; ... with functions to check that the created key matches the
+ ;; expectations (or #f for no tests).
+ (list
+  #f
+  #f
+  (lambda (subkey)
+    (assert (equal? "" (:expire subkey))))
+  (lambda (subkey)
+    (assert (= 1 (:alg subkey)))
+    (assert (string-contains? (:cap subkey) "s"))
+    (assert (not (equal? "" (:expire subkey)))))
+  (lambda (subkey)
+    (assert (= 1 (:alg subkey)))
+    (assert (= 1024 (:length subkey)))
+    (assert (string-contains? (:cap subkey) "s"))
+    (assert (not (equal? "" (:expire subkey)))))
+  (lambda (subkey)
+    (assert (= 1 (:alg subkey)))
+    (assert (= 2048 (:length subkey)))
+    (assert (string-contains? (:cap subkey) "e"))
+    (assert (not (equal? "" (:expire subkey)))))
+  (lambda (subkey)
+    (assert (= 1 (:alg subkey)))
+    (assert (= 4096 (:length subkey)))
+    (assert (string-contains? (:cap subkey) "s"))
+    (assert (string-contains? (:cap subkey) "a"))
+    (assert (not (equal? "" (:expire subkey)))))
+  #f))

commit 59f1562c25119a4fe27411e6350f2149d6147148
Author: Justus Winter <justus at g10code.com>
Date:   Fri Dec 9 11:49:24 2016 +0100

    tests: New test using all available compression algorithms.
    
    * tests/openpgp/Makefile.am (XTESTS): Add new test.
    * tests/openpgp/compression.scm: New file.
    * tests/openpgp/defs.scm (all-compression-algos): New variable.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/Makefile.am b/tests/openpgp/Makefile.am
index 2f43644..deed63d 100644
--- a/tests/openpgp/Makefile.am
+++ b/tests/openpgp/Makefile.am
@@ -55,6 +55,7 @@ XTESTS = \
 	encrypt.scm \
 	encrypt-multifile.scm \
 	encrypt-dsa.scm \
+	compression.scm \
 	seat.scm \
 	clearsig.scm \
 	encryptp.scm \
diff --git a/tests/openpgp/compression.scm b/tests/openpgp/compression.scm
new file mode 100755
index 0000000..f39c132
--- /dev/null
+++ b/tests/openpgp/compression.scm
@@ -0,0 +1,36 @@
+#!/usr/bin/env gpgscm
+
+;; Copyright (C) 2016 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)
+
+(for-each-p
+ "Checking encryption using a specific compression algorithm"
+ (lambda (compression)
+   (for-each-p
+    ""
+    (lambda (source)
+      (tr:do
+       (tr:open source)
+       (tr:gpg "" `(--yes --encrypt --recipient ,usrname2
+			  --compress-algo ,compression))
+       (tr:gpg "" '(--yes))
+       (tr:assert-identity source)))
+    (append plain-files data-files)))
+ (force all-compression-algos))
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index bdb86ca..b198cdd 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -102,6 +102,7 @@
 (define all-pubkey-algos (delay (get-config "pubkeyname")))
 (define all-hash-algos (delay (get-config "digestname")))
 (define all-cipher-algos (delay (get-config "ciphername")))
+(define all-compression-algos (delay (get-config "compressname")))
 
 (define (have-pubkey-algo? x)
   (not (not (member x (force all-pubkey-algos)))))

commit c8100fc0faadf8ba35e4df32b4760cc975e3a83d
Author: Justus Winter <justus at g10code.com>
Date:   Fri Dec 9 11:46:49 2016 +0100

    g10: List compression algorithms using human-readable names.
    
    * g10/gpg.c (list_config): List all enabled compression algorithms
    under the key 'compressname'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/gpg.c b/g10/gpg.c
index 19a7a41..ddb7715 100644
--- a/g10/gpg.c
+++ b/g10/gpg.c
@@ -1757,6 +1757,15 @@ list_config(char *items)
 	  any=1;
 	}
 
+      if(show_all || ascii_strcasecmp (name, "compressname") == 0)
+	{
+	  es_printf ("cfg:compressname:");
+	  print_algo_names (check_compress_algo,
+			    compress_algo_to_string);
+	  es_printf ("\n");
+	  any=1;
+	}
+
       if (show_all || !ascii_strcasecmp(name,"ccid-reader-id"))
 	{
           /* We ignore this for GnuPG 1.4 backward compatibility.  */

commit 3de9bad359e28ced4a2539e411d222ffd82a4a62
Author: Justus Winter <justus at g10code.com>
Date:   Fri Dec 9 13:12:30 2016 +0100

    g10: Fix memory leak.
    
    * g10/sign.c (do_sign): Release old signature data.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/sign.c b/g10/sign.c
index 19ca484..acc894c 100644
--- a/g10/sign.c
+++ b/g10/sign.c
@@ -282,7 +282,9 @@ do_sign (PKT_public_key *pksk, PKT_signature *sig,
   sig->digest_algo = mdalgo;
   sig->digest_start[0] = dp[0];
   sig->digest_start[1] = dp[1];
+  mpi_release (sig->data[0]);
   sig->data[0] = NULL;
+  mpi_release (sig->data[1]);
   sig->data[1] = NULL;
 
 

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

Summary of changes:
 g10/gpg.c                                          |  9 +++
 g10/sign.c                                         |  2 +
 tests/openpgp/Makefile.am                          |  1 +
 tests/openpgp/{encrypt-dsa.scm => compression.scm} | 20 ++-----
 tests/openpgp/defs.scm                             |  1 +
 tests/openpgp/quick-key-manipulation.scm           | 65 ++++++++++++++++++++++
 6 files changed, 83 insertions(+), 15 deletions(-)
 copy tests/openpgp/{encrypt-dsa.scm => compression.scm} (68%)


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




More information about the Gnupg-commits mailing list