aboutsummaryrefslogtreecommitdiffstats
path: root/common/mbox-util.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2015-02-26 17:16:45 +0000
committerWerner Koch <[email protected]>2015-02-26 17:16:45 +0000
commitc071be698efadef1ad01fd3d329d1b486a372927 (patch)
treedcf999a07b3ae48e6f56fdcfee3e9f50756ac620 /common/mbox-util.c
parentRemove an unused variable. (diff)
downloadgnupg-c071be698efadef1ad01fd3d329d1b486a372927.tar.gz
gnupg-c071be698efadef1ad01fd3d329d1b486a372927.zip
gpg: Lowercase mailbox for PKA lookups.
* common/stringhelp.c (ascii_strlwr): New. * common/mbox-util.c (mailbox_from_userid): Downcase result. -- Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to 'common/mbox-util.c')
-rw-r--r--common/mbox-util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/common/mbox-util.c b/common/mbox-util.c
index 332f62fa8..0885f0e6f 100644
--- a/common/mbox-util.c
+++ b/common/mbox-util.c
@@ -124,8 +124,9 @@ is_valid_mailbox (const char *name)
/* Return the mailbox (local-part@domain) form a standard user id.
- Caller must free the result. Returns NULL if no valid mailbox was
- found (or we are out of memory). */
+ All plain ASCII characters in the result are converted to
+ lowercase. Caller must free the result. Returns NULL if no valid
+ mailbox was found (or we are out of memory). */
char *
mailbox_from_userid (const char *userid)
{
@@ -176,7 +177,7 @@ mailbox_from_userid (const char *userid)
else
errno = EINVAL;
- return result;
+ return result? ascii_strlwr (result): NULL;
}