commit: 762dee6c53a540946e0c270d7d585464086782e5
Author: Matthias Hauber fnordpipe org>
AuthorDate: Mon Oct 1 21:31:27 2018 +
Commit: Michał Górny gentoo org>
CommitDate: Sat Oct 6 07:11:00 2018 +
URL:https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=762dee6c
dev-lua/lua-openssl: fix libressl build
backports libressl compat from master branch and disables
cms, sm2 and srp.
Additionally set dependency to libressl < 2.7.0 because there
are changes in the libressl-2.7 api that raises
a lot of incompatible pointer types.
Closes: https://bugs.gentoo.org/667390
Signed-off-by: Matthias Hauber fnordpipe.org>
Signed-off-by: Michał Górny gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/10039
.../files/0001-fix-libressl-compat.patch | 433 +
dev-lua/lua-openssl/lua-openssl-0.7.3.ebuild | 4 +-
2 files changed, 436 insertions(+), 1 deletion(-)
diff --git a/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch
b/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch
new file mode 100644
index 000..19b0539c082
--- /dev/null
+++ b/dev-lua/lua-openssl/files/0001-fix-libressl-compat.patch
@@ -0,0 +1,433 @@
+From 44d5360d0caed1f4f364691f789fe825fcd17a3e Mon Sep 17 00:00:00 2001
+From: crito
+Date: Mon, 1 Oct 2018 20:10:05 +0200
+Subject: [PATCH] fix libressl compat
+
+add conditions to build with libressl and add missing functions.
+backported from upstream repo.
+---
+ src/compat.c | 11 ---
+ src/digest.c | 2 +-
+ src/ec.c | 2 +-
+ src/engine.c | 10 +-
+ src/lhash.c | 7 ---
+ src/openssl.c | 12 ++--
+ src/ots.c | 5 +
+ src/pkcs7.c | 24
+ src/private.h | 7 ---
+ src/sm2.c | 2 +-
+ src/srp.c | 3 ++-
+ src/x509.c| 2 +-
+ 12 files changed, 54 insertions(+), 33 deletions(-)
+
+diff --git a/src/compat.c b/src/compat.c
+index cc4cc21..cc45845 100644
+--- a/src/compat.c
b/src/compat.c
+@@ -5,7 +5,7 @@
+ #include "openssl.h"
+ #include "private.h"
+
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ int BIO_up_ref(BIO *b)
+ {
+ CRYPTO_add(>references, 1, CRYPTO_LOCK_BIO);
+@@ -16,6 +16,11 @@ int X509_up_ref(X509 *x)
+ CRYPTO_add(>references, 1, CRYPTO_LOCK_X509);
+ return 1;
+ }
++int X509_CRL_up_ref(X509_CRL *x)
++{
++ int refs = CRYPTO_add(>references, 1, CRYPTO_LOCK_X509_CRL);
++ return (refs > 1) ? 1 : 0;
++}
+ int X509_STORE_up_ref(X509_STORE *s)
+ {
+ CRYPTO_add(>references, 1, CRYPTO_LOCK_X509_STORE);
+@@ -464,7 +469,7 @@ const ASN1_BIT_STRING
*TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *a)
+ return a->failure_info;
+ }
+
+-#if OPENSSL_VERSION_NUMBER < 0x10002000L
++#if OPENSSL_VERSION_NUMBER < 0x10002000L || defined(LIBRESSL_VERSION_NUMBER)
+ int i2d_re_X509_tbs(X509 *x, unsigned char **pp)
+ {
+ x->cert_info->enc.modified = 1;
+@@ -527,4 +532,4 @@ unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX
*ctx,
+ return ctx->imprint;
+ }
+
+-#endif /* < 1.1.0 */
+\ No newline at end of file
++#endif /* < 1.1.0 */
+diff --git a/src/digest.c b/src/digest.c
+index 02e8fe1..0dcf65b 100644
+--- a/src/digest.c
b/src/digest.c
+@@ -468,7 +468,7 @@ restore md data
+ static LUA_FUNCTION(openssl_digest_ctx_data)
+ {
+ EVP_MD_CTX *ctx = CHECK_OBJECT(1, EVP_MD_CTX, "openssl.evp_digest_ctx");
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ if (lua_isnone(L, 2))
+ {
+ lua_pushlstring(L, ctx->md_data, ctx->digest->ctx_size);
+diff --git a/src/ec.c b/src/ec.c
+index f0d2b6b..5db32db 100644
+--- a/src/ec.c
b/src/ec.c
+@@ -611,7 +611,7 @@ static int openssl_ecdsa_set_method(lua_State *L)
+ {
+ EC_KEY *ec = CHECK_OBJECT(1, EC_KEY, "openssl.ec_key");
+ ENGINE *e = CHECK_OBJECT(2, ENGINE, "openssl.engine");
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ const ECDSA_METHOD *m = ENGINE_get_ECDSA(e);
+ if (m) {
+ int r = ECDSA_set_method(ec, m);
+diff --git a/src/engine.c b/src/engine.c
+index 1a26d8b..f12ca53 100644
+--- a/src/engine.c
b/src/engine.c
+@@ -14,7 +14,7 @@ enum
+ {
+ TYPE_RSA,
+ TYPE_DSA,
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ TYPE_ECDH,
+ TYPE_ECDSA,
+ #else
+@@ -24,7 +24,7 @@ enum
+ TYPE_RAND,
+ TYPE_CIPHERS,
+ TYPE_DIGESTS,
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)
+ TYPE_STORE,
+ #else
+ TYPE_PKEY_METHODS,
+@@ -150,7 +150,7 @@ static int openssl_engine_register(lua_State*L)
+ else
+ ENGINE_register_DSA(eng);
+ break;
+-#if OPENSSL_VERSION_NUMBER < 0x1010L
++#if OPENSSL_VERSION_NUMBER < 0x1010L || defined(LIBRESSL_VERSION_NUMBER)