1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/openssl
Aaron Patterson 35b9d8d393 [ruby/openssl] Raise an exception if the IO object passed to SSLSocket isn't a file
SSLSocket#connect eventually calls `GetOpenFile` in order to get the
underlying file descriptor for the IO object passed in on
initialization.  `GetOpenFile` assumes that the Ruby object passed in is
a T_FILE object and just casts it to a T_FILE without any checks.  If
you pass an object that *isn't* a T_FILE to that function, the program
will segv.

Since we assume the IO object is a file in the `connect` method, this
commit adds a `CheckType` in the initialize method to ensure that the IO
object is actually a T_FILE.  If the object *isn't* a T_FILE, this class
will segv on `connect`, so I think this is a backwards compatible
change.

https://github.com/ruby/openssl/commit/919fa44ec2
2021-10-23 13:38:40 +09:00
..
lib [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
depend [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
extconf.rb [ruby/openssl] ssl: add SSLContext#tmp_dh= 2021-10-16 18:19:52 +09:00
History.md [ruby/openssl] Ruby/OpenSSL 2.2.1 2021-10-16 18:34:35 +09:00
openssl.gemspec [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
openssl_missing.c
openssl_missing.h
ossl.c [ruby/openssl] Suppress cast-function-type warnings 2021-09-12 22:49:05 +09:00
ossl.h [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
ossl_asn1.c [ruby/openssl] Suppress cast-function-type warnings 2021-09-12 22:49:05 +09:00
ossl_asn1.h
ossl_bio.c
ossl_bio.h
ossl_bn.c
ossl_bn.h
ossl_cipher.c [ruby/openssl] Suppress cast-function-type warnings 2021-09-12 22:49:05 +09:00
ossl_cipher.h
ossl_config.c
ossl_config.h
ossl_digest.c [ruby/openssl] digest: load digest library using Kernel#require 2021-10-16 18:34:35 +09:00
ossl_digest.h
ossl_engine.c
ossl_engine.h
ossl_hmac.c
ossl_hmac.h
ossl_kdf.c
ossl_kdf.h
ossl_ns_spki.c
ossl_ns_spki.h
ossl_ocsp.c
ossl_ocsp.h
ossl_pkcs7.c
ossl_pkcs7.h
ossl_pkcs12.c [ruby/openssl] Suppress cast-function-type warnings 2021-09-12 22:49:05 +09:00
ossl_pkcs12.h
ossl_pkey.c [ruby/openssl] Suppress cast-function-type warnings 2021-09-12 22:49:05 +09:00
ossl_pkey.h
ossl_pkey_dh.c
ossl_pkey_dsa.c
ossl_pkey_ec.c [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
ossl_pkey_rsa.c
ossl_rand.c
ossl_rand.h
ossl_ssl.c [ruby/openssl] Raise an exception if the IO object passed to SSLSocket isn't a file 2021-10-23 13:38:40 +09:00
ossl_ssl.h
ossl_ssl_session.c
ossl_ts.c [ruby/openssl] fix segv in Timestamp::{Request,Response,TokenInfo}.new 2021-10-16 18:34:35 +09:00
ossl_ts.h
ossl_x509.c
ossl_x509.h
ossl_x509attr.c
ossl_x509cert.c
ossl_x509crl.c
ossl_x509ext.c
ossl_x509name.c
ossl_x509req.c
ossl_x509revoked.c
ossl_x509store.c [ruby/openssl] x509store: explicitly call rb_gc_mark() against Store/StoreContext 2021-10-16 18:34:35 +09:00