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.

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 [ruby/openssl] require OpenSSL >= 1.0.2 and LibreSSL >= 3.1 2021-07-18 17:44:41 +09:00
openssl_missing.h [ruby/openssl] pkey: remove unused ossl_generate_cb_2() helper function 2021-07-18 17:44:50 +09:00
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 [ruby/openssl] Add OpenSSL::BN#set_flags and #get_flags 2021-07-18 17:45:02 +09:00
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 [ruby/openssl] Suppress printf format warnings 2021-09-12 22:49:01 +09:00
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 [ruby/openssl] Add example to OpenSSL::KDF.hkdf method (https://github.com/ruby/openssl/pull/447) 2021-07-18 17:48:49 +09:00
ossl_kdf.h
ossl_ns_spki.c
ossl_ns_spki.h
ossl_ocsp.c [ruby/openssl] Fix some typos [ci skip] 2021-07-18 17:44:54 +09:00
ossl_ocsp.h
ossl_pkcs7.c [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding first 2021-07-18 17:44:54 +09:00
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 [ruby/openssl] pkey: remove deprecated parameter setters 2021-07-18 17:44:56 +09:00
ossl_pkey_dh.c [ruby/openssl] pkey/dh, pkey/ec: use EVP_PKEY_check() family 2021-07-18 17:44:52 +09:00
ossl_pkey_dsa.c [ruby/openssl] pkey/dsa: refactor DSA#sys{sign,verify} with PKey#{sign,verify}_raw 2021-07-18 17:45:01 +09:00
ossl_pkey_ec.c [ruby/openssl] require Ruby 2.6 or later 2021-10-16 19:39:13 +09:00
ossl_pkey_rsa.c [ruby/openssl] pkey/rsa: port RSA#{private,public}_{encrypt,decrypt} to the EVP API 2021-07-18 17:44:59 +09:00
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 [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding first 2021-07-18 17:44:54 +09:00
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 [ruby/openssl] require OpenSSL >= 1.0.2 and LibreSSL >= 3.1 2021-07-18 17:44:41 +09:00
ossl_x509.h
ossl_x509attr.c
ossl_x509cert.c [ruby/openssl] Strip trailing spaces 2021-07-18 18:04:50 +09:00
ossl_x509crl.c [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding first 2021-07-18 17:44:54 +09:00
ossl_x509ext.c
ossl_x509name.c
ossl_x509req.c [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding first 2021-07-18 17:44:54 +09:00
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