diff options
author | Johan Lorensson <lateralusx.github@gmail.com> | 2019-05-09 14:09:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-09 14:09:36 +0300 |
commit | 0689d47c59ebf68c25935287c2971f575201a799 (patch) | |
tree | 5b98be4207f8a0d22ecef07b01a6ac38f5cd3e3d | |
parent | 3d87996698b28b3ab81dc3d410565733c4147b98 (diff) | |
parent | be8b497ece35296ea5e42f5044790c94d6f347e9 (diff) |
Merge pull request #19 from lateralusX/lateralusX/fix-lookup-add-dir
Fix X509_LOOKUP_add_dir to work with Windows paths.
-rw-r--r-- | crypto/x509/by_dir.c | 8 | ||||
-rw-r--r-- | crypto/x509/x509_def.c | 10 |
2 files changed, 17 insertions, 1 deletions
diff --git a/crypto/x509/by_dir.c b/crypto/x509/by_dir.c index 4445b058..25d5f9a0 100644 --- a/crypto/x509/by_dir.c +++ b/crypto/x509/by_dir.c @@ -68,6 +68,12 @@ #include "../internal.h" +#ifdef OPENSSL_WINDOWS +#define LIST_SEPARATOR_CHAR ';' +#else +#define LIST_SEPARATOR_CHAR ':' +#endif + typedef struct lookup_dir_hashes_st { unsigned long hash; int suffix; @@ -203,7 +209,7 @@ static int add_cert_dir(BY_DIR *ctx, const char *dir, int type) s = dir; p = s; do { - if ((*p == ':') || (*p == '\0')) { + if ((*p == LIST_SEPARATOR_CHAR) || (*p == '\0')) { BY_DIR_ENTRY *ent; ss = s; s = p + 1; diff --git a/crypto/x509/x509_def.c b/crypto/x509/x509_def.c index 2bf2240c..cb0f5af0 100644 --- a/crypto/x509/x509_def.c +++ b/crypto/x509/x509_def.c @@ -59,7 +59,17 @@ /* TODO(fork): cleanup */ +#ifdef OPENSSL_WINDOWS +/* OpenSSL defaults on Windows. */ +#if _WIN64 +#define OPENSSLDIR "C:\\Program Files\\Common Files\\SSL" +#else +#define OPENSSLDIR "C:\\Program Files (x86)\\Common Files\\SSL" +#endif +#else #define OPENSSLDIR "/etc/ssl" +#endif + #define X509_CERT_AREA OPENSSLDIR #define X509_CERT_DIR OPENSSLDIR "/certs" #define X509_CERT_FILE OPENSSLDIR "/cert.pem" |