diff options
author | Andre Heinecke <[email protected]> | 2017-02-01 15:16:22 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2017-02-01 15:17:07 +0000 |
commit | a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b (patch) | |
tree | 3fd263ce57b641e3ffa107c3aa7f6c94ca6a8922 /src/key.c | |
parent | qt: Increase timeout when waiting for signals. (diff) | |
download | gpgme-a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b.tar.gz gpgme-a28d31fdb623f2ee30e8094d09f1a0d1ae446a9b.zip |
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 [email protected] was:
uid->name = "[email protected]"
uid->email = ""
uid->address = "[email protected]"
It is now:
uid->name = ""
uid->email = "[email protected]"
uid->address = "[email protected]"
Diffstat (limited to 'src/key.c')
-rw-r--r-- | src/key.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -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; |