diff options
author | Eduardo Chappa <chappa@washington.edu> | 2015-12-14 19:11:35 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2015-12-14 19:11:35 -0700 |
commit | fe6139e073a2810420a8f6f869171a262929022d (patch) | |
tree | 37960c85dfc2d4a902a600d535c74effdb0ad36c /pith/smime.c | |
parent | 29fbd1d5e424fadcf54a338aee8e57a9285fdf4b (diff) | |
download | alpine-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/smime.c')
-rw-r--r-- | pith/smime.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/pith/smime.c b/pith/smime.c index 30f42a22..e4448e74 100644 --- a/pith/smime.c +++ b/pith/smime.c @@ -928,7 +928,7 @@ certlist_from_personal_certs(PERSONAL_CERT *pc) cl = fs_get(sizeof(CertList)); memset((void *)cl, 0, sizeof(CertList)); cl->name = cpystr(pc->name); - x = get_cert_for(pc->name, Public); + x = get_cert_for(pc->name, Public, 1); if(x){ if(x->cert_info){ cl->data.date_from = smime_get_date(x->cert_info->validity->notBefore); @@ -1087,7 +1087,7 @@ get_personal_certs(char *path) /* chop off ".key" trailier */ buf2[strlen(buf2)-4] = 0; /* Look for certificate */ - cert = get_cert_for(buf2, Public); + cert = get_cert_for(buf2, Public, 1); if(cert){ PERSONAL_CERT *pc; @@ -2317,7 +2317,7 @@ encrypt_outgoing_message(METAENV *header, BODY **bodyP) for(a=*pf->addr; a; a=a->next){ snprintf(buf, sizeof(buf), "%s@%s", a->mailbox, a->host); - if((cert = get_cert_for(buf, Public)) != NULL){ + if((cert = get_cert_for(buf, Public, 1)) != NULL){ sk_X509_push(encerts,cert); }else{ q_status_message2(SM_ORDER, 1, 1, @@ -2332,7 +2332,7 @@ encrypt_outgoing_message(METAENV *header, BODY **bodyP) for(a=header->env->from; a ; a = a->next){ snprintf(buf, sizeof(buf), "%s@%s", a->mailbox, a->host); - if((cert = get_cert_for(buf, Public)) != NULL + if((cert = get_cert_for(buf, Public, 1)) != NULL && sk_X509_find(encerts, cert) == -1) sk_X509_push(encerts,cert); } @@ -2496,7 +2496,7 @@ int smime_extract_and_save_cert(PKCS7 *p7, int check_cert) if((email = get_x509_subject_email(x)) != NULL){ for(j = 0; email[j] != NULL; j++){ - if((cert = get_cert_for(email[j], Public)) == NULL + if((cert = get_cert_for(email[j], Public, 1)) == NULL || same_cert(x, cert) == 0){ if(check_cert == 0 || smime_validate_cert(x, &error) == 0 @@ -2547,7 +2547,7 @@ do_signature_verify(PKCS7 *p7, BIO *in, BIO *out, int silent) if(cl->x509_cert == NULL){ char *s = strrchr(cl->name, '.'); *s = '\0'; - cl->x509_cert = get_cert_for(cl->name, Public); + cl->x509_cert = get_cert_for(cl->name, Public, 1); *s = '.'; } } |