Граф коммитов

8217 Коммитов

Автор SHA1 Сообщение Дата
Aaron Patterson 0f1e8f38c9 [ruby/fiddle] Improve "offsetof" calculations (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
2021-08-24 16:18:22 +09:00
Peter Zhu eddd369e73 Revert "[Feature #18045] Implement size classes for GC"
This reverts commits 48ff7a9f3e
and b2e2cf2ded because it is causing
crashes in SPARC solaris and i386 debian.
2021-08-23 10:54:53 -04:00
Peter Zhu 48ff7a9f3e [Feature #18045] Remove T_PAYLOAD
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>
2021-08-23 09:15:42 -04:00
Nobuyoshi Nakada 0b9a3371ea [ruby/date] Add zontab.list dependency
https://github.com/ruby/date/commit/7e1ffbf568
2021-08-22 20:28:52 +09:00
Mike Dalessio c0f4e4ca6d undefine alloc functions for C extensions
per guidance in doc/extension.rdoc, these classes now undefine their
alloc functions:

- ObjectSpace::InternalObjectWrapper
- Socket::Ifaddr
2021-08-20 08:30:06 +09:00
Nobuyoshi Nakada 36ae44ce2c
[ruby/date] Update zonetab.h at 2021-08-11
https://github.com/ruby/date/commit/de7dca353f
2021-08-17 22:57:59 +09:00
Nobuyoshi Nakada b8f7e8ac6b
Include ruby.h before internal headers to suppress -Wundef warnings 2021-08-09 19:25:18 +09:00
Nobuyoshi Nakada ae275f67ce Show WorkingSetSize as RSS on Windows 2021-08-05 17:14:38 +09:00
Nobuyoshi Nakada 3b52230452
Define functions using rb_wait_for_single_fd [Bug #18046] 2021-08-01 06:49:07 +09:00
Nobuyoshi Nakada 7564e066ff
Renamed thraed_fd_close as thread_fd 2021-07-29 21:15:04 +09:00
Hiroshi SHIBATA a889ab486e
Update the latest version of json.gemspec from flori/json 2021-07-29 15:57:58 +09:00
Rhys Powell e99d2d066f [ruby/psych] fix: use git repository link for LibYAML in docs
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
2021-07-29 15:54:41 +09:00
Jeremy Evans b3d62a77d9 [ruby/zlib] Synchronize access to zstream to prevent segfault in 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
2021-07-28 13:40:03 +09:00
Hiroshi SHIBATA 30d0e5d1ae
[ruby/digest] Also drop to support Ruby 2.4
https://github.com/ruby/digest/commit/360a7de366
2021-07-28 11:48:36 +09:00
Hiroshi SHIBATA 260546ba26
[ruby/digest] Use Gemfile instead of Gem::Specification#add_development_dependency
https://github.com/ruby/digest/commit/460a6f807e
2021-07-28 11:48:36 +09:00
Hiroshi SHIBATA 5b96f4dd8c
[ruby/digest] Drop to support Ruby 2.3
https://github.com/ruby/digest/commit/23dc9c7425
2021-07-28 11:48:36 +09:00
Olle Jonsson 26e859b5c7
[ruby/digest] gemspec: Avoid distributing extraneous files
https://github.com/ruby/digest/commit/0a451e0c94
2021-07-28 11:48:36 +09:00
Olle Jonsson add48acea3
[ruby/digest] gemspec: Explicitly have 0 executables
https://github.com/ruby/digest/commit/086d54ba94
2021-07-28 11:48:36 +09:00
Olle Jonsson 478f0ddb5f
[ruby/digest] Experiment: Use a .pre version in gemspec
This makes it slightly more explicit that this is not a definite new version.

https://github.com/ruby/digest/commit/2bb5bb78a3
2021-07-28 11:48:36 +09:00
Olle Jonsson 73c5d4d54e
[ruby/digest] Experiment: bump patch version
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
2021-07-28 11:48:36 +09:00
Nobuyoshi Nakada 070557afc4 Distinguish signal and timeout [Bug #16608] 2021-07-25 13:09:03 -07:00
Benoit Daloze 9b972310fa [ruby/racc] Add missing check for rb_block_call()
* 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
2021-07-18 20:38:34 +09:00
Kazuki Yamaguchi bd356c6899 [ruby/openssl] Strip trailing spaces
https://github.com/ruby/openssl/commit/68fa9c86f1
2021-07-18 18:04:50 +09:00
Samuel Williams 3f1d8a18ea [ruby/openssl] Deprecate and rework old (fd) centric functions
[ky: fixed compatibility with older versions of Ruby]

(cherry picked from commit ruby/ruby@45e65f302b)

https://github.com/ruby/openssl/commit/8d928e0fb9
2021-07-18 17:48:49 +09:00
Benoit Daloze 3975840780 [ruby/openssl] Use rb_block_call() instead of the deprecated rb_iterate() in OpenSSL
* See https://bugs.ruby-lang.org/issues/18025
  and https://github.com/ruby/ruby/pull/4629

https://github.com/ruby/openssl/commit/b8e4852dcc
2021-07-18 17:48:49 +09:00
Yusuke Nakamura 11651ab703 [ruby/openssl] Add example to OpenSSL::KDF.hkdf method (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
2021-07-18 17:48:49 +09:00
Kazuki Yamaguchi 70f0a802fe [ruby/openssl] use Bundler for dependency management and Rake gem tasks
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
2021-07-18 17:48:42 +09:00
Vinicius Stock 4f7c3f631a [ruby/openssl] Include peer socket IP address in errors
https://github.com/ruby/openssl/commit/8a1e3f5085
2021-07-18 17:45:03 +09:00
Yusuke Endoh 3d37e5d11c [ruby/openssl] Add OpenSSL::BN#set_flags and #get_flags
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
2021-07-18 17:45:02 +09:00
Kazuki Yamaguchi 5fc2912e60 [ruby/openssl] pkey/dsa: refactor DSA#sys{sign,verify} with 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
2021-07-18 17:45:01 +09:00
Kazuki Yamaguchi 0c23e4a7aa [ruby/openssl] pkey/ec: refactor EC#dsa_{sign,verify}_asn1 with 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
2021-07-18 17:45:00 +09:00
Kazuki Yamaguchi 857a177b03 [ruby/openssl] pkey/rsa: port RSA#{private,public}_{encrypt,decrypt} to the 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
2021-07-18 17:44:59 +09:00
Kazuki Yamaguchi 4ebff35971 [ruby/openssl] pkey: implement PKey#sign_raw, #verify_raw, and #verify_recover
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
2021-07-18 17:44:58 +09:00
Kazuki Yamaguchi cbc560e38f [ruby/openssl] pkey: update version reference in #sign and #verify documentation
The next release is decided to be 3.0 rather than 2.3.

https://github.com/ruby/openssl/commit/b8a434e462
2021-07-18 17:44:58 +09:00
Kazuki Yamaguchi 87458ff2ae [ruby/openssl] pkey: implement PKey#encrypt and #decrypt
Support public key encryption and decryption operations using the EVP
API.

https://github.com/ruby/openssl/commit/75326d4bbc
2021-07-18 17:44:57 +09:00
Kazuki Yamaguchi eac7fd57f8 [ruby/openssl] pkey: remove deprecated parameter setters
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
2021-07-18 17:44:56 +09:00
Samuel Williams 1146a94aee [ruby/openssl] Implement `Certificate.load` to load certificate chain. (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>
2021-07-18 17:44:55 +09:00
Kazuki Yamaguchi a01daab656 [ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding first
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
2021-07-18 17:44:54 +09:00
Ryuta Kamizono 29ad4ab3d0 [ruby/openssl] Fix some typos [ci skip]
https://github.com/ruby/openssl/commit/51b3030b2b
2021-07-18 17:44:54 +09:00
Aaron Patterson 593164c2be [ruby/openssl] Add SSLSocket#getbyte
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
2021-07-18 17:44:53 +09:00
Kazuki Yamaguchi 6d71918d94 [ruby/openssl] pkey/dh, pkey/ec: use EVP_PKEY_check() family
Use EVP_PKEY_param_check() instead of DH_check() if available. Also,
use EVP_PKEY_public_check() instead of EC_KEY_check_key().

EVP_PKEY_*check() is part of the EVP API and is meant to replace those
low-level functions. They were added by OpenSSL 1.1.1. It is currently
not provided by LibreSSL.

https://github.com/ruby/openssl/commit/797e9f8e08
2021-07-18 17:44:52 +09:00
Kazuki Yamaguchi 3fe8387950 [ruby/openssl] pkey: implement {DH,DSA,RSA}#public_key in Ruby
The low-level API that is used to implement #public_key is deprecated
in OpenSSL 3.0. It is actually very simple to implement in another way,
using existing methods only, in much shorter code. Let's do it.

While we are at it, the documentation is updated to recommend against
using #public_key. Now that OpenSSL::PKey::PKey implements public_to_der
method, there is no real use case for #public_key in newly written Ruby
programs.

https://github.com/ruby/openssl/commit/48a6c391ef
2021-07-18 17:44:51 +09:00
Kazuki Yamaguchi 5d1693aac5 [ruby/openssl] pkey: implement #to_text using EVP API
Use EVP_PKEY_print_private() instead of the low-level API *_print()
functions, such as RSA_print().

EVP_PKEY_print_*() family was added in OpenSSL 1.0.0.

Note that it falls back to EVP_PKEY_print_public() and
EVP_PKEY_print_params() as necessary. This is required for EVP_PKEY_DH
type for which _private() fails if the private component is not set in
the pkey object.

Since the new API works in the same way for all key types, we now
implement #to_text in the base class OpenSSL::PKey::PKey rather than in
each subclass.

https://github.com/ruby/openssl/commit/e0b4c56956
2021-07-18 17:44:50 +09:00
Kazuki Yamaguchi 436aecb520 [ruby/openssl] pkey: remove unused ossl_generate_cb_2() helper function
The previous series of commits re-implemented key generation with the
low level API with the EVP API. The BN_GENCB-based callback function is
no longer used.

https://github.com/ruby/openssl/commit/81027b7463
2021-07-18 17:44:50 +09:00
Kazuki Yamaguchi 38436d1f5c [ruby/openssl] pkey/dsa: use high level EVP interface to generate parameters and keys
Implement PKey::DSA.new(size) and PKey::DSA.generate using
OpenSSL::PKey.generate_parameters and .generate_key instead of the low
level DSA functions.

https://github.com/ruby/openssl/commit/1800a8d5eb
2021-07-18 17:44:49 +09:00
Kazuki Yamaguchi b8dcf9c8fd [ruby/openssl] pkey/rsa: use high level EVP interface to generate parameters and keys
Implement PKey::RSA.new(size, exponent) and PKey::RSA.generate using
OpenSSL::PKey.generate_key instead of the low level RSA functions.

https://github.com/ruby/openssl/commit/363fd10713
2021-07-18 17:44:48 +09:00
Kazuki Yamaguchi 098985a5e6 [ruby/openssl] pkey/dh: use high level EVP interface to generate parameters and keys
Implement PKey::DH.new(size, gen), PKey::DH.generate(size, gen), and
PKey::DH#generate_key! using PKey.generate_parameters and .generate_key
instead of the low level DH functions.

Note that the EVP interface can enforce additional restrictions - for
example, DH key shorter than 2048 bits is no longer accepted by default
in OpenSSL 3.0. The test code is updated accordingly.

https://github.com/ruby/openssl/commit/c2e9b16f0b
2021-07-18 17:44:47 +09:00
Kazuki Yamaguchi 595644e4f6 [ruby/openssl] pkey: fix interrupt handling in OpenSSL::PKey.generate_key
rb_thread_call_without_gvl() can be interrupted, but it may be able to
resume the operation. Call rb_thread_check_ints() to see if it raises
an exception or not.

https://github.com/ruby/openssl/commit/88b90fb856
2021-07-18 17:44:46 +09:00
Kazuki Yamaguchi 8cfe92b8a2 [ruby/openssl] pkey: allow setting algorithm-specific options in #sign and #verify
Similarly to OpenSSL::PKey.generate_key and .generate_parameters, let
OpenSSL::PKey::PKey#sign and #verify take an optional parameter for
specifying control strings for EVP_PKEY_CTX_ctrl_str().

https://github.com/ruby/openssl/commit/faf85d7c1d
2021-07-18 17:44:46 +09:00
Kazuki Yamaguchi e2014d0354 [ruby/openssl] pkey: prepare pkey_ctx_apply_options() for usage by other operations
The routine to apply Hash to EVP_PKEY_CTX_ctrl_str() is currently used
by key generation, but it is useful for other operations too. Let's
change it to a slightly more generic name.

https://github.com/ruby/openssl/commit/b2b77527fd
2021-07-18 17:44:45 +09:00
Kazuki Yamaguchi 1706302be5 [ruby/openssl] pkey: fix potential memory leak in PKey#sign
Fix potential leak of EVP_MD_CTX object in an error path. This path is
normally unreachable, since the size of a signature generated by any
supported algorithms would not be larger than LONG_MAX.

https://github.com/ruby/openssl/commit/99e8630518
2021-07-18 17:44:44 +09:00
Kazuki Yamaguchi b7a908af34 [ruby/openssl] ossl.c: do not set locking callbacks on LibreSSL
Similarly to OpenSSL >= 1.1.0, LibreSSL 2.9.0 ensures thread safety
without requiring applications to set locking callbacks and made
related functions no-op.

https://github.com/ruby/openssl/commit/7276233e1a
2021-07-18 17:44:43 +09:00
Kazuki Yamaguchi 88d64418dd [ruby/openssl] ssl: use TLS_method() instead of SSLv23_method() for LibreSSL
LibreSSL 2.2.2 introduced TLS_method(), but with different semantics
from OpenSSL: TLS_method() enabled TLS >= 1.0 while SSLv23_method()
enabled all available versions, which included SSL 3.0 in addition.

However, LibreSSL 2.3.0 removed SSL 3.0 support completely and now
TLS_method() and SSLv23_method() are equivalent.

https://github.com/ruby/openssl/commit/3b7d7045b8
2021-07-18 17:44:43 +09:00
Kazuki Yamaguchi 50332c4071 [ruby/openssl] ssl: call SSL_CTX_set_ecdh_auto() on OpenSSL 1.0.2 only
SSL_CTX_set_ecdh_auto() exists in OpenSSL 1.1.0 and LibreSSL 2.6.1, but
it is made no-op and the automatic curve selection cannot be disabled.
Wrap it with ifdef to make it clear that it is safe to remove it
completely when we drop support for OpenSSL 1.0.2.

https://github.com/ruby/openssl/commit/2ae8f21234
2021-07-18 17:44:42 +09:00
Kazuki Yamaguchi cd002305f0 [ruby/openssl] require OpenSSL >= 1.0.2 and LibreSSL >= 3.1
Clean up old version guards in preparation for the upcoming OpenSSL 3.0
support.

OpenSSL 1.0.1 reached its EOL on 2016-12-31. At that time, we decided
to keep 1.0.1 support because many major Linux distributions were still
shipped with 1.0.1. Now, nearly 4 years later, most Linux distributions
are reaching their EOL and it should be safe to assume nobody uses them
anymore. Major ones that were using 1.0.1:

 - Ubuntu 14.04 is EOL since 2019-04-30
 - RHEL 6 will reach EOL on 2020-11-30

LibreSSL 3.0 and older versions are no longer supported by the LibreSSL
team as of October 2020.

Note that OpenSSL 1.0.2 also reached EOL on 2019-12-31 and 1.1.0 also
did on 2018-08-31.

https://github.com/ruby/openssl/commit/c055938f4b
2021-07-18 17:44:41 +09:00
Kazuki Yamaguchi decce40da7 [ruby/openssl] bn: update documentation of OpenSSL::BN#initialize and #to_s
Clarify that BN.new(str, 2) and bn.to_s(2) handles binary string in
big-endian, and the sign of the bignum is ignored.

Reference: https://github.com/ruby/openssl/issues/431

https://github.com/ruby/openssl/commit/6fae2bd612
2021-07-18 17:44:40 +09:00
Rick Mark 01fcb8f45b [ruby/openssl] BN.abs and BN uplus
Adds standard math abs fuction and revises uplus to return a duplicated object due to BN mutability

https://github.com/ruby/openssl/commit/0321b1e945
2021-07-18 17:44:39 +09:00
Kenta Murata 67897762cf
[ruby/fiddle] Add Fiddle::Handle#file_name (https://github.com/ruby/fiddle/pull/88)
https://github.com/ruby/fiddle/commit/4ee1c6fc4b
2021-07-14 18:56:00 +09:00
Nobuyoshi Nakada 169529a0c0
[ruby/fiddle] Check HAVE_RUBY_MEMORY_VIEW_H rather than API version (https://github.com/ruby/fiddle/pull/86)
https://github.com/ruby/fiddle/commit/c5abcc3a7e
2021-07-14 18:55:59 +09:00
Kenta Murata 818c74b7f4 [ruby/fiddle] Return the module handle value in Fiddle::Handle#to_i and add FIddle::Handle#to_ptr (https://github.com/ruby/fiddle/pull/87)
https://github.com/ruby/fiddle/commit/170111a0cb
2021-07-14 18:43:32 +09:00
Nobuyoshi Nakada cb955dc9ac
[ruby/fiddle] update dependencies 2021-07-13 21:34:28 +09:00
Nobuyoshi Nakada 40d45ab093
[ruby/fiddle] Check HAVE_RUBY_MEMORY_VIEW_H rather than API version
https://github.com/ruby/fiddle/commit/93f9564446
2021-07-13 20:36:45 +09:00
Nobuyoshi Nakada 472d8c5555
[ruby/fiddle] Update required_ruby_version (https://github.com/ruby/fiddle/pull/85)
Drop supports for old versions, keeping 2.5 as CI supports it for
now.

https://github.com/ruby/fiddle/commit/90634e7c55
2021-07-13 19:37:46 +09:00
Sutou Kouhei bb868f4814
[ruby/fiddle] Use have_header and have_type to detect memory view availability
Fix https://github.com/ruby/fiddle/pull/84

It may detect ruby/memory_view.h for system Ruby that is installed in
/usr.

We can use RUBY_API_VERSION_MAJOR to detect memory view availability
because memory view is available since Ruby 3.0.

Reported by Jun Aruga. Thanks!!!

https://github.com/ruby/fiddle/commit/3292929830
2021-07-13 19:37:46 +09:00
Aaron Patterson 5c0d8c6369
[ruby/fiddle] Add "offsetof" to Struct classes (https://github.com/ruby/fiddle/pull/83)
* Add "offsetof" to Struct classes

I need to get the offset of a member inside a struct without allocating
the struct.  This patch adds an "offsetof" class method to structs that
are generated.

The usage is like this:

```ruby
MyStruct = struct [
  "int64_t i",
  "char c",
]

MyStruct.offsetof("i") # => 0
MyStruct.offsetof("c") # => 8
```

* Update test/fiddle/test_c_struct_builder.rb

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>

https://github.com/ruby/fiddle/commit/4e3b60c5b6

Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2021-07-13 19:37:46 +09:00
Sutou Kouhei a2c9e1b58a
[ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/049138b4b8
2021-07-13 19:37:46 +09:00
Sutou Kouhei 70b0318646
[ruby/fiddle] MemoryView: ensure reset rb_memory_view_t::obj on error
https://github.com/ruby/fiddle/commit/0ed39345fe
2021-07-13 19:37:46 +09:00
Sutou Kouhei 9f86e50e1e
[ruby/fiddle] StringValuePtr may change the val
https://github.com/ruby/fiddle/commit/bddca7c895
2021-07-13 19:37:45 +09:00
Sutou Kouhei 10e26cfa76
[ruby/fiddle] Add MemoryView.export and MemoryView#release (https://github.com/ruby/fiddle/pull/80)
fix https://github.com/ruby/fiddle/pull/79

Users can release memory views explicitly before process exit.

Reported by xtkoba. Thanks!!!

https://github.com/ruby/fiddle/commit/1de64b7e76
2021-07-13 19:37:45 +09:00
Sutou Kouhei 9988f6ac4e
[ruby/fiddle] Add Fiddle::MemoryView#to_s (https://github.com/ruby/fiddle/pull/78)
Fix https://github.com/ruby/fiddle/pull/74

Reported by dsisnero. Thanks!!!
2021-07-13 19:37:45 +09:00
Sutou Kouhei d1eeb9fec9
[ruby/fiddle] windows: use GetLastError() for win32_last_error
Ruby: [Bug #11579]

Patch by cremno phobia. Thanks!!!

https://github.com/ruby/fiddle/commit/760a8f9b14
2021-07-13 19:37:45 +09:00
Sutou Kouhei c0f9191ab6
[ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/3784cfeec4
2021-07-13 19:37:44 +09:00
Samuel Williams 028441d22f Avoid calling `fstat` on things we already know are valid sockets. 2021-07-12 19:16:22 +12:00
Nobuyoshi Nakada c2ed5ab08b [ruby/date] Fixed markups for bold [ci skip]
https://github.com/ruby/date/commit/404f9d2096
2021-07-11 20:28:23 +09:00
Jeremy Evans 8065670cfb [ruby/date] Fix comparison with Float::INFINITY
Fixes [Bug #17945]

https://github.com/ruby/date/commit/953d907238
2021-07-11 20:28:21 +09:00
Nobuyoshi Nakada fbe9b691bd
Added missing declarations in readline.h bundled with macOS 10.13 2021-07-09 08:52:35 +09:00
Nobuyoshi Nakada 771f6dd75d
[ruby/stringio] Suppress a sign-compare warning
https://github.com/ruby/stringio/commit/a88c070e0b
2021-07-08 16:43:22 +09:00
Nobuyoshi Nakada eecc4570cd
Found library is not usable if the header is not found 2021-07-06 01:17:38 +09:00
Nobuyoshi Nakada 1dfe75b0be
Fixed 'maybe_unused' attribute
```
../../../src/ext/bigdecimal/bigdecimal.c:303:5: error: 'maybe_unused' attribute cannot be applied to types
    ENTER(1);
    ^
```
2021-07-06 01:13:54 +09:00
Nobuyoshi Nakada 6d8422659a
Fix linking bundled zlib
* Prefix "./" to the import library name to expanded when static
  linking exts.

* Copy zlib shared library to the top build directory.
2021-07-03 12:52:46 +09:00
Samuel Williams 5e75280c8e Add basic test for updated IO wait functions. 2021-06-29 23:54:41 +12:00
Nobuyoshi Nakada 391abc543c
Scan the coderange in the given encoding 2021-06-26 16:05:15 +09:00
Nobuyoshi Nakada fd7023a87e
Convert ssize_t properly 2021-06-23 10:09:25 +09:00
Samuel Williams 45e65f302b Deprecate and rework old (fd) centric functions. 2021-06-22 22:48:57 +12:00
Samuel Williams 3deb5d7113 Direct io for accept, send, sendmsg, recvfrom, and related methods. 2021-06-22 22:17:53 +12:00
aycabta 6a48f62c51 [ruby/readline-ext] Version 0.1.2
https://github.com/ruby/readline-ext/commit/8541aaccb5
2021-06-22 11:06:00 +09:00
Nobuyoshi Nakada 626427c2e0
Removed no longer used variables 2021-06-14 14:11:38 +09:00
Samuel Williams 2792acc8f2
Add scheduler hook `Addrinfo.getaddrinfo`. (#4375)
Co-authored-by: Bruno Sutic <code@brunosutic.com>
2021-06-14 16:21:08 +12:00
Nobuyoshi Nakada 32b18fe9d0
Suppress array-parameter warnings by gcc 11 2021-06-13 15:12:45 +09:00
Nobuyoshi Nakada 122ce52e8f
Check if alternative malloc header can work in C++
jemalloc (5.2.1 at least) cannot compile in C++ on macOS SDK, due
to conflicts on exception specification.
2021-06-13 15:12:45 +09:00
Hiroshi SHIBATA 85b94144f2
[ruby/psych] Bump version to 4.0.1
https://github.com/ruby/psych/commit/4049939006
2021-06-07 19:15:14 +09:00
Jean Boussier fd6225c7a9
[ruby/psych] Implement YAML.safe_dump to make safe_load more usable.
In case where Psych is used as a two way serializers,
e.g. to serialize some cache or config, it is preferable
to have the same restrictions on both load and dump.

Otherwise you might dump and persist some objects payloads
that you later won't be able to read.

https://github.com/ruby/psych/commit/441958396f
2021-06-07 19:15:14 +09:00
Yusuke Endoh 430883158f
[ruby/psych] Make YAML.load_file use YAML.load instead of safe_load
YAML.load and YAML.safe_load are different a little; the former allows
Symbol by default but the latter doesn't. So YAML.load_file and
YAML.safe_load_file should reflect the difference.

Fixes #490

https://github.com/ruby/psych/commit/f8a5e512a1
2021-06-07 19:15:14 +09:00
Daisuke Fujimura (fd0) e451f0f678 Fix `_MSC_VER` warnings 2021-06-03 00:07:25 +09:00
Hiroshi SHIBATA edcc29dcff Removed gdbm from ruby repo 2021-05-25 20:04:54 +09:00
Hiroshi SHIBATA 55cd3e4ebf Removed dbm from ruby repo 2021-05-25 15:18:31 +09:00
Nobuyoshi Nakada 1d170fdc6d
ext/json/parser/parser.h: Add fallback MAYBE_UNUSED
e2ad91fc20
2021-05-19 10:16:22 +09:00
Nobuyoshi Nakada 7c716b686c
ext/json/parser/prereq.mk: fix warnings for code generated by ragel
* type-limits when plain-char is unsigned
* unused-const-variable for NFA constants
2021-05-18 23:26:03 +09:00
Sutou Kouhei 79717f81f8 [ruby/fiddle] windows: link to ws2_32 for WSAGetLastError()
https://github.com/ruby/fiddle/commit/e9955d74ae
2021-05-18 12:48:40 +09:00
Sutou Kouhei 71d4a493b8 [ruby/fiddle] windows: add Fiddle.win32_last_socket_error{,=}
GitHub: fix GH-72

Users can't use WSAGetLastError() with Ruby 3.0 or later because
rb_funcall() resets the last socket error internally.

Users can get the last socket error by Fiddle.win32_last_socket_error.

Reported by Kentaro Hayashi. Thanks!!!

https://github.com/ruby/fiddle/commit/76158db00a
2021-05-18 12:48:40 +09:00
Sutou Kouhei ab5212b3c9 [ruby/fiddle] Add support for "const" in type
GitHub: fix #68

Reported by kojix2. Thanks!!!

https://github.com/ruby/fiddle/commit/d7322c234a
2021-05-18 12:48:40 +09:00
Sutou Kouhei 4d1bb460f6 [ruby/fiddle] Add --enable-debug-build option to extconf.rb
https://github.com/ruby/fiddle/commit/e0498e60ea
2021-05-18 12:48:40 +09:00
Sutou Kouhei 791e8eec66 [ruby/fiddle] win32types: sort
https://github.com/ruby/fiddle/commit/35dec6c5a5
2021-05-18 12:48:40 +09:00
Sutou Kouhei 8758b07b1e [ruby/fiddle] Fix more Win32Types definitions
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types

https://github.com/ruby/fiddle/commit/805c1a595a
2021-05-18 12:48:40 +09:00
Orgad Shaneh 25e56fe374 [ruby/fiddle] Fix Win32Types for Windows 64-bit (#63)
https://docs.microsoft.com/en-us/windows/win32/winprog/windows-data-types

https://github.com/ruby/fiddle/commit/28ee5b1608
2021-05-18 12:48:40 +09:00
Sutou Kouhei 8d63b1dc75 [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/0cbd370fd6
2021-05-18 12:48:40 +09:00
Sutou Kouhei 881b2dc898 [ruby/fiddle] closure: add support for const char *
GitHub: fix GH-62

Reported by Cody Krieger. Thanks!!!

https://github.com/ruby/fiddle/commit/284b820f2d
2021-05-18 12:48:40 +09:00
Sutou Kouhei b2de5999d8 [ruby/fiddle] closure: accept symbol as type
https://github.com/ruby/fiddle/commit/dc2da6633e
2021-05-18 12:48:40 +09:00
Sutou Kouhei 212d836cd7 [ruby/fiddle] Remove wrong comment
https://github.com/ruby/fiddle/commit/831522e768
2021-05-18 12:48:40 +09:00
Kenta Murata 7bd3d6d23e [ruby/fiddle] Bump version
https://github.com/ruby/fiddle/commit/63e5f98412
2021-05-18 12:48:40 +09:00
Hiroshi SHIBATA ee611341c9
Bump version of required_ruby_version to 2.3. Fixes #464 2021-05-17 19:51:51 +09:00
Jean Boussier 2de594ca98
[flori/json] Deduplicate strings inside json_string_unescape
[ci 2]

https://github.com/flori/json/commit/1982070cb8
2021-05-17 19:51:51 +09:00
Jean Boussier 1d2b4ccaf2
[flori/json] Refactor json_string_unescape
https://github.com/flori/json/commit/f398769332
2021-05-17 19:51:50 +09:00
Masafumi Koba 8a974dc83c [flori/json] Fix incorrect `#` position in API doc
This change fixes an incorrect `#` position in the API documentation of the `JSON` module.

https://github.com/flori/json/commit/dc4b62424f
2021-05-17 19:26:03 +09:00
Aaron Patterson 42b20bdbfe
[ruby/psych] remove deprecated interface
https://github.com/ruby/psych/commit/0767227051
2021-05-17 11:20:46 +09:00
Aaron Patterson b0e21197ce
[ruby/psych] Bump version
https://github.com/ruby/psych/commit/1df86a2e81
2021-05-17 11:20:46 +09:00
Aaron Patterson fbb4e3f96c
[ruby/psych] Use Psych.safe_load by default
Psych.load is not safe for use with untrusted data.  Too many
applications make the mistake of using `Psych.load` with untrusted data
and that ends up with some kind of security vulnerability.

This commit changes the default `Psych.load` to use `safe_load`.  Users
that want to parse trusted data can use Psych.unsafe_load.

https://github.com/ruby/psych/commit/176494297f
2021-05-17 11:20:45 +09:00
Aaron Patterson c7c2ad5749
[ruby/psych] Introduce `Psych.unsafe_load`
In future versions of Psych, the `load` method will be mostly the same
as the `safe_load` method.  In other words, the `load` method won't
allow arbitrary object deserialization (which can be used to escalate to
an RCE).  People that need to load *trusted* documents can use the
`unsafe_load` method.

This commit introduces the `unsafe_load` method so that people can
incrementally upgrade.  For example, if they try to upgrade to 4.0.0 and
something breaks, they can downgrade, audit callsites, change to
`safe_load` or `unsafe_load` as required, and then upgrade to 4.0.0
smoothly.

https://github.com/ruby/psych/commit/cb50aa8d3f
2021-05-17 11:20:45 +09:00
Jean Boussier a3ceed50b8
[ruby/psych] Fix symabolize_name with non-string keys
https://github.com/ruby/psych/commit/1c5c29e81f
2021-05-17 11:20:45 +09:00
Jeremy Ebler 830778db95
[ruby/psych] feat: allow scalars and sequences to be styled when dumped
https://github.com/ruby/psych/commit/546154ddb7
2021-05-17 11:20:45 +09:00
Yusuke Endoh f691c15792 ext/objspace/lib/objspace/trace.rb: Remove the original Kernel#p
... to disable a "method redefined" warning.

http://rubyci.s3.amazonaws.com/solaris11-gcc/ruby-master/log/20210514T050008Z.fail.html.gz
```
  1) Failure:
TestObjSpace#test_objspace_trace [/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/test/objspace/test_objspace.rb:621]:
<["objspace/trace is enabled"]> expected but was
<["/export/home/chkbuild/chkbuild-gcc/tmp/build/20210514T050008Z/ruby/.ext/common/objspace/trace.rb:29: warning: method redefined; discarding old p",
 "objspace/trace is enabled"]>.
```
2021-05-14 15:39:57 +09:00
Yusuke Endoh cf1e1879f1 ext/objspace/lib/objspace/trace.rb: Added
This file, when require'ed, starts tracing the object allocations, and
redefines `Kernel#p` to show the allocation site.

This commit is experimental; the library name and APIs may change.

[Feature #17762]
2021-05-14 13:40:32 +09:00
Ryuta Kamizono 73136ebbde
[ruby/psych] Fix some typos [ci skip]
https://github.com/ruby/psych/commit/98617e55a1
2021-05-10 19:19:35 +09:00
Aaron Patterson b7250026dd
[ruby/psych] bump version
https://github.com/ruby/psych/commit/091cd46b1f
2021-05-10 19:19:35 +09:00
Tim Gates 954970162c
[ruby/psych] docs: fix simple typo, expessed -> expressed
There is a small typo in ext/psych/yaml/yaml.h.

Should read `expressed` rather than `expessed`.

https://github.com/ruby/psych/commit/1150d669cb
2021-05-10 19:19:35 +09:00
Charles Oliver Nutter 1563de5997
[ruby/psych] Update to latest SnakeYAML
Fixes jruby/jruby#6365

https://github.com/ruby/psych/commit/a88ff77f02
2021-05-10 19:19:35 +09:00
Jean Boussier c110ade0d2
[ruby/psych] Fix custom marshalization with symbolize_names: true
https://github.com/ruby/psych/commit/ee26f26ab5
2021-05-10 19:17:32 +09:00
Jean Boussier 155cd7fd2a
[ruby/psych] Cache dispatch cache in an instance variable
https://github.com/ruby/psych/commit/285c461cd2
2021-05-10 19:17:32 +09:00
Jean Boussier 3ab41acd36
[ruby/psych] Cache access to Psych.load_tags in Visitor::ToRuby
https://github.com/ruby/psych/commit/58223f0426
2021-05-10 19:17:32 +09:00
Matt Valentine-House 8bbd319806 Allow newobj_of0 and newobj_slowpath to allocate into multiple heap slots 2021-05-06 09:18:17 -04:00
Gannon McGibbon a42b7de436 [ruby/strscan] Replace "iff" with "if and only if" (#18)
iff means if and only if, but readers without that knowledge might
assume this to be a spelling mistake. To me, this seems like
exclusionary language that is unnecessary. Simply using "if and only if"
instead should suffice.

https://github.com/ruby/strscan/commit/066451c11e
2021-05-06 16:21:14 +09:00
Kenichi Kamiya 564ccd095a [ruby/strscan] Fix segmentation fault of `StringScanner#charpos` when `String#byteslice` returns non string value [Bug #17756] (#20)
https://github.com/ruby/strscan/commit/92961cde2b
2021-05-06 16:20:38 +09:00
Hiroshi SHIBATA 822eb94563
Import from https://github.com/ruby/strscan/pull/19
* Use Gemfile instead of Gem::Specification#add_development_dependency.

* Use pend instead of skip for test-unit.
2021-05-06 16:18:58 +09:00
Benoit Daloze 0764d323d8 Fix -Wundef warnings for patterns `#if HAVE`
* See [Feature #17752]
* Using this to detect them:
  git grep -P 'if\s+HAVE' | grep -Pv 'HAVE_LONG_LONG|/ChangeLog|HAVE_TYPEOF'
2021-05-04 14:56:55 +02:00
Benoit Daloze fa7a712d46 Fix -Wundef warnings for HAVE_RB_EXT_RACTOR_SAFE
* See [Feature #17752]
2021-05-04 14:56:55 +02:00
Benoit Daloze 59a92a84c8 Fix -Wundef warnings in core extensions
* See [Feature #17752]
2021-05-04 14:56:55 +02:00
Nobuyoshi Nakada 96fd1e1f22
Removed unused macro HAVE_CONFIG_H
It seems like a vestige of ext/md5.
2021-04-28 18:48:08 +09:00
Nobuyoshi Nakada 795fb51f80
NDEBUG is ignored since Ruby 3.0 2021-04-28 18:48:08 +09:00
Benoit Daloze 3a3b19b2bb Fix Monitor to lock per Fiber, like Mutex [Bug #17827] 2021-04-27 18:42:50 +02:00
Lars Kanis 22d36c463f [ruby/gdbm] Add dependency to gdbm package on mingw
RubyInstaller2 supports metadata tags for installation of dependent
MSYS2/MINGW libraries. The openssl gem requires the mingw-openssl
package to be installed on the system, which the gem installer takes
care about, when this tag is set.

The feature is documented here:
https://github.com/oneclick/rubyinstaller2/wiki/For-gem-developers#msys2-library-dependency

Fixes https://github.com/oneclick/rubyinstaller2/issues/163

https://github.com/ruby/gdbm/commit/d95eed3e86
2021-04-27 20:54:07 +09:00
Olle Jonsson ad3f4c07d9 [ruby/pathname] gemspec: Explicitly list 0 executables
This gem exposes no executables.

https://github.com/ruby/pathname/commit/c401d97d58
2021-04-27 20:52:48 +09:00
Peter Zhu 4f88acc833 Fix compiler warnings in objspace_dump.c when assertions are turned on
Example:

```
In file included from ../../../include/ruby/defines.h:72,
                 from ../../../include/ruby/ruby.h:23,
                 from ../../../gc.h:3,
                 from ../../../ext/objspace/objspace_dump.c:15:
../../../ext/objspace/objspace_dump.c: In function ‘dump_append_ld’:
../../../ext/objspace/objspace_dump.c:95:26: warning: comparison of integer expressions of different signedness: ‘long unsigned int’ and ‘int’ [-Wsign-compare]
   95 |     RUBY_ASSERT(required <= width);
      |                          ^~
```
2021-04-26 19:26:50 -04:00
Ryuta Kamizono 33f2ff3bab Fix some typos by spell checker 2021-04-26 10:07:41 +09:00
wonda-tea-coffee f9b62b5cc0 [Doc] Fix a typo s/algorthm/algorithm/ 2021-04-25 10:52:29 -04:00
wonda-tea-coffee ca5816e275 [ci skip] Fix a typo s/certificiate/certificate/ 2021-04-25 10:51:45 -04:00
wonda-tea-coffee 04e6383f40 [Doc] Fix a typo s/daguten/dakuten/ 2021-04-25 10:51:23 -04:00
wonda-tea-coffee 532c775e22 [Doc] Fix a typo s/arround/around/ 2021-04-25 10:50:12 -04:00
Charles Oliver Nutter 270b16e70c
[ruby/io-console] Move FFI console under lib
Having the separate dir makes testing difficult and doesn't
reflect the structure the gem will eventually have. We can filter
these files out if necessary when building the CRuby gem.

https://github.com/ruby/io-console/commit/881010447c
2021-04-22 11:53:13 +09:00
Duncan MacGregor 042860bd65
[ruby/io-console] Enable building the C extension on TruffleRuby.
https://github.com/ruby/io-console/commit/c17b8cf3a9
2021-04-22 11:51:37 +09:00
Olle Jonsson 4ac72d37d7 [ruby/io-wait] gemspec: Explicitly list 0 executables
This gem exposes no executables, and this clarifies this.

https://github.com/ruby/io-wait/commit/f491c6cc64
2021-04-21 20:38:00 +09:00