summaryrefslogtreecommitdiff
path: root/pith/smkeys.h
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2016-09-03 18:44:40 -0600
committerEduardo Chappa <chappa@washington.edu>2016-09-03 18:44:40 -0600
commitbe296fed0db493bd09c0ffd4ee67e8687eb69c1d (patch)
treeaa64a53975e17167c11209cb2fdaeb3addbc2c60 /pith/smkeys.h
parent7663f0dd87d15a7b53b81aecef8aaf5efd100d3f (diff)
downloadalpine-be296fed0db493bd09c0ffd4ee67e8687eb69c1d.tar.xz
* Alpine does not build with openssl 1.1.0, so this update fixes that.
Users have the option to build with older versions of OpenSSL or with version 1.1.0. The current code is transitional and it is intended that we will move Alpine to build exclusively with version 1.1.0 or above in the future. This update also recognizes if we are using LibreSSL. It was tested with version 2.4.2.
Diffstat (limited to 'pith/smkeys.h')
-rw-r--r--pith/smkeys.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/pith/smkeys.h b/pith/smkeys.h
index 8c23d905..0d3570bc 100644
--- a/pith/smkeys.h
+++ b/pith/smkeys.h
@@ -29,7 +29,16 @@
#include <openssl/pem.h>
#include <openssl/err.h>
#include <openssl/bio.h>
+#include <openssl/safestack.h>
+#ifndef OPENSSL_1_1_0
+#define X509_get0_notBefore(x) ((x) && (x)->cert_info \
+ ? (x)->cert_info->validity->notBefore \
+ : NULL)
+#define X509_get0_notAfter(x) ((x) && (x)->cert_info \
+ ? (x)->cert_info->validity->notAfter \
+ : NULL)
+#endif /* OPENSSL_1_1_0 */
#define EMAILADDRLEADER "emailAddress="
#define CACERTSTORELEADER "cacert="
@@ -64,10 +73,10 @@ void free_personal_certs(PERSONAL_CERT **pc);
void get_fingerprint(X509 *cert, const EVP_MD *type, char *buf, size_t maxLen, char *s);
int certlist_to_file(char *filename, CertList *certlist);
int load_cert_for_key(char *pathdir, EVP_PKEY *pkey, char **certfile, X509 **pcert);
-char *smime_get_date(ASN1_GENERALIZEDTIME *tm);
+char *smime_get_date(const ASN1_TIME *tm);
void resort_certificates(CertList **data, WhichCerts ctype);
int setup_certs_backup_by_type(WhichCerts ctype);
-char *smime_get_cn(X509_NAME *);
+char *smime_get_cn(X509 *);
CertList *smime_X509_to_cert_info(X509 *, char *);