aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-09-19 21:46:50 +0530
committerLibravatarLibravatar Biswakalyan Bhuyan <biswa@surgot.in> 2024-09-25 19:54:52 +0530
commitb1bafcdc9759edf5b4745ee531bd7afc4c7d8045 (patch)
tree2f54f88464d896ff48e98d61ed431333de7b905b
parent8e9622c22f76d550594212c8bf5057f39d76f383 (diff)
downloadluaossl-b1bafcdc9759edf5b4745ee531bd7afc4c7d8045.tar.gz
luaossl-b1bafcdc9759edf5b4745ee531bd7afc4c7d8045.tar.bz2
luaossl-b1bafcdc9759edf5b4745ee531bd7afc4c7d8045.zip
update: LibreSSL support
-rw-r--r--README.md1
-rw-r--r--src/openssl.c18
2 files changed, 12 insertions, 7 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..5fea034
--- /dev/null
+++ b/README.md
@@ -0,0 +1 @@
+# Fork of this [project](https://github.com/wahern/luaossl/pull/210/commits/5b53c31906d59e42e0b5312ea9440971a36f218e)
diff --git a/src/openssl.c b/src/openssl.c
index db64d03..6f18a8f 100644
--- a/src/openssl.c
+++ b/src/openssl.c
@@ -320,7 +320,7 @@
#endif
#ifndef HAVE_I2D_RE_X509_REQ_TBS
-#define HAVE_I2D_RE_X509_REQ_TBS OPENSSL_PREREQ(1,1,0)
+#define HAVE_I2D_RE_X509_REQ_TBS (OPENSSL_PREREQ(1,1,0) || LIBRESSL_PREREQ(3,5,1))
#endif
#ifndef HAVE_RSA_GET0_CRT_PARAMS
@@ -376,7 +376,7 @@
#endif
#ifndef HAVE_SSL_CTX_SET_GROUPS_LIST
-#if OPENSSL_PREREQ(1,1,1)
+#if (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#define HAVE_SSL_CTX_SET_GROUPS_LIST 1
#elif HAVE_SSL_CTX_SET_CURVES_LIST
#define SSL_CTX_set1_groups_list SSL_CTX_set1_curves_list
@@ -387,7 +387,7 @@
#endif
#ifndef HAVE_SSL_CTX_SET_GROUPS_LIST
-#define HAVE_SSL_CTX_SET_GROUPS_LIST OPENSSL_PREREQ(1,1,1)
+#define HAVE_SSL_CTX_SET_GROUPS_LIST (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#endif
#ifndef HAVE_SSL_CTX_SET_ECDH_AUTO
@@ -423,7 +423,7 @@
#endif
#ifndef HAVE_SSL_CTX_CERT_STORE
-#define HAVE_SSL_CTX_CERT_STORE (!OPENSSL_PREREQ(1,1,0))
+#define HAVE_SSL_CTX_CERT_STORE (!OPENSSL_PREREQ(1,1,0) && !LIBRESSL_PREREQ(2,0,0))
#endif
#ifndef HAVE_SSL_CTX_SET_TLSEXT_STATUS_TYPE
@@ -491,7 +491,7 @@
#endif
#ifndef HAVE_SSL_SET_GROUPS_LIST
-#if OPENSSL_PREREQ(1,1,1)
+#if (OPENSSL_PREREQ(1,1,1) || LIBRESSL_PREREQ(2,7,1))
#define HAVE_SSL_SET_GROUPS_LIST 1
#elif HAVE_SSL_SET_CURVES_LIST
#define SSL_set1_groups_list SSL_set1_curves_list
@@ -582,7 +582,7 @@
#endif
#ifndef HAVE_X509_STORE_REFERENCES
-#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0))
+#define HAVE_X509_STORE_REFERENCES (!OPENSSL_PREREQ(1,1,0) && LIBRESSL_PREREQ(2,0,0))
#endif
#ifndef HAVE_X509_STORE_UP_REF
@@ -1986,7 +1986,11 @@ static size_t compat_SSL_SESSION_get_master_key(const SSL_SESSION *session, unsi
#define SSL_client_version(...) EXPAND( compat_SSL_client_version(__VA_ARGS__) )
static int compat_SSL_client_version(const SSL *ssl) {
- return ssl->client_version;
+ #if LIBRESSL_PREREQ(2,5,2)
+ return SSL_version(ssl);
+ #else
+ return ssl->client_version;
+ #endif
} /* compat_SSL_client_version() */
#endif