diff options
Diffstat (limited to 'community/crystal/libressl.patch')
-rw-r--r-- | community/crystal/libressl.patch | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/community/crystal/libressl.patch b/community/crystal/libressl.patch index 680c50e5e5..71e761e782 100644 --- a/community/crystal/libressl.patch +++ b/community/crystal/libressl.patch @@ -1,16 +1,11 @@ -From a834b9a274b5dcb076b64ca855bcccc322cdd07c Mon Sep 17 00:00:00 2001 -From: lvmbdv <ata.kuyumcu@protonmail.com> -Date: Fri, 2 Feb 2018 23:31:19 +0300 -Subject: [PATCH] Fixed OpenSSL bindings to recognize LibreSSL +Hack OpenSSL bindings to recognize LibreSSL -This patch is ported from https://github.com/crystal-lang/crystal/pull/5676. +This patch is based on https://github.com/crystal-lang/crystal/pull/5676. diff --git a/src/openssl/lib_crypto.cr b/src/openssl/lib_crypto.cr -index 458ad13..7e42604 100644 --- a/src/openssl/lib_crypto.cr +++ b/src/openssl/lib_crypto.cr -@@ -1,11 +1,23 @@ - {% begin %} +@@ -2,10 +2,22 @@ lib LibCrypto - OPENSSL_110 = {{ `command -v pkg-config > /dev/null && pkg-config --atleast-version=1.1.0 libcrypto || printf %s false`.stringify != "false" }} - OPENSSL_102 = {{ `command -v pkg-config > /dev/null && pkg-config --atleast-version=1.0.2 libcrypto || printf %s false`.stringify != "false" }} @@ -23,7 +18,7 @@ index 458ad13..7e42604 100644 end {% end %} --@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs libcrypto || printf %s '-lcrypto'`")] +-@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libcrypto || printf %s '-lcrypto'`")] +{% begin %} + lib LibCrypto + OPENSSL_110 = {{ (LibCrypto::LIBRESSL_VERSION == 0) && (LibCrypto::OPENSSL_VERSION >= 0x10101000) }} @@ -37,10 +32,9 @@ index 458ad13..7e42604 100644 alias Char = LibC::Char alias Int = LibC::Int diff --git a/src/openssl/lib_ssl.cr b/src/openssl/lib_ssl.cr -index e69f82b..b8786b8 100644 --- a/src/openssl/lib_ssl.cr +++ b/src/openssl/lib_ssl.cr -@@ -2,12 +2,13 @@ require "./lib_crypto" +@@ -2,8 +2,9 @@ {% begin %} lib LibSSL @@ -52,12 +46,7 @@ index e69f82b..b8786b8 100644 end {% end %} --@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs libssl || printf %s '-lssl -lcrypto'`")] -+@[Link(ldflags: "`command -v pkg-config > /dev/null && pkg-config --libs --silence-errors libssl || printf %s '-lssl -lcrypto'`")] - lib LibSSL - alias Int = LibC::Int - alias Char = LibC::Char -@@ -198,13 +199,17 @@ lib LibSSL +@@ -198,13 +199,17 @@ fun sslv23_method = SSLv23_method : SSLMethod {% end %} @@ -79,7 +68,6 @@ index e69f82b..b8786b8 100644 fun ssl_ctx_set1_param = SSL_CTX_set1_param(ctx : SSLContext, param : X509VerifyParam) : Int {% end %} diff --git a/src/openssl/ssl/context.cr b/src/openssl/ssl/context.cr -index b21568d..a694abd 100644 --- a/src/openssl/ssl/context.cr +++ b/src/openssl/ssl/context.cr @@ -304,7 +304,7 @@ abstract class OpenSSL::SSL::Context @@ -103,7 +91,6 @@ index b21568d..a694abd 100644 # # Depending on the OpenSSL version, the available defaults are diff --git a/src/openssl/ssl/socket.cr b/src/openssl/ssl/socket.cr -index 10fc100..14c3c16 100644 --- a/src/openssl/ssl/socket.cr +++ b/src/openssl/ssl/socket.cr @@ -119,7 +119,7 @@ abstract class OpenSSL::SSL::Socket < IO @@ -115,6 +102,3 @@ index 10fc100..14c3c16 100644 # Returns the negotiated ALPN protocol (eg: `"h2"`) of `nil` if no protocol was # negotiated. def alpn_protocol --- -2.10.1 (Apple Git-78) - |