aboutsummaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
...
* [ruby/psych] Replace A-Za-z with [:alpha:]jory-graham2021-08-311-1/+1
| | | | https://github.com/ruby/psych/commit/8ec36494fb
* [ruby/psych] Add quotes to the strings "y" and "n"Aaron Patterson2021-08-311-0/+2
| | | | | | | | | | | | 'y' and 'n' are kind of ambiguous. Syck treated y and n literals in YAML documents as strings. But this is not what the YAML 1.1 spec says. YAML 1.1 says they should be treated as booleans. When we're dumping documents, we know it's a string, so adding quotes will eliminate the "ambiguity" in the emitted document Fixes #443 https://github.com/ruby/psych/commit/6a1c30634e
* [ruby/psych] Update lib/psych/scalar_scanner.rbopak2021-08-311-1/+1
| | | | | https://github.com/ruby/psych/commit/64cc239557 Co-authored-by: Olle Jonsson <olle.jonsson@gmail.com>
* [ruby/psych] add more testsAlexandr Opak2021-08-311-4/+4
| | | | https://github.com/ruby/psych/commit/8f71222bf3
* [ruby/psych] fix parsing integer values with '_' at the endAlexandr Opak2021-08-311-4/+4
| | | | https://github.com/ruby/psych/commit/e0bb853014
* [ruby/psych] Improve float scalar scannerTomer Brisker2021-08-311-4/+3
| | | | | | | | | Previously, `+.inf` was not handled correctly. Additionally, the regexp was checking for inf and NaN, even though these cases are handled earlier in the condition. Added a few tests to ensure handling some missing cases. https://github.com/ruby/psych/commit/6e0e7a1e9f
* [ruby/zlib] Don't print out warnings when freeing.Samuel Williams2021-08-311-12/+1
| | | | https://github.com/ruby/zlib/commit/098c50255d
* [Feature #16972] Add mode: option to Pathname#mkpathNobuyoshi Nakada2021-08-311-2/+2
|
* Faster Pathname FileUtils methodsschneems2021-08-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when calling any of the "FileUtils" methods on pathname `require` is called every time even though that library might already be loaded. This is slow: We can speed it up by either checking first if the constant is already defined, or by using autoload. Using defined speeds up the action by about 300x and using autoload is about twice as fast as that (600x faster than current require method). I'm proposing we use autoload: ```ruby require 'benchmark/ips' Benchmark.ips do |x| autoload(:FileUtils, "fileutils") x.report("require") { require 'fileutils' } x.report("defined") { require 'fileutils' unless defined?(FileUtils) } x.report("autoload") { FileUtils } x.compare! end # Warming up -------------------------------------- # require 3.624k i/100ms # defined 1.465M i/100ms # autoload 2.320M i/100ms # Calculating ------------------------------------- # require 36.282k (± 2.4%) i/s - 184.824k in 5.097153s # defined 14.539M (± 2.0%) i/s - 73.260M in 5.041161s # autoload 23.100M (± 1.9%) i/s - 115.993M in 5.023271s # Comparison: # autoload: 23099779.2 i/s # defined: 14538544.9 i/s - 1.59x (± 0.00) slower # require: 36282.3 i/s - 636.67x (± 0.00) slower ``` Because this autoload is scoped to Pathname it will not change the behavior of existing programs that are not expecting FileUtils to be loaded yet: ``` ruby -rpathname -e "class Pathname; autoload(:FileUtils, 'fileutils'); end; puts FileUtils.exist?" Traceback (most recent call last): -e:1:in `<main>': uninitialized constant FileUtils (NameError) ```
* [Feature #18045] Remove T_PAYLOADPeter Zhu2021-08-251-2/+0
| | | | | | | This commit removes T_PAYLOAD since the new VWA implementation no longer requires T_PAYLOAD types. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [ruby/fiddle] Improve "offsetof" calculations ↵Aaron Patterson2021-08-241-16/+44
| | | | | | | | | (https://github.com/ruby/fiddle/pull/90) I need to get the offset of members inside sub structures. This patch adds sub-structure offset support for structs. https://github.com/ruby/fiddle/commit/cf78eddbb6
* Revert "[Feature #18045] Implement size classes for GC"Peter Zhu2021-08-231-0/+2
| | | | | | This reverts commits 48ff7a9f3e47bffb3e4d067a12ba9b936261caa0 and b2e2cf2dedd104acad8610721db5e4d341f135ef because it is causing crashes in SPARC solaris and i386 debian.
* [Feature #18045] Remove T_PAYLOADPeter Zhu2021-08-231-2/+0
| | | | | | | This commit removes T_PAYLOAD since the new VWA implementation no longer requires T_PAYLOAD types. Co-authored-by: Aaron Patterson <tenderlove@ruby-lang.org>
* [ruby/date] Add zontab.list dependencyNobuyoshi Nakada2021-08-221-0/+7
| | | | https://github.com/ruby/date/commit/7e1ffbf568
* undefine alloc functions for C extensionsMike Dalessio2021-08-202-0/+2
| | | | | | | | per guidance in doc/extension.rdoc, these classes now undefine their alloc functions: - ObjectSpace::InternalObjectWrapper - Socket::Ifaddr
* [ruby/date] Update zonetab.h at 2021-08-11Nobuyoshi Nakada2021-08-171-7/+7
| | | | https://github.com/ruby/date/commit/de7dca353f
* Include ruby.h before internal headers to suppress -Wundef warningsNobuyoshi Nakada2021-08-091-0/+1
|
* Show WorkingSetSize as RSS on WindowsNobuyoshi Nakada2021-08-051-4/+15
|
* Define functions using rb_wait_for_single_fd [Bug #18046]Nobuyoshi Nakada2021-08-011-0/+16
|
* Renamed thraed_fd_close as thread_fdNobuyoshi Nakada2021-07-295-164/+164
|
* Update the latest version of json.gemspec from flori/jsonHiroshi SHIBATA2021-07-291-7/+1
|
* [ruby/psych] fix: use git repository link for LibYAML in docsRhys Powell2021-07-291-1/+1
| | | | | | LibYAML has moved from their previous Mercurial based hosting on BitBucket to a git repository on GitHub. This commit updates the `Psych` module's documentation to point to this new repository, instead of the old one which is now a 404. https://github.com/ruby/psych/commit/947a84d0dd
* [ruby/zlib] Synchronize access to zstream to prevent segfault in ↵Jeremy Evans2021-07-281-1/+32
| | | | | | | | | | | | | | | | | multithreaded use I'm not sure whether this handles all multithreaded use cases, but this handles the example that crashes almost immediately and does 10,000,000 total deflates using 100 separate threads. To prevent the tests from taking forever, the committed test for this uses only 10,000 deflates across 10 separate threads, which still causes a segfault in the previous implementation almost immediately. Fixes [Bug #17803] https://github.com/ruby/zlib/commit/4b1023b3f2
* [ruby/digest] Also drop to support Ruby 2.4Hiroshi SHIBATA2021-07-281-1/+1
| | | | https://github.com/ruby/digest/commit/360a7de366
* [ruby/digest] Use Gemfile instead of ↵Hiroshi SHIBATA2021-07-281-4/+0
| | | | | | Gem::Specification#add_development_dependency https://github.com/ruby/digest/commit/460a6f807e
* [ruby/digest] Drop to support Ruby 2.3Hiroshi SHIBATA2021-07-281-1/+1
| | | | https://github.com/ruby/digest/commit/23dc9c7425
* [ruby/digest] gemspec: Avoid distributing extraneous filesOlle Jonsson2021-07-281-1/+1
| | | | https://github.com/ruby/digest/commit/0a451e0c94
* [ruby/digest] gemspec: Explicitly have 0 executablesOlle Jonsson2021-07-281-1/+1
| | | | https://github.com/ruby/digest/commit/086d54ba94
* [ruby/digest] Experiment: Use a .pre version in gemspecOlle Jonsson2021-07-281-1/+1
| | | | | | This makes it slightly more explicit that this is not a definite new version. https://github.com/ruby/digest/commit/2bb5bb78a3
* [ruby/digest] Experiment: bump patch versionOlle Jonsson2021-07-281-1/+1
| | | | | | This is a test, to see if the build failures are about the shipped Ruby master version of this gem. https://github.com/ruby/digest/commit/d2606b2cce
* Distinguish signal and timeout [Bug #16608]Nobuyoshi Nakada2021-07-251-2/+2
|
* [ruby/racc] Add missing check for rb_block_call()Benoit Daloze2021-07-181-0/+1
| | | | | | | | * It used to be hardcoded since 0affbf9d2c7c5c618b8d3fe191e74d9ae8ad22fc but got removed in 23abf3d3fb82afcc26d35769f0dec59dd46de4bb * This means that since that second commit, rb_iterate() was used unintentionally. https://github.com/ruby/racc/commit/8816ced525
* [ruby/openssl] Strip trailing spacesKazuki Yamaguchi2021-07-183-3/+3
| | | | https://github.com/ruby/openssl/commit/68fa9c86f1
* [ruby/openssl] Deprecate and rework old (fd) centric functionsSamuel Williams2021-07-182-6/+28
| | | | | | | | [ky: fixed compatibility with older versions of Ruby] (cherry picked from commit ruby/ruby@45e65f302b663b2c6ab69df06d3b6f219c1797b2) https://github.com/ruby/openssl/commit/8d928e0fb9
* [ruby/openssl] Use rb_block_call() instead of the deprecated rb_iterate() in ↵Benoit Daloze2021-07-181-2/+3
| | | | | | | | | OpenSSL * See https://bugs.ruby-lang.org/issues/18025 and https://github.com/ruby/ruby/pull/4629 https://github.com/ruby/openssl/commit/b8e4852dcc
* [ruby/openssl] Add example to OpenSSL::KDF.hkdf method ↵Yusuke Nakamura2021-07-181-0/+8
| | | | | | | | | (https://github.com/ruby/openssl/pull/447) The values from RFC 5869 https://datatracker.ietf.org/doc/html/rfc5869#appendix-A.1 https://github.com/ruby/openssl/commit/ec14a87f4f
* [ruby/openssl] use Bundler for dependency management and Rake gem tasksKazuki Yamaguchi2021-07-181-5/+0
| | | | | | | | | | | | Back in 2016, we chose not to use Bundler in Ruby/OpenSSL development because Bundler depended on openssl and could not be used for testing openssl itself - "bundle exec rake test" would end up with loading two different versions of openssl at the same time. This has been resolved long time ago. We can now safely use it for development dependency management and for Rake tasks. https://github.com/ruby/openssl/commit/47283d9161
* [ruby/openssl] Include peer socket IP address in errorsVinicius Stock2021-07-181-4/+30
| | | | https://github.com/ruby/openssl/commit/8a1e3f5085
* [ruby/openssl] Add OpenSSL::BN#set_flags and #get_flagsYusuke Endoh2021-07-181-0/+53
| | | | | | | | | | | | | | | | Also, OpenSSL::BN::CONSTTIME is added. OpenSSL itself had a feature that was vulnerable against a side-channel attack. The OpenSSL authors determined that it was not a security issue, and they have already fixed the issue by using BN_set_flags. https://github.com/openssl/openssl/pull/13888 If a Ruby OpenSSL user was faced with a similar issue, they couldn't prevent the issue because Ruby OpenSSL lacks a wrapper to BN_set_flags. For the case, this change introduces the wrapper. https://github.com/ruby/openssl/commit/1e565eba89
* [ruby/openssl] pkey/dsa: refactor DSA#sys{sign,verify} with ↵Kazuki Yamaguchi2021-07-182-88/+54
| | | | | | | | | | PKey#{sign,verify}_raw With the newly added OpenSSL::PKey::PKey#{sign,verify}_raw, OpenSSL::PKey::DSA's low level signing operation methods can be implemented in Ruby. The definitions are now in lib/openssl/pkey.rb. https://github.com/ruby/openssl/commit/ce805adf0c
* [ruby/openssl] pkey/ec: refactor EC#dsa_{sign,verify}_asn1 with ↵Kazuki Yamaguchi2021-07-182-55/+22
| | | | | | | | | | PKey#{sign,verify}_raw With the newly added OpenSSL::PKey::PKey#{sign,verify}_raw, OpenSSL::PKey::EC's low level signing operation methods can be implemented in Ruby. The definitions are now in lib/openssl/pkey.rb. https://github.com/ruby/openssl/commit/1f9da0cd9d
* [ruby/openssl] pkey/rsa: port RSA#{private,public}_{encrypt,decrypt} to the ↵Kazuki Yamaguchi2021-07-182-141/+106
| | | | | | | | | | | EVP API Implement these methods using the new OpenSSL::PKey::PKey#{encrypt,sign} family. The definitions are now in lib/openssl/pkey.rb. Also, recommend using those generic methods in the documentation. https://github.com/ruby/openssl/commit/2dfc1779d3
* [ruby/openssl] pkey: implement PKey#sign_raw, #verify_raw, and #verify_recoverKazuki Yamaguchi2021-07-181-0/+232
| | | | | | | | | | | | | | | Add a variant of PKey#sign and #verify that do not hash the data automatically. Sometimes the caller has the hashed data only, but not the plaintext to be signed. In that case, users would have to use the low-level API such as RSA#private_encrypt or #public_decrypt directly. OpenSSL 1.0.0 and later supports EVP_PKEY_sign() and EVP_PKEY_verify() which provide the same functionality as part of the EVP API. This patch adds wrappers for them. https://github.com/ruby/openssl/commit/16cca4e0c4
* [ruby/openssl] pkey: update version reference in #sign and #verify documentationKazuki Yamaguchi2021-07-181-2/+2
| | | | | | The next release is decided to be 3.0 rather than 2.3. https://github.com/ruby/openssl/commit/b8a434e462
* [ruby/openssl] pkey: implement PKey#encrypt and #decryptKazuki Yamaguchi2021-07-181-0/+141
| | | | | | | Support public key encryption and decryption operations using the EVP API. https://github.com/ruby/openssl/commit/75326d4bbc
* [ruby/openssl] pkey: remove deprecated parameter settersKazuki Yamaguchi2021-07-181-52/+3
| | | | | | | | | | | | | | | Remove the following methods, which have been marked as deprecated and produced a warning since version 2.0, commit 7ea72f1f5084 ("adapt OpenSSL::PKey to OpenSSL 1.1.0 opaque structs", 2016-06-05). - OpenSSL::PKey::RSA#n=, #e=, #d=, #p=, #q=, #dmp1=, #dmq1=, #iqmp= - OpenSSL::PKey::DSA#p=, #q=, #g=, #priv_key=, #pub_key= - OpenSSL::PKey::DH#p=, #g=, #priv_key=, #pub_key= These methods could only work with OpenSSL 1.0.2 or older, which is now EOL. https://github.com/ruby/openssl/commit/2334862cc0
* [ruby/openssl] Implement `Certificate.load` to load certificate chain. ↵Samuel Williams2021-07-182-0/+157
| | | | | | | | | (https://github.com/ruby/openssl/pull/441) * Add feature for loading the chained certificate into Certificate array. https://github.com/ruby/openssl/commit/05e1c015d6 Co-authored-by: Sao I Kuan <saoikuan@gmail.com>
* [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding firstKazuki Yamaguchi2021-07-185-61/+63
| | | | | | | | | | | | | | | | | | | | | Methods that take both PEM-encoding and DER-encoding have not been consistent in the order in which encoding to attempt to parse. A DER-encoding may contain a valid PEM block ("\n-----BEGIN ..-----" to "-----END ...-----") embedded within it. Also, the PEM-encoding parser allows arbitrary data around the PEM block and silently skips it. As a result, attempting to parse data in DER-encoding as PEM-encoding first can incorrectly finds the embedded PEM block instead. This commit ensures that DER encoding will always be attempted before PEM encoding. OpenSSL::X509::Certificate is one of the updated classes. With this, the following will always be true: # obj is an OpenSSL::X509::Certificate obj == OpenSSL::X509::Certificate.new(obj.to_der) obj == OpenSSL::X509::Certificate.new(obj.to_pem) https://github.com/ruby/openssl/commit/b280eb1fd0
* [ruby/openssl] Fix some typos [ci skip]Ryuta Kamizono2021-07-183-3/+3
| | | | https://github.com/ruby/openssl/commit/51b3030b2b
* [ruby/openssl] Add SSLSocket#getbyteAaron Patterson2021-07-181-0/+19
| | | | | | | | Normal sockets respond to `getbyte`, so we should make SSLSocket respond to `getbyte` as well. This way we can substitute SSLSockets for regular sockets. https://github.com/ruby/openssl/commit/ac1490b7c9