[git] GnuPG - branch, master, updated. gnupg-2.1.18-20-g3f4f20e

by Justus Winter cvs at cvs.gnupg.org
Wed Jan 25 17:00:02 CET 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  3f4f20ee6eff052c88647b820d9ecfdbd8df0f40 (commit)
       via  02a39f0d1ed717f6fc33392e6ce4ab421c3bcbba (commit)
       via  7d5a0ed792133d875fcedb6e23a9a3682f1a23f9 (commit)
      from  e175152ef7515921635bf1e00383e812668d13fc (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 3f4f20ee6eff052c88647b820d9ecfdbd8df0f40
Author: Justus Winter <justus at g10code.com>
Date:   Wed Jan 25 16:33:20 2017 +0100

    gpg: Fix searching for mail addresses in keyrings.
    
    * g10/keyring.c (compare_name): Fix KEYDB_SEARCH_MODE_MAIL* searches
    in keyrings when the UID is a plain addr-spec.
    --
    Previously, 'gpg --list-key "<foo at example.org>"' failed if 1/ the
    keyring format is used and 2/ the key's UID is a plain addr-spec
    (cf. RFC2822 section 4.3), e.g. 'foo at example.org'.
    
    GnuPG-bug-id: 2930
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/g10/keyring.c b/g10/keyring.c
index f1281e9..328290e 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -928,13 +928,27 @@ compare_name (int mode, const char *name, const char *uid, size_t uidlen)
     else if (   mode == KEYDB_SEARCH_MODE_MAIL
              || mode == KEYDB_SEARCH_MODE_MAILSUB
              || mode == KEYDB_SEARCH_MODE_MAILEND) {
+        int have_angles = 1;
 	for (i=0, s= uid; i < uidlen && *s != '<'; s++, i++)
 	    ;
+	if (i == uidlen)
+	  {
+	    /* The UID is a plain addr-spec (cf. RFC2822 section 4.3).  */
+	    have_angles = 0;
+	    s = uid;
+	    i = 0;
+	  }
 	if (i < uidlen)  {
-	    /* skip opening delim and one char and look for the closing one*/
-	    s++; i++;
-	    for (se=s+1, i++; i < uidlen && *se != '>'; se++, i++)
-		;
+	    if (have_angles)
+	      {
+		/* skip opening delim and one char and look for the closing one*/
+		s++; i++;
+		for (se=s+1, i++; i < uidlen && *se != '>'; se++, i++)
+		  ;
+	      }
+	    else
+	      se = s + uidlen;
+
 	    if (i < uidlen) {
 		i = se - s;
 		if (mode == KEYDB_SEARCH_MODE_MAIL) {

commit 02a39f0d1ed717f6fc33392e6ce4ab421c3bcbba
Author: Justus Winter <justus at g10code.com>
Date:   Wed Jan 25 16:53:40 2017 +0100

    tests,w32: Fix GPGME tests requiring a pinentry.
    
    * tests/gpgme/gpgme-defs.scm: Use our fake pinentry, and configure it
    to supply the correct passphrase.
    --
    Previously, the GPGME tests used the fake pinentry distributed with
    GPGME which is a Bourne shell script.  Use the fake pinentry from
    GnuPG instead.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgme/gpgme-defs.scm b/tests/gpgme/gpgme-defs.scm
index 6e35285..c102c93 100644
--- a/tests/gpgme/gpgme-defs.scm
+++ b/tests/gpgme/gpgme-defs.scm
@@ -42,6 +42,9 @@
 (setenv "PATH" (string-append (path-join (getenv "GNUPG_BUILDDIR") "tools")
 			      (string *pathsep*) (getenv "PATH")) #t)
 
+;; The tests expect the pinentry to return the passphrase "abc".
+(setenv "PINENTRY_USER_DATA" "abc" #t)
+
 (define (create-file name content)
   (letfd ((fd (open name (logior O_WRONLY O_CREAT O_BINARY) #o600)))
     (display content (fdopen fd "wb"))))
@@ -50,8 +53,7 @@
   (create-file "gpg.conf" "no-force-v3-sigs\n")
   (create-file
    "gpg-agent.conf"
-   (string-append "pinentry-program "
-		  (in-gpgme-srcdir "tests" "gpg" "pinentry") "\n"))
+   (string-append "pinentry-program " (tool 'pinentry)))
   (mkdir "private-keys-v1.d" "-rwx")
 
   (log "Storing private keys")

commit 7d5a0ed792133d875fcedb6e23a9a3682f1a23f9
Author: Justus Winter <justus at g10code.com>
Date:   Wed Jan 25 15:39:30 2017 +0100

    tests,w32: Fix gpgsm signature verification test.
    
    * tests/gpgsm/verify.scm: Use 'call-with-binary-output-file' to avoid
    automatic line-ending conversion.
    --
    Previously, Windows' automatic line-ending conversion turned '\n' into
    '\r\n' when writing the sample to a file, making the signature
    invalid.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgsm/verify.scm b/tests/gpgsm/verify.scm
index 894c827..28210a9 100644
--- a/tests/gpgsm/verify.scm
+++ b/tests/gpgsm/verify.scm
@@ -54,12 +54,12 @@ MYdRclgjObCcoilA8fZ13VR4DiMJVFCxJL4qVWI=
 ;;
 (info "Checking that a valid signature is verified as such.")
 (lettmp (sig body)
-  (with-output-to-file sig (lambda () (display test-sig1)))
-  (with-output-to-file body (lambda () (display test-text1)))
+  (call-with-binary-output-file sig (lambda (port) (display test-sig1 port)))
+  (call-with-binary-output-file body (lambda (port) (display test-text1 port)))
   (call-check `(, at gpgsm --verify ,sig ,body)))
 
 (info "Checking that an invalid signature is verified as such.")
 (lettmp (sig body)
-  (with-output-to-file sig (lambda () (display test-sig1)))
-  (with-output-to-file body (lambda () (display test-text1f)))
+  (call-with-binary-output-file sig (lambda (port) (display test-sig1 port)))
+  (call-with-binary-output-file body (lambda (port) (display test-text1f port)))
   (assert (not (zero? (call `(, at gpgsm --verify ,sig ,body))))))

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

Summary of changes:
 g10/keyring.c              | 22 ++++++++++++++++++----
 tests/gpgme/gpgme-defs.scm |  6 ++++--
 tests/gpgsm/verify.scm     |  8 ++++----
 3 files changed, 26 insertions(+), 10 deletions(-)


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




More information about the Gnupg-commits mailing list