Skip to content

Commit

Permalink
ruby186: further openssl patches
Browse files Browse the repository at this point in the history
  • Loading branch information
mistydemeo committed Oct 29, 2014
1 parent 3e0f805 commit f986c0c
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions ruby186.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Ruby186 < Formula

# First patch backports a compatibility fix from Ruby 1.8.7 for newer OpenSSL versions
# Second patch fixes the type of a macro, also taken from 1.8.7
# Third patch fixes another OpenSSL macro, taken from Ruby 2.1.4
patch :DATA

def install
Expand Down Expand Up @@ -111,3 +112,26 @@ def caveats; <<-EOS.undent
{ \
type *t; \
int i, num; \

diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c
index c4569c7..d6f8822 100644
--- a/ext/openssl/ossl_ssl.c
+++ b/ext/openssl/ossl_ssl.c
@@ -96,13 +96,16 @@ struct {
const char *name;
SSL_METHOD *(*func)(void);
} ossl_ssl_method_tab[] = {
-#define OSSL_SSL_METHOD_ENTRY(name) { #name, name##_method }
+#define OSSL_SSL_METHOD_ENTRY(name) { #name, (SSL_METHOD *(*)(void))name##_method }
OSSL_SSL_METHOD_ENTRY(TLSv1),
OSSL_SSL_METHOD_ENTRY(TLSv1_server),
OSSL_SSL_METHOD_ENTRY(TLSv1_client),
+#if defined(HAVE_SSLV2_METHOD) && defined(HAVE_SSLV2_SERVER_METHOD) && \
+ defined(HAVE_SSLV2_CLIENT_METHOD)
OSSL_SSL_METHOD_ENTRY(SSLv2),
OSSL_SSL_METHOD_ENTRY(SSLv2_server),
OSSL_SSL_METHOD_ENTRY(SSLv2_client),
+#endif
OSSL_SSL_METHOD_ENTRY(SSLv3),
OSSL_SSL_METHOD_ENTRY(SSLv3_server),
OSSL_SSL_METHOD_ENTRY(SSLv3_client),

0 comments on commit f986c0c

Please sign in to comment.