mirror of
https://abf.rosa.ru/djam/libressl.git
synced 2025-02-23 08:02:54 +00:00
56 lines
1.6 KiB
Diff
56 lines
1.6 KiB
Diff
From d2e4509e4ce2b6b622291a9879e41dc0717774a0 Mon Sep 17 00:00:00 2001
|
|
From: Mikhail Novosyolov <m.novosyolov@rosalinux.ru>
|
|
Date: Fri, 29 Nov 2019 21:24:49 +0300
|
|
Subject: [PATCH 01/87] Allow custom config location
|
|
|
|
I want LibreSSL to:
|
|
- coexist with OpenSSL
|
|
- be installed into /opt
|
|
- do not conflict with OpenSSL devel packages
|
|
- use /etc/ssl (/etc/pki/tls in ROSA) from OpenSSL
|
|
|
|
For this purpose, it is required to be able to separate configs of OpenSSL and LibreSSL.
|
|
|
|
Example:
|
|
export CFLAGS="$CFLAGS -DX509_CONF_FILE='\"/etc/ssl/libressl.cnf\"'"
|
|
---
|
|
src/lib/libcrypto/conf/conf_mod.c | 4 ++++
|
|
src/usr.bin/openssl/apps.c | 4 ++++
|
|
2 files changed, 8 insertions(+)
|
|
|
|
diff --git a/src/lib/libcrypto/conf/conf_mod.c b/src/lib/libcrypto/conf/conf_mod.c
|
|
index 9f252385e..f5271c89d 100644
|
|
--- a/src/lib/libcrypto/conf/conf_mod.c
|
|
+++ b/src/lib/libcrypto/conf/conf_mod.c
|
|
@@ -545,8 +545,12 @@ CONF_get1_default_config_file(void)
|
|
{
|
|
char *file = NULL;
|
|
|
|
+#ifndef X509_CONF_FILE
|
|
if (asprintf(&file, "%s/openssl.cnf",
|
|
X509_get_default_cert_area()) == -1)
|
|
+#else
|
|
+ if (asprintf(&file, X509_CONF_FILE) == -1)
|
|
+#endif
|
|
return (NULL);
|
|
return file;
|
|
}
|
|
diff --git a/src/usr.bin/openssl/apps.c b/src/usr.bin/openssl/apps.c
|
|
index c9a2f34b2..313d6ecee 100644
|
|
--- a/src/usr.bin/openssl/apps.c
|
|
+++ b/src/usr.bin/openssl/apps.c
|
|
@@ -1213,7 +1213,11 @@ make_config_name()
|
|
const char *t = X509_get_default_cert_area();
|
|
char *p;
|
|
|
|
+#ifndef X509_CONF_FILE
|
|
if (asprintf(&p, "%s/openssl.cnf", t) == -1)
|
|
+#else
|
|
+ if (asprintf(&p, X509_CONF_FILE) == -1)
|
|
+#endif
|
|
return NULL;
|
|
return p;
|
|
}
|
|
--
|
|
2.17.1
|
|
|