aboutsummaryrefslogtreecommitdiffstats
path: root/testing/litespeed/libressl.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-11-10 14:46:09 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2017-11-10 16:14:35 +0000
commit996eb8d89469696ab8a55377818ac2aed478949e (patch)
treeb9bb56c31ee7de090f2d24d46c287dd388d0e19a /testing/litespeed/libressl.patch
parente38d407f1156c45a0c83d740aef9a2e6d078bc9c (diff)
downloadaports-996eb8d89469696ab8a55377818ac2aed478949e.tar.bz2
aports-996eb8d89469696ab8a55377818ac2aed478949e.tar.xz
testing/litespeed: upgrade to 1.4.28
Diffstat (limited to 'testing/litespeed/libressl.patch')
-rw-r--r--testing/litespeed/libressl.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/testing/litespeed/libressl.patch b/testing/litespeed/libressl.patch
new file mode 100644
index 0000000000..c3476789a4
--- /dev/null
+++ b/testing/litespeed/libressl.patch
@@ -0,0 +1,53 @@
+diff --git a/src/sslpp/sslcontext.cpp b/src/sslpp/sslcontext.cpp
+index a701325..341b2da 100644
+--- a/src/sslpp/sslcontext.cpp
++++ b/src/sslpp/sslcontext.cpp
+@@ -723,7 +723,7 @@ int SslContext::enableSpdy(int level)
+ #ifdef TLSEXT_TYPE_application_layer_protocol_negotiation
+ SSL_CTX_set_alpn_select_cb(m_pCtx, SSLConntext_alpn_select_cb, this);
+ #endif
+-#ifdef TLSEXT_TYPE_next_proto_neg
++#if defined(TLSEXT_TYPE_next_proto_neg) || defined(LIBRESSL_VERSION_NUMBER)
+ SSL_CTX_set_next_protos_advertised_cb(m_pCtx,
+ SslConnection_ssl_npn_advertised_cb, this);
+ #else
+diff --git a/src/sslpp/sslutil.cpp b/src/sslpp/sslutil.cpp
+index 6561c04..afd9272 100644
+--- a/src/sslpp/sslutil.cpp
++++ b/src/sslpp/sslutil.cpp
+@@ -851,7 +851,16 @@ int SslUtil::getPrivateKeyPem(SSL_CTX *pCtx, AutoBuf *pBuf)
+ {
+ int ret = -1;
+ BIO *pOut = BIO_new(BIO_s_mem());
+- EVP_PKEY *pKey = SSL_CTX_get0_privatekey(pCtx);
++ EVP_PKEY *pKey = NULL;
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
++ pKey = SSL_CTX_get0_privatekey(pCtx);
++#else
++ SSL *ssl = SSL_new(pCtx);
++ if (!ssl)
++ return ret;
++ pKey = SSL_get_privatekey(ssl);
++ SSL_free(ssl);
++#endif
+
+ if (PEM_write_bio_PrivateKey(pOut, pKey, NULL, NULL, 0, NULL, NULL))
+ ret = bioToBuf(pOut, pBuf);
+@@ -863,7 +872,16 @@ int SslUtil::getCertPem(SSL_CTX *pCtx, AutoBuf *pBuf)
+ {
+ int ret = -1;
+ BIO *pOut = BIO_new(BIO_s_mem());
+- X509 *pCert = SSL_CTX_get0_certificate(pCtx);
++ X509 *pCert = NULL;
++#if OPENSSL_VERSION_NUMBER >= 0x10002000L && !defined(LIBRESSL_VERSION_NUMBER)
++ pCert = SSL_CTX_get0_certificate(pCtx);
++#else
++ SSL *ssl = SSL_new(pCtx);
++ if (!ssl)
++ return ret;
++ pCert = SSL_get_certificate(ssl);
++ SSL_free(ssl);
++#endif
+
+ if (PEM_write_bio_X509(pOut, pCert))
+ ret = bioToBuf(pOut, pBuf);