summaryrefslogtreecommitdiff
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
* [Feature #18239] Implement VWA for stringsPeter Zhu2021-10-252-5/+14
| | | | | This commit adds support for embedded strings with variable capacity and uses Variable Width Allocation to allocate strings.
* Make Coverage suspendable (#4856)Yusuke Endoh2021-10-251-5/+118
| | | | | | | * Make Coverage suspendable Add `Coverage.suspend`, `Coverage.resume` and some methods. [Feature #18176] [ruby-core:105321]
* [ruby/openssl] bn: expand BIGNUM_RAND and BIGNUM_RAND_RANGE macrosKazuki Yamaguchi2021-10-251-50/+50
| | | | | | | Now that BN.pseudo_rand{,_range} are alias, those macros are only used once. Let's expand the macros for better readability. https://github.com/ruby/openssl/commit/7c2fc00dee
* [ruby/openssl] bn: make BN.pseudo_rand{,_range} an alias of BN.rand{,_range}Kazuki Yamaguchi2021-10-251-16/+2
| | | | | | | | BN_pseudo_rand() and BN_pseudo_rand_range() are deprecated in OpenSSL 3.0. Since they are identical to their non-'pseudo' version anyway, let's make them alias. https://github.com/ruby/openssl/commit/2d34e85ddf
* [ruby/openssl] pkey, ssl: use EVP_PKEY_eq() instead of EVP_PKEY_cmp()Kazuki Yamaguchi2021-10-254-3/+8
| | | | | | | OpenSSL 3.0 renamed EVP_PKEY_cmp() to EVP_PKEY_eq() because that was a confusing name. https://github.com/ruby/openssl/commit/d42bd7fcdb
* [ruby/openssl] pkey/ec: use EC_GROUP_free() instead of EC_GROUP_clear_free()Kazuki Yamaguchi2021-10-251-1/+1
| | | | | | | | | EC_GROUP_clear_free() is deprecated in OpenSSL 3.0. EC_GROUP does not include any sensitive data, so we can safely use EC_GROUP_free() instead. https://github.com/ruby/openssl/commit/e93a5fdffc
* [ruby/openssl] pkey/ec: deprecate PKey::EC::Point#make_affine! and make it a ↵Kazuki Yamaguchi2021-10-251-0/+5
| | | | | | | | | | | | | no-op It converts the internal representation of the point object to the affine coordinate system. However, it had no real use case because the difference in the internal representation has not been visible from Ruby/OpenSSL at all. EC_POINT_make_affine() is marked as deprecated in OpenSSL 3.0. https://github.com/ruby/openssl/commit/e2cc81fef7
* [ruby/openssl] hmac: use EVP_MD_CTX_get_pkey_ctx() instead of ↵Kazuki Yamaguchi2021-10-253-5/+14
| | | | | | | | | | EVP_MD_CTX_pkey_ctx() OpenSSL 3.0 renamed EVP_MD_CTX_pkey_ctx() to include "get" in the function name. Adjust compatibility macro so that we can use the new function name for all OpenSSL 1.0.2-3.0. https://github.com/ruby/openssl/commit/c106d888c6
* [ruby/openssl] digest: use EVP_MD_CTX_get0_md() instead of EVP_MD_CTX_md() ↵Kazuki Yamaguchi2021-10-254-4/+9
| | | | | | | | | | | | | | if exists The function was renamed in OpenSSL 3.0 due to the change of the lifetime of EVP_MD objects. They are no longer necessarily statically allocated and can be reference-counted -- when an EVP_MD_CTX is free'd, the associated EVP_MD can also become inaccessible. Currently Ruby/OpenSSL only handles builtin algorithms, so no special handling is needed except for adapting to the rename. https://github.com/ruby/openssl/commit/0a253027e6
* [ruby/openssl] bn: use BN_check_prime() in OpenSSL::BN#prime{,_fasttest}?Kazuki Yamaguchi2021-10-252-49/+22
| | | | | | | In OpenSSL 3.0, BN_is_prime_ex() and BN_is_prime_fasttest_ex() are deprecated in favor of BN_check_prime(). https://github.com/ruby/openssl/commit/90d51ef510
* [ruby/openssl] ssl: use SSL_get_rbio() to check if SSL is started or notKazuki Yamaguchi2021-10-251-2/+2
| | | | | | | | | | Use SSL_get_rbio() instead of SSL_get_fd(). SSL_get_fd() internally calls SSL_get_rbio() and it's enough for our purpose. In OpenSSL 3.0, SSL_get_fd() leaves an entry in the OpenSSL error queue if BIO has not been set up yet, and we would have to clean it up. https://github.com/ruby/openssl/commit/e95ee24867
* [ruby/openssl] ssl: use SSL_CTX_load_verify_{file,dir}() if availableKazuki Yamaguchi2021-10-252-0/+8
| | | | | | | SSL_CTX_load_verify_locations() is deprecated in OpenSSL 3.0 and replaced with those two separate functions. Use them if they exist. https://github.com/ruby/openssl/commit/5375a55ffc
* [ruby/openssl] ts: use TS_VERIFY_CTX_set_certs instead of ↵Kazuki Yamaguchi2021-10-253-2/+8
| | | | | | | | | TS_VERIFY_CTS_set_certs OpenSSL 3.0 fixed the typo in the function name and replaced the current 'CTS' version with a macro. https://github.com/ruby/openssl/commit/2be6779b08
* [ruby/openssl] ossl.c: use ERR_get_error_all() if availableKazuki Yamaguchi2021-10-252-19/+24
| | | | | | | OpenSSL 3.0 deprecated ERR_get_error_line_data() in favor of ERR_get_error_all(), as part of the error queue structure changes. https://github.com/ruby/openssl/commit/8e98d2ecc8
* [ruby/openssl] ext/openssl/ossl.h: add helper macros for OpenSSL/LibreSSL ↵Kazuki Yamaguchi2021-10-251-0/+12
| | | | | | | | | | | | versions Add following convenient macros: - OSSL_IS_LIBRESSL - OSSL_OPENSSL_PREREQ(maj, min, pat) - OSSL_LIBRESSL_PREREQ(maj, min, pat) https://github.com/ruby/openssl/commit/00abee791d
* [flori/json] Bump version to v2.6.1Hiroshi SHIBATA2021-10-242-2/+2
| | | | https://github.com/flori/json/commit/2db5894cfa
* [flori/json] Bump JSON::VERSION to 2.6.0.Josef Šimánek2021-10-241-1/+1
| | | | https://github.com/flori/json/commit/da94d9f059
* [ruby/psych] Prefer `require_relative` for internal requiresDavid Rodríguez2021-10-2415-49/+49
| | | | https://github.com/ruby/psych/commit/a0f55ee85a
* [ruby/psych] Add stringio as a dependency.Josef Šimánek2021-10-241-0/+2
| | | | https://github.com/ruby/psych/commit/86e3049579
* [ruby/strscan] Bump versionSutou Kouhei2021-10-241-1/+1
| | | | | | | | If we use the same version as the default strscan gem in Ruby, "gem install" doesn't extract .gem. It fails "gem install" because "gem install" can't find ext/strscan/ to be built. https://github.com/ruby/strscan/commit/3ceafa6cdc
* [ruby/openssl] Raise an exception if the IO object passed to SSLSocket isn't ↵Aaron Patterson2021-10-231-0/+1
| | | | | | | | | | | | | | | | | | | 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
* Import bigdecimal-3.1.0.devHiroshi SHIBATA2021-10-221-8/+2
|
* Bump up readline-ext version to 0.1.3Hiroshi SHIBATA2021-10-211-1/+1
|
* [ruby/io-wait] Bump up io-wait version to 0.2.0Hiroshi SHIBATA2021-10-211-1/+1
| | | | https://github.com/ruby/io-wait/commit/f6a1b10a59
* [ruby/stringio] Bump up stringio version to 3.0.1Hiroshi SHIBATA2021-10-211-1/+1
| | | | https://github.com/ruby/stringio/commit/f7c40aa339
* [ruby/psych] Bump up psych version to 4.0.2Hiroshi SHIBATA2021-10-211-1/+1
| | | | https://github.com/ruby/psych/commit/69a713f860
* Tie lifetime of uJIT blocks to iseqsAlan Wu2021-10-202-0/+2
| | | | | | | | | | | | | | | | | | | | * Tie lifetime of uJIT blocks to iseqs Blocks weren't being freed when iseqs are collected. * Add rb_dary. Use it for method dependency table * Keep track of blocks per iseq Remove global version_tbl * Block version bookkeeping fix * dary -> darray * free ujit_blocks * comment about size of ujit_blocks
* [ruby/etc] Bump up etc version to 1.3.0Hiroshi SHIBATA2021-10-191-1/+1
| | | | https://github.com/ruby/etc/commit/85ca541d0b
* [ruby/zlib] Bump up zlib version to 2.1.1Hiroshi SHIBATA2021-10-191-1/+1
| | | | https://github.com/ruby/zlib/commit/82e9a636a6
* [ruby/etc] Remove unnecessary declarationNobuyoshi Nakada2021-10-191-4/+1
| | | | | | Fix https://github.com/ruby/etc/pull/12 https://github.com/ruby/etc/commit/7cbf03d22d
* [ruby/openssl] require Ruby 2.6 or laterKazuki Yamaguchi2021-10-166-105/+2
| | | | | | | | | | Drop support for Ruby 2.3, 2.4, and 2.5. As of 2021-10, Ruby 2.6 is the oldest version that still receives security fixes from the Ruby core team, so it doesn't make much sense to keep code for those ancient versions. https://github.com/ruby/openssl/commit/3436bd040d
* [ruby/openssl] bump version number to 3.0.0.preKazuki Yamaguchi2021-10-162-2/+2
| | | | https://github.com/ruby/openssl/commit/baa83a8a57
* [ruby/openssl] Ruby/OpenSSL 2.2.1Kazuki Yamaguchi2021-10-163-2/+19
| | | | https://github.com/ruby/openssl/commit/65e7207a07
* [ruby/openssl] Ruby/OpenSSL 2.1.3Kazuki Yamaguchi2021-10-161-0/+36
| | | | https://github.com/ruby/openssl/commit/e8ee01b22c
* [ruby/openssl] ssl: avoid directly storing String object in NPN callbackKazuki Yamaguchi2021-10-161-2/+2
| | | | | | | | | On the server side, the serialized list of protocols is stored in SSL_CTX as a String object reference. We utilize a hidden instance variable to prevent it from being GC'ed, but this is not enough because it can also be relocated by GC.compact. https://github.com/ruby/openssl/commit/5eb68ba778
* [ruby/openssl] x509store: explicitly call rb_gc_mark() against ↵Kazuki Yamaguchi2021-10-161-15/+23
| | | | | | | | | | | Store/StoreContext We store the reverse reference to the Ruby object in the OpenSSL struct for use from OpenSSL callback functions. To prevent the Ruby object from being relocated by GC.compact, we must "pin" it by calling rb_gc_mark(). https://github.com/ruby/openssl/commit/a6ba9f894f
* [ruby/openssl] ssl: explicitly call rb_gc_mark() against ↵Kazuki Yamaguchi2021-10-161-2/+17
| | | | | | | | | | | SSLContext/SSLSocket objects We store the reverse reference to the Ruby object in the OpenSSL struct for use from OpenSSL callback functions. To prevent the Ruby object from being relocated by GC.compact, we must "pin" it by calling rb_gc_mark(). https://github.com/ruby/openssl/commit/022b7ceada
* [ruby/openssl] digest: load digest library using Kernel#requireKazuki Yamaguchi2021-10-161-2/+6
| | | | | | | | | | The digest library is a default gem now, too. Therefore we can't simply use rb_require() to load it, but we should use Kernel#require instead. This change is based on the suggestion by David Rodríguez in https://github.com/ruby/digest/commit/16172612d56ac42f57e5788465791329303ac5d0#commitcomment-57778397 https://github.com/ruby/openssl/commit/157f80794b
* [ruby/openssl] fix segv in Timestamp::{Request,Response,TokenInfo}.newNobuhiro IMAI2021-10-161-3/+9
| | | | | | prevent `ossl_ts_*_free()` from calling when `d2i_TS_*_bio()` failed. https://github.com/ruby/openssl/commit/b29e215786
* [ruby/openssl] ts: libressl build fix warningDavid Carlier2021-10-161-0/+4
| | | | | | TS_time_cb on libressl expects an long long/time_t 64 bits long instead. https://github.com/ruby/openssl/commit/4c99f577b2
* [ruby/openssl] ssl: temporary lock string buffer while readingKazuki Yamaguchi2021-10-161-5/+16
| | | | | | | | | | | Similarly to SSLSocket#syswrite, the blocking SSLSocket#sysread allows context switches. We must prevent other threads from modifying the string buffer. We can use rb_str_locktmp() and rb_str_unlocktmp() to temporarily prohibit modification of the string. https://github.com/ruby/openssl/commit/d38274949f
* [ruby/openssl] ssl: create a temporary frozen string buffer when writingKazuki Yamaguchi2021-10-161-5/+5
| | | | | | | | | | Since a blocking SSLSocket#syswrite call allows context switches while waiting for the underlying socket to be ready, we must freeze the string buffer to prevent other threads from modifying it. Reference: https://github.com/ruby/openssl/issues/452 https://github.com/ruby/openssl/commit/aea874bc6e
* [ruby/openssl] ssl: add SSLContext#tmp_dh=Kazuki Yamaguchi2021-10-163-3/+57
| | | | | | | | | | | | | | | | | | | | Provide a wrapper of SSL_set0_tmp_dh_pkey()/SSL_CTX_set_tmp_dh(), which sets the DH parameters used for ephemeral DH key exchange. SSLContext#tmp_dh_callback= already exists for this purpose, as a wrapper around SSL_CTX_set_tmp_dh_callback(), but it is considered obsolete and the OpenSSL API is deprecated for future removal. There is no practical use case where an application needs to use different DH parameters nowadays. This was originally introduced to support export grade ciphers. RDoc for #tmp_dh_callback= is updated to recommend the new #tmp_dh=. Note that current versions of OpenSSL support automatic ECDHE curve selection which is enabled by default. SSLContext#tmp_dh= should only be necessary if you must allow ancient clients which don't support ECDHE. https://github.com/ruby/openssl/commit/aa43da4f04
* [ruby/openssl] ssl: remove private method SSLSocket#tmp_ecdh_callbackKazuki Yamaguchi2021-10-161-4/+0
| | | | | | | Commit ee037e146037 ("ssl: remove SSL::SSLContext#tmp_ecdh_callback", 2020-08-12) forgot to remove the method. https://github.com/ruby/openssl/commit/bef9ea84e4
* [ruby/zlib] Fix a bug that GZipReader#gets may return incomplete lineSutou Kouhei2021-10-151-6/+6
| | | | | | | | | | | | | | | | | See also: https://github.com/ruby/csv/issues/117#issuecomment-933289373 How to reproduce with x.csv.gz in the issue comment: Zlib::GzipReader.open("x.csv.gz") do |rio| rio.gets(nil, 1024) while line = rio.gets(nil, 8192) raise line unless line.valid_encoding? end end Reported by Dimitrij Denissenko. Thanks!!! https://github.com/ruby/zlib/commit/b1f182e98f
* Prefer the reentrant versions of gmtime and localtimeNobuyoshi Nakada2021-10-141-3/+9
|
* [ruby/date] Bump up date version to 3.2.0Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/date/commit/e0a4cbc8f6
* [ruby/pathname] Bump up pathname version to 0.2.0Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/pathname/commit/e6b3b3ed25
* [ruby/nkf] Bump up nkf version to 0.1.1Hiroshi SHIBATA2021-10-141-1/+1
| | | | https://github.com/ruby/nkf/commit/9aa7c6b841
* [ruby/etc] Get rid of alloca in the loopNobuyoshi Nakada2021-10-141-6/+7
| | | | https://github.com/ruby/etc/commit/c989bacc4c