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

74156 Коммитов

Автор SHA1 Сообщение Дата
Nobuyoshi Nakada ab3b1b2381
sync_default_gems.rb: fix links to GitHub issues
- Substitute `GH-xxxx` which does not contain `#` too.
- Split each substitutions.
2022-10-18 11:37:12 +09:00
Hiroshi Shirosaki 329d5424a4 [Bug #19042] Fix Dir.glob brace with '/'
Dir.glob brace pattern with '/' after '**' does not match
paths in recursive expansion process.
We expand braces with '/' before expanding a recursive.

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-18 09:18:03 +09:00
Takashi Kokubun 995bdd69de
Try --x-use-aria2 for better retries (#6574)
to possibly deal with failures like https://ci.appveyor.com/project/ruby/ruby/builds/45097615.

I'm not sure how vcpkg retries things, but at least aria2c seems to attempt downloads 5 times by default.
https://aria2.github.io/manual/en/html/aria2c.html

Looking at the CI log, vcpkg might be already trying it 5 times, but let me give it a try too.
2022-10-17 15:37:56 -07:00
Jemma Issroff b54c8ba8fc Simplified rb_obj_copy_ivar implementation 2022-10-17 14:47:45 -07:00
Takashi Kokubun 1865ed4ab9
Fix an outdated notification message
0d7292ec73
2022-10-17 14:32:46 -07:00
st0012 1c83469fc6 [ruby/irb] Remove unnecessary coloring support check
https://github.com/ruby/irb/commit/ddd7dbe2c5
2022-10-17 21:14:50 +00:00
Takashi Kokubun f11765aef0
YJIT: Allow --yjit-dump-disasm to dump into a file (#6552)
* YJIT: Allow --yjit-dump-disasm to dump into a file

* YJIT: Move IO implementation to disasm.rs

* YJIT: More consistent naming
2022-10-17 10:47:22 -07:00
Takashi Kokubun 64c52c4282
YJIT: Interleave inline and outlined code blocks (#6460)
Co-authored-by: Alan Wu <alansi.xingwu@shopify.com>
Co-authored-by: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>
2022-10-17 10:45:59 -07:00
Takashi Kokubun e7c71c6c92
Make mjit_cont sharable with YJIT (#6556)
* Make mjit_cont sharable with YJIT

* Update dependencies

* Update YJIT binding
2022-10-17 09:27:59 -07:00
Tatsuya Kawano 07a93b1e37
YJIT: Do not call `mprotect` when `mem_size` is zero (#6563)
This allows x86_64 based YJIT to run on Docker Desktop on Apple silicon (arm64)
Mac because it will avoid a subtle behavior difference in `mprotect` system call
between the Linux kernel and `qemu-x86_64` user space emulator.
2022-10-17 12:26:36 -04:00
Alan Wu ad3d210bea YJIT: call free_block to cleanup block when out of memory
The commented out instance of free_block() is left over from the port.
The addition in gen_single_block() was a place we missed. The new block
is allocated in the same function and could have invariants associated
with it even though there is no space to hold all the code.
2022-10-17 12:11:17 -04:00
Nobuyoshi Nakada 637144b834
Adjust indents [ci skip] 2022-10-18 00:23:23 +09:00
Jean Boussier 60defe0a68 thread_sync.c: Clarify and document the behavior of timeout == 0
[Feature #18982]

Instead of introducing an `exception: false` argument to have `non_block`
return nil rather than raise, we can clearly document that a timeout of 0
immediately returns.

The code is refactored a bit to avoid doing a time calculation in
such case.
2022-10-17 16:56:00 +02:00
Ben Toews 7db29de008 [ruby/openssl] add document-method for BN#mod_inverse
https://github.com/ruby/openssl/commit/5befde7519
2022-10-17 23:38:35 +09:00
Ben Toews 149cb049f1 [ruby/openssl] add BN#mod_sqrt
https://github.com/ruby/openssl/commit/4619ab3e76
2022-10-17 23:38:34 +09:00
Ben Toews e037731c9f [ruby/openssl] define BIGNUM_2cr macro for BN function that takes context and
returns a BN

https://github.com/ruby/openssl/commit/4d0971c51c
2022-10-17 23:38:34 +09:00
Nobuyoshi Nakada f6bf5e2c5f
Respect `USE_COMMON_RANDOM` macro by a command line option [ci skip] 2022-10-17 18:36:09 +09:00
Nobuyoshi Nakada b584c106d9
Fix debug messages [ci skip] 2022-10-17 18:36:08 +09:00
Nobuyoshi Nakada f08fcd0e80
Fix possible use of undefined macros on very old macOS [ci skip] 2022-10-17 18:36:08 +09:00
git 85cee29357 Update default gems list at 6166fa612c [ci skip] 2022-10-17 07:43:51 +00:00
Bart de Water 6166fa612c [ruby/openssl] Call out insecure PKCS #1 v1.5 default padding for RSA
https://github.com/ruby/openssl/commit/fd5eaa6dfc
2022-10-17 16:35:35 +09:00
Samuel Williams aecc470a33 [ruby/openssl] Use default `IO#timeout` if possible.
https://github.com/ruby/openssl/commit/471340f612
2022-10-17 16:35:35 +09:00
Christophe De La Fuente 17998ad3bb [ruby/openssl] Add support to SSL_CTX_set_keylog_callback
- This callback is invoked when TLS key material is generated or
  received, in order to allow applications to store this keying material
  for debugging purposes.
- It is invoked with an `SSLSocket` and a string containing the key
  material in the format used by NSS for its SSLKEYLOGFILE debugging
  output.
- This commit adds the Ruby binding `keylog_cb` and the related tests
- It is only compatible with OpenSSL >= 1.1.1. Even if LibreSSL implements
  `SSL_CTX_set_keylog_callback()` from v3.4.2, it does nothing (see
  648d39f0f0)

https://github.com/ruby/openssl/commit/3b63232cf1
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi e4b1627983 [ruby/openssl] ssl: fix "warning: ‘ctx’ may be used uninitialized"
The code was introduced by https://github.com/ruby/openssl/commit/65530b887e54 ("ssl: enable generating keying
material from SSL sessions", 2022-08-03).

This is harmless, but we should avoid it.

https://github.com/ruby/openssl/commit/f5b82e814b
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 04bf83d6f7 [ruby/openssl] bump version number to 3.1.0.pre
https://github.com/ruby/openssl/commit/fceb978a5d
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi cd83f5b961 [ruby/openssl] Ruby/OpenSSL 3.0.1
https://github.com/ruby/openssl/commit/e5bbd015dc
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 15a966a674 [ruby/openssl] Ruby/OpenSSL 2.2.2
https://github.com/ruby/openssl/commit/de8a644bc4
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 33d30a8675 [ruby/openssl] Ruby/OpenSSL 2.1.4
https://github.com/ruby/openssl/commit/5316241e61
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi b69d41e1c4 [ruby/openssl] pkey/ec: check existence of public key component before exporting
i2d_PUBKEY_bio() against an EC_KEY without the public key component
trggers a null dereference.

This is a regression introduced by commit https://github.com/ruby/openssl/commit/56f0d34d63fb ("pkey:
refactor #export/#to_pem and #to_der", 2017-06-14).

Fixes https://github.com/ruby/openssl/pull/527#issuecomment-1220504524
Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1221554057

https://github.com/ruby/openssl/commit/f6ee0fa4de
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 0677b2fb87 [ruby/openssl] pkey: restore support for decoding "openssl ecparam -genkey" output
Scan through the input for a private key, then fallback to generic
decoder.

OpenSSL 3.0's OSSL_DECODER supports encoded key parameters. The PEM
header "-----BEGIN EC PARAMETERS-----" is used by one of such encoding
formats. While this is useful for OpenSSL::PKey::PKey, an edge case has
been discovered.

The openssl CLI command line "openssl ecparam -genkey" prints two PEM
blocks in a row, one for EC parameters and another for the private key.
Feeding the whole output into OSSL_DECODER results in only the first PEM
block, the key parameters, being decoded. Previously, ruby/openssl did
not support decoding key parameters and it would decode the private key
PEM block instead.

While the new behavior is technically correct, "openssl ecparam -genkey"
is so widely used that ruby/openssl does not want to break existing
applications.

Fixes https://github.com/ruby/openssl/pull/535

https://github.com/ruby/openssl/commit/d486c82833
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 4fb2845c7b [ruby/openssl] pkey: clear error queue before each OSSL_DECODER_from_bio() call
Fix potential error queue leak.

https://github.com/ruby/openssl/commit/3992b6f208
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 10f93a8bd7 [ruby/openssl] pkey/dsa: let PKey::DSA.generate choose appropriate q size
DSA parameters generation via EVP_PKEY_paramgen() will not automatically
adjust the size of q value but uses 224 bits by default unless specified
explicitly. This behavior is different from the now-deprecated
DSA_generate_parameters_ex(), which PKey::DSA.generate used to call.

Fixes https://github.com/ruby/openssl/issues/483

Fixes: https://github.com/ruby/openssl/commit/1800a8d5ebaf ("pkey/dsa: use high level EVP interface to generate parameters and keys", 2020-05-17)

https://github.com/ruby/openssl/commit/0105975a0b
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi 65bba0ef6f [ruby/openssl] hmac: use EVP_PKEY_new_raw_private_key() if available
Current OpenSSL 3.0.x release has a regression with zero-length MAC
keys. While this issue should be fixed in a future release of OpenSSL,
we can use EVP_PKEY_new_raw_private_key() in place of the problematic
EVP_PKEY_new_mac_key() to avoid the issue. OpenSSL 3.0's man page
recommends using it regardless:

> EVP_PKEY_new_mac_key() works in the same way as
> EVP_PKEY_new_raw_private_key().  New applications should use
> EVP_PKEY_new_raw_private_key() instead.

Fixes https://github.com/ruby/openssl/issues/369#issuecomment-1224912710

https://github.com/ruby/openssl/commit/4293f18b1f
2022-10-17 16:35:35 +09:00
Kazuki Yamaguchi bee383d9fe [ruby/openssl] x509*: fix error queue leak in #extensions= and #attributes= methods
X509at_delete_attr() in OpenSSL master puts an error queue entry if
there is no attribute left to delete. We must either clear the error
queue, or try not to call it when the list is already empty.

https://github.com/ruby/openssl/commit/a0c878481f
2022-10-17 16:35:35 +09:00
madblobfish 79543b9a53 [ruby/openssl] ssl: enable generating keying material from SSL sessions
Add OpenSSL::SSL::SSLSocket#export_keying_material to support RFC 5705

https://github.com/ruby/openssl/commit/65530b887e
2022-10-17 16:35:35 +09:00
Nobuhiro IMAI a98096349e [ruby/openssl] Check if the option is an Hash in `pkey_ctx_apply_options0()`
causes SEGV if it is an Array or something like that.

https://github.com/ruby/openssl/commit/ef23525210
2022-10-17 16:35:35 +09:00
MSP-Greg c865e8d161 [ruby/openssl] [CI] TestHMAC#test_dup - remove 'pend' for OpenSSL 3
https://github.com/ruby/openssl/commit/626b0434a6
2022-10-17 16:35:35 +09:00
Alan Wu 5dae78b9d3 [ruby/openssl] Pass arguments to check macro presence
X509_STORE_get_ex_new_index() is a macro, so passing just its name to
have_func() doesn't detect it. Pass an example call instead.

https://github.com/ruby/openssl/commit/8d264d3e60

Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
2022-10-17 16:35:35 +09:00
Alan Wu a211b32180 [ruby/openssl] Check for OpenSSL functions in headers
While building with a custom build of OpenSSL, I noticed in mkmf.log
that all the feature detection checks are done using a program lacking
an OpenSSL header include. `mkmf` retries using a fallback program when
this fails, but that means all the `have_func` calls compile twice when
compiling once should suffice. Example log without this commit:

    have_func: checking for X509_STORE_CTX_get0_cert()... -------------------- yes

    DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang -o conftest ...
    conftest.c:14:57: error: use of undeclared identifier 'X509_STORE_CTX_get0_cert'
    int t(void) { void ((*volatile p)()); p = (void ((*)()))X509_STORE_CTX_get0_cert; return !p; }
                                                            ^
    1 error generated.
    checked program was:
    /* begin */
     1: #include "ruby.h"
     2:
     3: /*top*/
     4: extern int t(void);
     5: int main(int argc, char **argv)
     6: {
     7:   if (argc > 1000000) {
     8:     int (* volatile tp)(void)=(int (*)(void))&t;
     9:     printf("%d", (*tp)());
    10:   }
    11:
    12:   return !!argv[argc];
    13: }
    14: int t(void) { void ((*volatile p)()); p = (void ((*)()))X509_STORE_CTX_get0_cert; return !p; }
    /* end */

    DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang -o conftest ...
    checked program was:
    /* begin */
     1: #include "ruby.h"
     2:
     3: /*top*/
     4: extern int t(void);
     5: int main(int argc, char **argv)
     6: {
     7:   if (argc > 1000000) {
     8:     int (* volatile tp)(void)=(int (*)(void))&t;
     9:     printf("%d", (*tp)());
    10:   }
    11:
    12:   return !!argv[argc];
    13: }
    14: extern void X509_STORE_CTX_get0_cert();
    15: int t(void) { X509_STORE_CTX_get0_cert(); return 0; }
    /* end */

The second compilation succeeds.

Specify the header for each checked function.

https://github.com/ruby/openssl/commit/34ae7d92d0
2022-10-17 16:35:33 +09:00
Kazuki Yamaguchi 63234edf67 openssl: use the old rb_ary_tmp_new() alias
openssl has to support older versions of Ruby. Undo the change in
ext/openssl/ossl_pkey_ec.c by commit efb91ff19b ("Rename
rb_ary_tmp_new to rb_ary_hidden_new", 2022-07-25).
2022-10-17 16:25:51 +09:00
Takashi Kokubun b7de04d161
Disable dependabot for auto-request-review for now
because you have to manually update the version tag comment.
It feels unsafe to trust third party git tags when you need to pass
MATZBOT_GITHUB_TOKEN to it. Git commit sha alone isn't human-readable
and I'm reluctant to remove the comment either. It doesn't seem worth
the effort to review changes for every release of this action.
2022-10-16 22:47:49 -07:00
dependabot[bot] bfc6c1f1cb
Bump necojackarc/auto-request-review from 0.7.0 to 0.8.0 (#6571)
Bumps [necojackarc/auto-request-review](https://github.com/necojackarc/auto-request-review) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/necojackarc/auto-request-review/releases)
- [Commits](e08cdffa27...b5e8187645)

---
updated-dependencies:
- dependency-name: necojackarc/auto-request-review
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-16 22:45:02 -07:00
Takashi Kokubun fb6a9656a1
Do not run CodeQL on dependabot PRs 2022-10-16 22:44:15 -07:00
Takashi Kokubun 0d7292ec73
Leave only the oldest Visual Studio in AppVeyor (#6561) 2022-10-16 22:02:47 -07:00
Nobuyoshi Nakada 7cf37a5722
[DOC] Add the polar form in String#to_c 2022-10-17 12:02:34 +09:00
yui-knk e4191ac1ec Change a tab to spaces 2022-10-17 11:30:07 +09:00
Nobuyoshi Nakada ba9c0d0b9f
Allow run bundled_gems manually [ci skip] 2022-10-16 18:31:08 +09:00
Nobuyoshi Nakada 15488fc1c6
Update bundled gems list at 2022-10-16 2022-10-16 18:22:20 +09:00
Aaron Patterson f0654b1027 More precisely iterate over Object instance variables
Shapes provides us with an (almost) exact count of instance variables.
We only need to check for Qundef when an IV has been "undefined"
Prefer to use ROBJECT_IV_COUNT when iterating IVs
2022-10-15 10:44:10 -07:00
Burdette Lamar 8d20632df8
[DOC] Packed data (#6520)
New page for packed data
2022-10-15 10:53:08 -05:00