summaryrefslogtreecommitdiff
path: root/pith/smkeys.c
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2015-09-06 21:26:01 -0600
committerEduardo Chappa <chappa@washington.edu>2015-09-06 21:26:01 -0600
commitf8f7276fc6502c61e0274bb823168e0077066f8f (patch)
tree3b18d9543603a9516b896ddafd4d5bf66f9e17bd /pith/smkeys.c
parent1fb52f967889d83c23fdd8f3054f5776351ebe85 (diff)
downloadalpine-f8f7276fc6502c61e0274bb823168e0077066f8f.tar.xz
Revert "Revert " * S/MIME: information on certificates is now available for certificates""
This reverts commit 1fb52f967889d83c23fdd8f3054f5776351ebe85.
Diffstat (limited to 'pith/smkeys.c')
-rw-r--r--pith/smkeys.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pith/smkeys.c b/pith/smkeys.c
index bb77b030..7e992a53 100644
--- a/pith/smkeys.c
+++ b/pith/smkeys.c
@@ -1249,6 +1249,7 @@ void
add_to_end_of_certlist(CertList **cl, char *name, X509 *cert)
{
CertList *new, *clp;
+ char buf[MAILTMPLEN];
if(!cl)
return;
@@ -1257,6 +1258,12 @@ add_to_end_of_certlist(CertList **cl, char *name, X509 *cert)
memset((void *) new, 0, sizeof(*new));
new->x509_cert = cert;
new->name = name ? cpystr(name) : NULL;
+ if(cert && cert->cert_info){
+ new->data.date_from = smime_get_date(cert->cert_info->validity->notBefore);
+ new->data.date_to = smime_get_date(cert->cert_info->validity->notAfter);
+ get_fingerprint(cert, EVP_md5(), buf, sizeof(buf), NULL);
+ new->data.md5 = cpystr(buf);
+ }
if(!*cl){
*cl = new;