diff options
author | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-13 02:08:59 +0000 |
---|---|---|
committer | yugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-13 02:08:59 +0000 |
commit | ee22fad45d394818690c4a7586d7bb576ba67c56 (patch) | |
tree | 209686fe8c9460ee0992b998e5353a94c2f06756 | |
parent | 0dc6dcfb6a3ecc25ac673c728645ab98925b8411 (diff) | |
download | ruby-ee22fad45d394818690c4a7586d7bb576ba67c56.tar.gz |
* ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if
defined(OPENSSL_NO_SOCK).
This fixes a linkage error on platforms which do not have socket.
OpenSSL itself is still useful as a set of cryptographic functions
even on such platforms.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40680 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | ext/openssl/ossl_ssl.c | 12 |
2 files changed, 18 insertions, 3 deletions
@@ -1,3 +1,12 @@ +Mon May 13 10:20:59 2013 Yuki Yugui Sonoda <yugui@google.com> + + * ext/openssl/ossl_ssl.c: Disabled OpenSSL::SSL::SSLSocket if + defined(OPENSSL_NO_SOCK). + + This fixes a linkage error on platforms which do not have socket. + OpenSSL itself is still useful as a set of cryptographic functions + even on such platforms. + Mon May 13 10:30:04 2013 Zachary Scott <zachary@zacharyscott.net> * hash.c: Hash[] and {} are not equivalent by @eam [Fixes GH-301] diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 11a4a6b906..82b94a1018 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -1095,6 +1095,7 @@ ossl_sslctx_flush_sessions(int argc, VALUE *argv, VALUE self) /* * SSLSocket class */ +#ifndef OPENSSL_NO_SOCK static void ossl_ssl_shutdown(SSL *ssl) { @@ -1795,7 +1796,7 @@ ossl_ssl_get_client_ca_list(VALUE self) return ossl_x509name_sk2ary(ca); } -#ifdef HAVE_OPENSSL_NPN_NEGOTIATED +# ifdef HAVE_OPENSSL_NPN_NEGOTIATED /* * call-seq: * ssl.npn_protocol => String @@ -1818,7 +1819,8 @@ ossl_ssl_npn_protocol(VALUE self) else return rb_str_new((const char *) out, outlen); } -#endif +# endif +#endif /* !defined(OPENSSL_NO_SOCK) */ void Init_ossl_ssl() @@ -2149,6 +2151,9 @@ Init_ossl_ssl() * */ cSSLSocket = rb_define_class_under(mSSL, "SSLSocket", rb_cObject); +#ifdef OPENSSL_NO_SOCK + rb_define_method(cSSLSocket, "initialize", rb_notimplement, -1); +#else rb_define_alloc_func(cSSLSocket, ossl_ssl_s_alloc); for(i = 0; i < numberof(ossl_ssl_attr_readers); i++) rb_attr(cSSLSocket, rb_intern(ossl_ssl_attr_readers[i]), 1, 0, Qfalse); @@ -2177,8 +2182,9 @@ Init_ossl_ssl() rb_define_method(cSSLSocket, "session=", ossl_ssl_set_session, 1); rb_define_method(cSSLSocket, "verify_result", ossl_ssl_get_verify_result, 0); rb_define_method(cSSLSocket, "client_ca", ossl_ssl_get_client_ca_list, 0); -#ifdef HAVE_OPENSSL_NPN_NEGOTIATED +# ifdef HAVE_OPENSSL_NPN_NEGOTIATED rb_define_method(cSSLSocket, "npn_protocol", ossl_ssl_npn_protocol, 0); +# endif #endif #define ossl_ssl_def_const(x) rb_define_const(mSSL, #x, INT2NUM(SSL_##x)) |