1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
yugui 2013-05-13 02:08:59 +00:00
parent 0dc6dcfb6a
commit ee22fad45d
2 changed files with 18 additions and 3 deletions

View file

@ -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]

View file

@ -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))