summaryrefslogtreecommitdiff
path: root/pith/smkeys.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-12-14 19:11:35 -0700
committerEduardo Chappa <chappa@washington.edu>2015-12-14 19:11:35 -0700
commitfe6139e073a2810420a8f6f869171a262929022d (patch)
tree37960c85dfc2d4a902a600d535c74effdb0ad36c /pith/smkeys.c
parent29fbd1d5e424fadcf54a338aee8e57a9285fdf4b (diff)
downloadalpine-fe6139e073a2810420a8f6f869171a262929022d.tar.xz
* S/MIME: When reading a local certificate, Alpine converts the name of
the certificate to lowercase, which may make Alpine not be able to read such certificate. Reported by Dennis Davis.
Diffstat (limited to 'pith/smkeys.c')
-rw-r--r--pith/smkeys.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/pith/smkeys.c b/pith/smkeys.c
index c5c24bcb..ce7ad873 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -865,7 +865,7 @@ save_cert_for(char *email, X509 *cert, WhichCerts ctype)
* The caller should free the cert.
*/
X509 *
-get_cert_for(char *email, WhichCerts ctype)
+get_cert_for(char *email, WhichCerts ctype, int tolower)
{
char certfilename[MAXPATH];
char emailaddr[MAXPATH];
@@ -883,7 +883,8 @@ get_cert_for(char *email, WhichCerts ctype)
emailaddr[sizeof(emailaddr)-1] = 0;
/* clean it up (lowercase, space removal) */
- emailstrclean(emailaddr);
+ if(tolower)
+ emailstrclean(emailaddr);
if(ps_global->smime->publictype == Keychain){
#ifdef APPLEKEYCHAIN
@@ -1052,7 +1053,7 @@ mem_to_personal_certs(char *contents)
if(strncmp(EMAILADDRLEADER, line, strlen(EMAILADDRLEADER)) == 0){
name = line + strlen(EMAILADDRLEADER);
- cert = get_cert_for(name, Public);
+ cert = get_cert_for(name, Public, 1);
keytext = p;
/* advance p past this record */