[git] GnuPG - branch, master, updated. gnupg-2.1.13-47-ge584d64

by Justus Winter cvs at cvs.gnupg.org
Thu Jun 23 17:51:08 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  e584d6468a2e72cd01e55f46104f9f96b56c0b66 (commit)
       via  145910afc077e7a5df6cc8b10e180dfa6ce38cc3 (commit)
       via  1e822654c1dcfc23a9ef689f4e18c0ebba18baca (commit)
       via  332fa86982dc811640ac8643332d8375816e5b81 (commit)
      from  e6e56adf208f194ecafda29bb1c1c06655348432 (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 e584d6468a2e72cd01e55f46104f9f96b56c0b66
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 23 17:24:23 2016 +0200

    tests/openpgp: Fake the system time for the tofu test.
    
    The keys in the tofu test are set to expire on 2016-09-17.  Fake the
    system time for this test.
    
    This commit includes changes to the old test as well, for those who
    need to backport it.
    
    * tests/openpgp/gpg-agent.conf.tmpl: Drop trailing newlines.
    * tests/openpgp/tofu.scm: Fake system time.
    * tests/openpgp/tofu.test: Likewise.
    
    GnuPG-bug-id: 2393
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/gpg-agent.conf.tmpl b/tests/openpgp/gpg-agent.conf.tmpl
index b3cb54f..70e1633 100644
--- a/tests/openpgp/gpg-agent.conf.tmpl
+++ b/tests/openpgp/gpg-agent.conf.tmpl
@@ -1,4 +1,2 @@
 allow-preset-passphrase
 no-grab
-
-
diff --git a/tests/openpgp/tofu.scm b/tests/openpgp/tofu.scm
index 24fa9df..38b6a0f 100755
--- a/tests/openpgp/tofu.scm
+++ b/tests/openpgp/tofu.scm
@@ -19,7 +19,9 @@
 
 (load (with-path "defs.scm"))
 
-(define GPG `(,(tool 'gpg) --no-permission-warning)) ;; w/o --always-trust
+ ;; Redefine GPG without --always-trust and a fixed time.
+(define GPG `(,(tool 'gpg) --no-permission-warning
+	      --faked-system-time=1466684990))
 (define GNUPGHOME (getenv "GNUPGHOME"))
 (if (string=? "" GNUPGHOME)
     (error "GNUPGHOME not set"))
diff --git a/tests/openpgp/tofu.test b/tests/openpgp/tofu.test
index 18c1756..0d34af4 100755
--- a/tests/openpgp/tofu.test
+++ b/tests/openpgp/tofu.test
@@ -4,6 +4,9 @@
 
 # set -x
 
+# Redefine GPG with a fixed time.
+GPG="$GPG --faked-system-time=1466684990"
+
 KEYS="2183839A BC15C85A EE37CF96"
 
 # Make sure $srcdir is set.

commit 145910afc077e7a5df6cc8b10e180dfa6ce38cc3
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 23 17:18:13 2016 +0200

    gpgscm: Handle exceptions in the transformation monad.
    
    * tests/gpgscm/tests.scm (pipe:do): Raise errors.
    (tr:spawn): Catch and return errors.
    (tr:call-with-content): Likewise.
    (tr:{open,write-to,pipe-do,assert-identity,assert-weak-identity}):
    Adapt.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index 6c3eb79..ebe1be5 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -364,12 +364,19 @@
   (let loop ((tmpfiles '()) (source  #f) (cmds commands))
     (if (null? cmds)
 	(for-each remove-temporary-file tmpfiles)
-	(let ((v ((car cmds) tmpfiles source)))
-	  (loop (car v) (cadr v) (cdr cmds))))))
+	(let* ((v ((car cmds) tmpfiles source))
+	       (tmpfiles' (car v))
+	       (sink (cadr v))
+	       (error (caddr v)))
+	  (if error
+	      (begin
+		(for-each remove-temporary-file tmpfiles')
+		(throw error)))
+	  (loop tmpfiles' sink (cdr cmds))))))
 
 (define (tr:open pathname)
   (lambda (tmpfiles source)
-    (list tmpfiles pathname)))
+    (list tmpfiles pathname #f)))
 
 (define (tr:spawn input command)
   (lambda (tmpfiles source)
@@ -381,15 +388,17 @@
 			((equal? '**in** x) source)
 			((equal? '**out** x) t)
 			(else x))) command)))
-      (call-popen cmd input)
-      (if (and (member '**out** command) (not (file-exists? t)))
-	  (error (string-append (stringify cmd) " did not produce '" t "'.")))
-      (list (cons t tmpfiles) t))))
+      (catch (list (cons t tmpfiles) t *error*)
+	     (call-popen cmd input)
+	     (if (and (member '**out** command) (not (file-exists? t)))
+		 (error (string-append (stringify cmd)
+				       " did not produce '" t "'.")))
+	     (list (cons t tmpfiles) t #f)))))
 
 (define (tr:write-to pathname)
   (lambda (tmpfiles source)
     (rename source pathname)
-    (list tmpfiles pathname)))
+    (list tmpfiles pathname #f)))
 
 (define (tr:pipe-do . commands)
   (lambda (tmpfiles source)
@@ -398,21 +407,22 @@
         `(,@(if source `(,(pipe:open source (logior O_RDONLY O_BINARY))) '())
 	  , at commands
 	  ,(pipe:write-to t (logior O_WRONLY O_BINARY O_CREAT) #o600)))
-      (list (cons t tmpfiles) t))))
+      (list (cons t tmpfiles) t #f))))
 
 (define (tr:assert-identity reference)
   (lambda (tmpfiles source)
     (if (not (file=? source reference))
 	(error "mismatch"))
-    (list tmpfiles source)))
+    (list tmpfiles source #f)))
 
 (define (tr:assert-weak-identity reference)
   (lambda (tmpfiles source)
     (if (not (text-file=? source reference))
 	(error "mismatch"))
-    (list tmpfiles source)))
+    (list tmpfiles source #f)))
 
 (define (tr:call-with-content function . args)
   (lambda (tmpfiles source)
-    (apply function `(,(call-with-input-file source read-all) , at args))
-    (list tmpfiles source)))
+    (catch (list tmpfiles source *error*)
+	   (apply function `(,(call-with-input-file source read-all) , at args)))
+    (list tmpfiles source #f)))

commit 1e822654c1dcfc23a9ef689f4e18c0ebba18baca
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 23 17:14:07 2016 +0200

    tests/openpgp: Improve tests.
    
    * tests/openpgp/multisig.scm: Simplify test.
    * tests/openpgp/setup.scm (dearmor): Use pipe.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/multisig.scm b/tests/openpgp/multisig.scm
index 3788f67..53c905f 100755
--- a/tests/openpgp/multisig.scm
+++ b/tests/openpgp/multisig.scm
@@ -156,17 +156,13 @@ cnksIEkgY2FuJ3QgZG8gdGhhdAo=
 (for-each-p
  "Checking that an invalid signature is verified as such"
  (lambda (armored-file)
-   (tr:do
-    (tr:pipe-do
-     (pipe:echo (eval armored-file (current-environment)))
-     (pipe:spawn `(, at GPG --dearmor)))
-    ;; XXX: this is ugly
-    (lambda args
-      (if (catch #f ;; verifikation failed, this is what we want
-		 (apply (tr:spawn "" `(, at GPG --verify **in**)) args)
-		 ;; verification succeded, this is an error.
-		 #t)
-	  (error "invalid signature is valid")
-	  args))))
+   (lettmp (file)
+     (pipe:do
+      (pipe:echo (eval armored-file (current-environment)))
+      (pipe:spawn `(, at GPG --dearmor))
+      (pipe:write-to file (logior O_WRONLY O_CREAT O_BINARY) #o600))
+
+     (if (= 0 (call `(, at GPG --verify ,file)))
+	 (error "Bad signature verified ok")))
  '(sig-1ls1ls-valid sig-ls-valid sig-1lsls-invalid
 		    sig-lsls-invalid sig-lss-invalid sig-slsl-invalid))
diff --git a/tests/openpgp/setup.scm b/tests/openpgp/setup.scm
index 6518dae..ce2e42c 100755
--- a/tests/openpgp/setup.scm
+++ b/tests/openpgp/setup.scm
@@ -56,9 +56,12 @@
   '(500 9000 32000 80000))
 
 (define (dearmor source-name sink-name)
-  (letfd ((source (open source-name (logior O_RDONLY O_BINARY)))
-	    (sink (open sink-name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
-	   (call-with-fds `(, at GPG --dearmor) source sink STDERR_FILENO)))
+  (pipe:do
+   (pipe:open source-name (logior O_RDONLY O_BINARY))
+   (pipe:spawn `(, at GPG --dearmor))
+   (pipe:write-to sink-name
+		  (logior O_WRONLY O_CREAT O_BINARY)
+		  #o600)))
 
 (for-each-p "Unpacking samples"
   (lambda (name)

commit 332fa86982dc811640ac8643332d8375816e5b81
Author: Justus Winter <justus at g10code.com>
Date:   Thu Jun 23 16:14:10 2016 +0200

    gpgscm: Add types for special objects.
    
    * tests/gpgscm/scheme.c (enum scheme_types): Add types for boolean,
    nil, eof, and the sink object.
    (type_to_string): Handle new types.
    (scheme_init_custom_alloc): Give special objects a type.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/scheme.c b/tests/gpgscm/scheme.c
index 3ed5d9b..486194c 100644
--- a/tests/gpgscm/scheme.c
+++ b/tests/gpgscm/scheme.c
@@ -126,7 +126,11 @@ enum scheme_types {
   T_PROMISE=13,
   T_ENVIRONMENT=14,
   T_FOREIGN_OBJECT=15,
-  T_LAST_SYSTEM_TYPE=15
+  T_BOOLEAN=16,
+  T_NIL=17,
+  T_EOF_OBJ=18,
+  T_SINK=19,
+  T_LAST_SYSTEM_TYPE=19
 };
 
 static const char *
@@ -149,6 +153,10 @@ type_to_string (enum scheme_types typ)
      case T_PROMISE: return "promise";
      case T_ENVIRONMENT: return "environment";
      case T_FOREIGN_OBJECT: return "foreign object";
+     case T_BOOLEAN: return "boolean";
+     case T_NIL: return "nil";
+     case T_EOF_OBJ: return "eof object";
+     case T_SINK: return "sink";
      }
      assert (! "not reached");
 }
@@ -4770,19 +4778,19 @@ int scheme_init_custom_alloc(scheme *sc, func_alloc malloc, func_dealloc free) {
   sc->tracing=0;
 
   /* init sc->NIL */
-  typeflag(sc->NIL) = (T_ATOM | MARK);
+  typeflag(sc->NIL) = (T_NIL | T_ATOM | MARK);
   car(sc->NIL) = cdr(sc->NIL) = sc->NIL;
   /* init T */
-  typeflag(sc->T) = (T_ATOM | MARK);
+  typeflag(sc->T) = (T_BOOLEAN | T_ATOM | MARK);
   car(sc->T) = cdr(sc->T) = sc->T;
   /* init F */
-  typeflag(sc->F) = (T_ATOM | MARK);
+  typeflag(sc->F) = (T_BOOLEAN | T_ATOM | MARK);
   car(sc->F) = cdr(sc->F) = sc->F;
   /* init EOF_OBJ */
-  typeflag(sc->EOF_OBJ) = (T_ATOM | MARK);
+  typeflag(sc->EOF_OBJ) = (T_EOF_OBJ | T_ATOM | MARK);
   car(sc->EOF_OBJ) = cdr(sc->EOF_OBJ) = sc->EOF_OBJ;
   /* init sink */
-  typeflag(sc->sink) = (T_PAIR | MARK);
+  typeflag(sc->sink) = (T_SINK | T_PAIR | MARK);
   car(sc->sink) = sc->NIL;
   /* init c_nest */
   sc->c_nest = sc->NIL;

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

Summary of changes:
 tests/gpgscm/scheme.c             | 20 ++++++++++++++------
 tests/gpgscm/tests.scm            | 36 +++++++++++++++++++++++-------------
 tests/openpgp/gpg-agent.conf.tmpl |  2 --
 tests/openpgp/multisig.scm        | 20 ++++++++------------
 tests/openpgp/setup.scm           |  9 ++++++---
 tests/openpgp/tofu.scm            |  4 +++-
 tests/openpgp/tofu.test           |  3 +++
 7 files changed, 57 insertions(+), 37 deletions(-)


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




More information about the Gnupg-commits mailing list