summaryrefslogtreecommitdiff
path: root/pith
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-09-08 19:54:58 -0600
committerEduardo Chappa <chappa@washington.edu>2015-09-08 19:54:58 -0600
commit8cc4a2fc0e42e07a61d51bffd882d9251332a5ed (patch)
treeb653ba39179b7ee4b2e35eb9b11ecc7fedb0d0f6 /pith
parent92569d7853a2ffde330ecf62f198d61891b72f83 (diff)
downloadalpine-8cc4a2fc0e42e07a61d51bffd882d9251332a5ed.tar.xz
* SMIME: add full year when displaying information about a certificate
in the certificate management screen. Suggested by Matthias Rieber. * SMIME: sort certificates by some type of alphabetical order in the displayed name.
Diffstat (limited to 'pith')
-rw-r--r--pith/pine.hlp8
-rw-r--r--pith/smkeys.c14
2 files changed, 15 insertions, 7 deletions
diff --git a/pith/pine.hlp b/pith/pine.hlp
index c45b1e97..21a18299 100644
--- a/pith/pine.hlp
+++ b/pith/pine.hlp
@@ -140,7 +140,7 @@ with help text for the config screen and the composer that didn't have any
reasonable place to be called from.
Dummy change to get revision in pine.hlp
============= h_revision =================
-Alpine Commit 100 2015-09-07 20:04:59
+Alpine Commit 101 2015-09-08 19:54:50
============= h_news =================
<HTML>
<HEAD>
@@ -254,6 +254,12 @@ Additions include:
<LI> Reimplementation of the code that allows the .pinerc file to be a
symbolic link by Kyle George from tcpsoft.com to use realpath.
+
+ <LI> SMIME: add full year when displaying information about a certificate
+ in the certificate management screen. Suggested by Matthias Rieber.
+
+ <LI> SMIME: sort certificates by some type of alphabetical order in the
+ displayed name.
</UL>
diff --git a/pith/smkeys.c b/pith/smkeys.c
index d84aa222..73e3cdbe 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -284,9 +284,9 @@ resort_certificates(CertList **data, WhichCerts ctype)
return;
for(i = 0; cl; cl = cl->next, i++)
- if(ctype != Private){ /* ctype == Public or ctype == CACerts */
- for(t = s = cl->name; (t = strstr(s, ".crt")) != NULL; s = t+1);
- if (s) *(s-1) = '\0';
+ if(SMHOLDERTYPE(ctype) == Directory && ctype != Private){
+ for(t = s = cl->name; (t = strstr(s, ".crt")) != NULL; s = t+1);
+ if (s) *(s-1) = '\0';
}
j = i;
cll = fs_get(i*sizeof(CertList *));
@@ -295,10 +295,10 @@ resort_certificates(CertList **data, WhichCerts ctype)
qsort((void *)cll, j, sizeof(CertList *), compare_certs_by_name);
for(i = 0; i < j - 1; i++){
cll[i]->next = cll[i+1];
- if(ctype != Private)
+ if(SMHOLDERTYPE(ctype) == Directory && ctype != Private)
cll[i]->name[strlen(cll[i]->name)]= '.'; /* restore ".crt" part */
}
- if(ctype != Private)
+ if(SMHOLDERTYPE(ctype) == Directory && ctype != Private)
cll[j-1]->name[strlen(cll[j-1]->name)]= '.'; /* restore ".crt" part */
cll[j-1]->next = NULL;
*data = cll[0];
@@ -408,7 +408,7 @@ smime_get_date(ASN1_GENERALIZEDTIME *tm)
if(F_ON(F_DATES_TO_LOCAL,ps_global)){
parse_date(convert_date_to_local(date), &smd);
memset(&smtm, 0, sizeof(smtm));
- smtm.tm_year = MIN(MAX(smd.year-1900, 0), 2000) % 100 - 1900;
+ smtm.tm_year = smd.year - 1900;
smtm.tm_mon = MIN(MAX(smd.month-1, 0), 11);
smtm.tm_mday = MIN(MAX(smd.day, 1), 31);
our_strftime(buf, sizeof(buf), "%x", &smtm);
@@ -1128,6 +1128,8 @@ mem_to_certlist(char *contents, WhichCerts ctype)
*save_p = '\n';
}
}
+ if(ret != NULL)
+ resort_certificates(&ret, ctype);
return ret;
}