[git] GPGME - branch, master, updated. gpgme-1.8.0-43-ga28d31f

by Andre Heinecke cvs at cvs.gnupg.org
Wed Feb 1 16:17:44 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 "GnuPG Made Easy".

The branch, master has been updated
       via  a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b (commit)
      from  ba594d85e35e63301755977234d3af88a167a215 (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 a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Wed Feb 1 16:16:22 2017 +0100

    core: Improve mailbox only uid handling
    
    * src/key.c (_gpgme_key_append_name): Set email and remove name
    for uid only keys.
    
    --
    If we have a name and no email but the name can be parsed as
    an address we now treat the address as email and remove the name.
    
    This fixes downstream users that rely on email to show email
    addresses and don't expilicity handle this case.
    
    E.g. A userid foo at example.com was:
    uid->name = "foo at example.com"
    uid->email = ""
    uid->address = "foo at example.com"
    
    It is now:
    uid->name = ""
    uid->email = "foo at example.com"
    uid->address = "foo at example.com"

diff --git a/src/key.c b/src/key.c
index 38acc71..fed020e 100644
--- a/src/key.c
+++ b/src/key.c
@@ -242,6 +242,14 @@ _gpgme_key_append_name (gpgme_key_t key, const char *src, int convert)
       free (uid->address);
       uid->address = uid->email;
     }
+  if ((!uid->email || !*uid->email) && uid->address && uid->name
+      && !strcmp (uid->name, uid->address))
+    {
+      /* Name and address are the same. This is a mailbox only key.
+         Use address as email and remove name. */
+      *uid->name = '\0';
+      uid->email = uid->address;
+    }
 
   if (!key->uids)
     key->uids = uid;

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

Summary of changes:
 src/key.c | 8 ++++++++
 1 file changed, 8 insertions(+)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list