Commit graph

89995 commits

Author SHA1 Message Date
Kazuki Yamaguchi
87316d58fa [ruby/openssl] pkey: change PKey::{RSA,DSA,DH}#params to use nil for missing parameters
The returned Hash from these methods contain 0 in place of a missing
parameter in the key, for example:

	pkey = OpenSSL::PKey.read(OpenSSL::PKey::RSA.new(2048).public_to_pem)
	pp pkey.params
	#=>
	# {"n"=>#<OpenSSL::BN 2869346734[...snip]>,
	#  "e"=>#<OpenSSL::BN 65537>,
	#  "d"=>#<OpenSSL::BN 0>,
	#  "p"=>#<OpenSSL::BN 0>,
	#  "q"=>#<OpenSSL::BN 0>,
	#  "dmp1"=>#<OpenSSL::BN 0>,
	#  "dmq1"=>#<OpenSSL::BN 0>,
	#  "iqmp"=>#<OpenSSL::BN 0>}

Let's use nil instead, which is more appropriate for indicating a
missing value.

f247ec3dec
2025-01-23 01:45:52 +09:00
Kazuki Yamaguchi
ec4592280f [ruby/openssl] pkey: implement PKey::{RSA,DSA,DH}#params in Ruby
Move the definitions to lib/openssl/pkey.rb. They need not to be in the
extension and can be implemented using existing methods.

This reduces direct usage of the now-deprecated OpenSSL APIs around the
low-level structs such as DH, DSA, or RSA.

c14178f387
2025-01-23 01:45:51 +09:00
Kazuki Yamaguchi
47fe59cd82 [ruby/openssl] pkey: add tests for PKey::{RSA,DSA,DH}#params
Add missing test cases to verify the current behavior. The next patch
will rewrite those methods.

c0e0669f9b
2025-01-23 01:45:51 +09:00
Kazuki Yamaguchi
72480389d1 [ruby/openssl] ssl: fix SSLSocket#sysread leaking locktmp String on timeout
Commit 3bbf5178a9 made blocking methods on SSLSocket follow the
IO#timeout= value. The commit changed io_wait_readable() to potentially
raise an exception without unlocking the String.

The String is currently locked for the entire duration of a #sysread
method call. This does not seem to be necessary, as SSL_read() does not
require that the same buffer is specified when retrying. Locking the
String during each SSL_read() call should be sufficient.

8f791d73f5
2025-01-22 16:45:19 +00:00
Peter Zhu
4df16051be [ruby/mmtk] Remove unused lazy_static dependency
f47a1e2d17
2025-01-22 16:07:04 +00:00
tomoya ishida
8c4134a31e [ruby/irb] Use EnvUtil.rubybin instead of "ruby" in copy command
test
(https://github.com/ruby/irb/pull/1071)

`ruby` is not always available.

f6c5106364
2025-01-22 15:58:56 +00:00
git
8a9e3b575e Update default gems list at 6821b05749 [ci skip] 2025-01-22 14:09:25 +00:00
tomoya ishida
6821b05749 [ruby/irb] Bump version to 1.15.1
(https://github.com/ruby/irb/pull/1070)

df37b074e3
2025-01-22 23:08:34 +09:00
tomoya ishida
c066453118 [ruby/irb] Fix pager preview with escape sequence and newlines
(https://github.com/ruby/irb/pull/1069)

a139562a07
2025-01-22 23:08:34 +09:00
Stan Lo
9ce642c282 [ruby/irb] Update documentation about the new copy command
(https://github.com/ruby/irb/pull/1067)

6194111611
2025-01-22 23:08:34 +09:00
tomoya ishida
7813edbe19 [ruby/irb] Show a quick preview of inspect result before pager
launch
(https://github.com/ruby/irb/pull/1040)

* Quickly show inspect preview even if pretty_print takes too much time

* Show a message "Inspecting..." while generating pretty_print content

* Update inspecting message

Co-authored-by: Stan Lo <stan001212@gmail.com>

* Update rendering test for preparing inspect message

* Don't show preview if pretty_print does not take time

---------

03c36586e6

Co-authored-by: Stan Lo <stan001212@gmail.com>
2025-01-22 23:08:34 +09:00
Prajjwal Singh
c6e8ee4514 [ruby/irb] Add copy command (https://github.com/ruby/irb/pull/1044)
Closes https://github.com/ruby/irb/pull/753

a24ac53d48
2025-01-22 23:08:34 +09:00
Peter Zhu
89240eb2fb Add generic ivar reference updating step
Previously, generic ivars worked differently than the other global tables
during compaction. The other global tables had their references updated
through iteration during rb_gc_update_vm_references. Generic ivars updated
the keys when the object moved and updated the values while reference
updating the object. This is inefficient as this required one lookup for
every moved object and one lookup for every object with generic ivars.

Instead, this commit changes it to iterate over the generic ivar table to
update both the keys and values.
2025-01-22 08:54:52 -05:00
Nobuyoshi Nakada
7070b1b196
Relax expectations of errors from getgrnam
The list of errors cited in 58bc97628c
is not exhaustive and other errors may be raised by `getgrnam`.
Additionally, these errors are system dependent and may not be listed
on all platforms.
2025-01-22 18:19:54 +09:00
git
9f78c727ea Update bundled gems list as of 2025-01-21 2025-01-22 06:59:48 +00:00
Kouhei Yanagita
99792d0634 [DOC] Fix code markup in String#match 2025-01-22 15:07:19 +09:00
Theo Buehler
72fdba156d [ruby/openssl] Use X509_ALGOR_get0() accessor for X509_ALGOR
While the struct is currently still public in OpenSSL, there has been
an accessor since OpenSSL 0.9.8h. It would be nice if this accessor
could be used so that the struct can be made opaque at some point in
the future.

812aeab2f5
2025-01-21 18:17:06 +00:00
Kazuki Yamaguchi
43c48e3030 [ruby/openssl] Require OpenSSL 1.1.1 or later
Drop support for OpenSSL 1.1.0. OpenSSL 1.1.0 was a non-LTS release and
it has reached upstream EOL in 2019-12 along with OpenSSL 1.0.2.
Distributions that shipped with OpenSSL 1.1.0 include:

 - Debian 9 (EOL 2022-06)
 - Ubuntu 18.04 LTS (EOL 2023-04)

ba83abe920
2025-01-21 18:14:14 +00:00
Kazuki Yamaguchi
e7bd1d1a9a [ruby/openssl] pkey/dh: do not skip test_params_ok? on LibreSSL
cd91cef590
2025-01-21 18:14:12 +00:00
Peter Zhu
be66448311 [ruby/mmtk] Bump mmtk-core
Fixes a bug where there is an infinite loop when MMTK_HEAP_MIN is small.

12c7ede20b
2025-01-21 17:02:18 +00:00
Peter Zhu
6d806031ed [ruby/mmtk] Add tests for MMTK_HEAP_MIN
a725b95f51
2025-01-21 17:02:17 +00:00
git
b8a2b1068a Update default gems list at abed4ea810 [ci skip] 2025-01-21 16:25:21 +00:00
Stan Lo
abed4ea810 [ruby/irb] Bump version to v1.15.0
(https://github.com/ruby/irb/pull/1066)

d3531d8fc0
2025-01-21 16:24:12 +00:00
Nobuyoshi Nakada
a47ed9f4aa
Fix lrama for snapshot
- Old versions should compile parse.y by `bison` or the bundled
  version `lrama`, not the `lrama` in the running repository.

- Check variables for ruby executable more strictly.
2025-01-21 23:12:38 +09:00
ydah
2b1db0faec Remove unnecessary assignments to local variables in f_arg_asgn
Local variables are not reassigned and are not needed.
2025-01-21 20:25:38 +09:00
ydah
3260b0b647 Remove unnecessary assignments to local variables in strings
Local variables are not reassigned and are not needed.
2025-01-21 20:25:38 +09:00
Hiroshi SHIBATA
5d6f76cf6e
ext/json/parser/prereq.mk is removed from sync target 2025-01-21 19:45:57 +09:00
Charles Oliver Nutter
b1d5d1666e [ruby/resolv] Check for Windows in JRuby-compatible way
de95f557b0
2025-01-21 08:03:42 +00:00
Nobuyoshi Nakada
d3bd8df2b8 [ruby/resolv] Use port number 0 for ephemeral port if save
On platforms where ephemeral port randomization is implemented, the
same randomization is not needed in the ruby library layer.

Fixes https://github.com/ruby/resolv/pull/63.

45e1b563c0
2025-01-21 07:58:34 +00:00
wanabe
e5f81e511f [ruby/error_highlight] Use $stderr instead of STDERR for Ractor
a221a4b0eb
2025-01-21 03:32:15 +00:00
ydah
f33a76bfa9 Lrama v0.7.0 2025-01-21 10:16:05 +09:00
Earlopain
769cccba56 [ruby/prism] Fix parser translator scope issues for implicit hash values
`builder.pair_label` is no good since it makes use of variables that the parser gem encountered.
Since the prism translator doesn't keep proper track of that information, the following code interprets
the implicit value as a local variable, even though it is not in scope:

```rb
def foo
  bar = 123
end

{ bar: }
```

bbeb5b083a
2025-01-20 18:03:13 +00:00
Kazuki Yamaguchi
c6c1e7a92a [ruby/openssl] extconf.rb: remove dir_config("kerberos")
The dir_config was introduced by Ruby trunk r4181. Since support for
Kerberos cipher suites has been removed in OpenSSL 1.1.0, it is no
longer necessary.

Although ruby/openssl did not directly depend on the MIT Kerberos
library, it was an optional transitive dependency. Unless it was
disabled by a compile-time option, the OpenSSL headers would try to
include <krb5.h>.

78d028c332
2025-01-20 17:12:57 +00:00
Kazuki Yamaguchi
441862dc9f [ruby/openssl] Require OpenSSL 1.1.0 or later
Drop support for OpenSSL 1.0.2. It has reached upstream EOL in 2019-12.

Most distributions that shipped with OpenSSL 1.0.2 have also reached
EOL, or provide a newer version in the package repository:

 - RHEL 7 (EOL 2024-06)
 - Ubuntu 16.04 LTS (EOL 2021-04)
 - Amazon Linux 2 (EOL 2026-06, but OpenSSL 1.1.1 can be installed via
   the openssl11{,-devel} package)

38ec6fd50e
2025-01-20 17:12:57 +00:00
Kazuki Yamaguchi
010e8bff88 [ruby/openssl] pkcs7: remove unnecessary const cast
PKCS7_encrypt() and PKCS7_SIGNER_INFO_set() take const EVP_CIPHER and
EVP_MD at least since OpenSSL 0.9.7.

9db621a5c0
2025-01-20 17:12:55 +00:00
Kazuki Yamaguchi
04cc762941 [ruby/openssl] engine: remove constants for ENGINE_METHOD_BN_MOD_EXP{,_CRT}
These macros do not exist in OpenSSL 0.9.7 or later, which was released
in 2002.

938a1e6aab
2025-01-20 17:12:55 +00:00
Peter Zhu
5a448a87fc Remove dead function rb_func_proc_new 2025-01-20 10:31:36 -05:00
S-H-GAMELINKS
5c95898e93 Remove rb_obj_as_string for Parser
Ruby Parser not used rb_obj_as_string.
And obj_as_string property can be removed from Universal Parser.
2025-01-20 23:52:56 +09:00
Jun Aruga
6d3951e788 .travis.yml: Drop arm64 case.
We started running a Linux arm64 case in GitHub Actions.[1] So, it's time to
drop the Linux arm64 case in Travis CI.

[1] a9d37ac3e5
2025-01-20 15:48:08 +01:00
tompng
86b262179d [ruby/json] Reject invalid number: - -.1 -e0
b9bfeecfa9
2025-01-20 14:20:55 +01:00
tompng
525d7a68e4 [ruby/json] Raise parse error on invalid comments
2f57f40467
2025-01-20 14:20:55 +01:00
tompng
c026e44bb5 [ruby/json] Fix parsing incomplete unicode escape "\uaaa"
86c0d4eb7e
2025-01-20 14:20:55 +01:00
Jean Boussier
2b4b7bdb10 [ruby/json] Fix JSON::Fragment#to_json signature
f8817fe56c
2025-01-20 14:20:55 +01:00
Étienne Barrié
e8676cada8 [ruby/json] Introduce JSON::Fragment
9e3500f345

Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2025-01-20 14:20:55 +01:00
Nobuyoshi Nakada
ba44e92573 ext/json no longer uses ragel 2025-01-20 21:37:20 +09:00
Jean Boussier
8c30970c58 Revert "Skip RBS::SchemaTest"
This reverts commit 4404688a0e.
2025-01-20 10:31:56 +01:00
Jean Boussier
33708f2dc4 [ruby/json] Fix a regression in the parser with leading /
Ref: https://github.com/ruby/ruby/pull/12598

This could lead to an infinite loop.

f8cfa2696a
2025-01-20 10:31:56 +01:00
Hiroshi SHIBATA
4404688a0e Skip RBS::SchemaTest 2025-01-20 16:09:00 +09:00
Hiroshi SHIBATA
e3ba5207b5 Removed parser.rl from ext/json/parser/depend 2025-01-20 16:09:00 +09:00
Jean Boussier
df8f93848e [ruby/json] json_string_unescape: use memchr to search for backslashes
5e6cfcf724
2025-01-20 16:09:00 +09:00