summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2023-10-12Switch mid dump to dump_append_string_valueJohn Hawthorn
I don't think it's possible to create a CI with a mid which would need escaping to be in a JSON string, but I think we might as well not rely on that assumption.
2023-10-12Fix ObjectSpace.dump with super() callinfoJohn Hawthorn
super() uses 0 as mid for its callinfo, so we need to check for that to avoid a segfault when using dump_all.
2023-10-11[ruby/psych] Bump up v5.1.1Hiroshi SHIBATA
https://github.com/ruby/psych/commit/f306512d60
2023-10-10ripper: Support member references in the DSLNobuyoshi Nakada
2023-10-06Remove `NODE_VALUES`Nobuyoshi Nakada
This node type was added for the multi-value experiment back in 2004. The feature itself was removed after a few years, but this is its remnant.
2023-10-05[ruby/stringio] StringIO#pread: handle 0 length like IO#preadJean byroot Boussier
(https://github.com/ruby/stringio/pull/67) Fix: https://github.com/ruby/stringio/issues/66 If length is 0, IO#pread don't even try to read the IO, it simply return the buffer untouched if there is one or a new empty buffer otherwise. It also doesn't validate the offset when length is 0. cc @jdelStrother @kou https://github.com/ruby/stringio/commit/37e9279337 Co-authored-by: Jean Boussier <jean.boussier@gmail.com>
2023-10-05Move internal NODE_DEF_TEMP to parse.yNobuyoshi Nakada
2023-10-04[ruby/bigdecimal] Bump up to 3.1.5Nobuyoshi Nakada
https://github.com/ruby/bigdecimal/commit/c47802e813
2023-10-02Dump name of method for imemo callinfoPeter Zhu
This commit dumps the `mid` of the imemo callinfo when calling `ObjectSpace.dump_all`.
2023-10-02[ruby/psych] Update SnakeYAML Engine to 2.7Charles Oliver Nutter
https://github.com/ruby/psych/commit/094c811588
2023-10-01Use rb_node_opt_arg_t and rb_node_kw_arg_t instead of NODEyui-knk
2023-09-30Extract `ripper_parser_params`Nobuyoshi Nakada
2023-09-29Merge NODE_DEF_TEMP and NODE_DEF_TEMP2yui-knk
2023-09-28Change RNode structure from union to structyui-knk
All kind of AST nodes use same struct RNode, which has u1, u2, u3 union members for holding different kind of data. This has two problems. 1. Low flexibility of data structure Some nodes, for example NODE_TRUE, don’t use u1, u2, u3. On the other hand, NODE_OP_ASGN2 needs more than three union members. However they use same structure definition, need to allocate three union members for NODE_TRUE and need to separate NODE_OP_ASGN2 into another node. This change removes the restriction so make it possible to change data structure by each node type. 2. No compile time check for union member access It’s developer’s responsibility for using correct member for each node type when it’s union. This change clarifies which node has which type of fields and enables compile time check. This commit also changes node_buffer_elem_struct buf management to handle different size data with alignment.
2023-09-26[Bug #19902] Update the coderange regarding the changed regionNobuyoshi Nakada
2023-09-25ripper: Support named references in the DSLNobuyoshi Nakada
2023-09-22[ruby/stringio] [DOC] Fix linkBurdette Lamar
(https://github.com/ruby/stringio/pull/65) https://github.com/ruby/stringio/commit/e3ea087d04
2023-09-21[ruby/openssl] Ruby/OpenSSL 3.2.0Kazuki Yamaguchi
https://github.com/ruby/openssl/commit/6b3dd6a372
2023-09-21[ruby/openssl] Update README and gemspec descriptionKazuki Yamaguchi
* Reword the description in README for more clarity. * Add a compatibility matrix of our stable branches and explain the maintenance policy. * Remove the obsolete paragraph for how to use the gem in Ruby 2.3, which is no longer supported. https://github.com/ruby/openssl/commit/7691034fcb
2023-09-20[ruby/date] [DOC] Fix linkBurdetteLamar
https://github.com/ruby/date/commit/2adb917487
2023-09-17[ruby/fiddle] Suppress -Wundef warnings on arm64 macOS and WindowsNobuyoshi Nakada
(https://github.com/ruby/fiddle/pull/134) ``` In file included from ../../../../ext/fiddle/fiddle.h:46: /opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef] ^ ``` c.f. https://github.com/libffi/libffi/pull/796 https://github.com/ruby/fiddle/commit/d4feb57098
2023-09-17ripper: Preprocess ripper-dispatchable types onlyNobuyoshi Nakada
Keep the other types, which not having setter macros for ripper.
2023-09-10Set ripper_init.c.tmpl to C mode [ci skip]Nobuyoshi Nakada
2023-09-06[ruby/openssl] x509ext: let X509::ExtensionFactory#create_ext take a dotted ↵Michael Richardson
OID string instead of looking of NIDs and then using X509V3_EXT_nconf_nid, instead just pass strings to X509V3_EXT_nconf, which has all the logic for processing dealing with generic extensions also process the oid through ln2nid() to retain compatibility. [rhe: tweaked commit message and added a test case] https://github.com/ruby/openssl/commit/9f15741331
2023-09-06[ruby/openssl] Fix OCSP documentationPetrik
`port` should be called on the `ocsp_uri` URI instead of `ocsp`, which is just a string. https://github.com/ruby/openssl/commit/89a1c82dd0
2023-09-06[ruby/openssl] Prefer String#unpack1Mau Magnaguagno
(https://github.com/ruby/openssl/pull/586) String#unpack1 avoids the intermediate array created by String#unpack for single elements, while also making a call to Array#first/[0] unnecessary. https://github.com/ruby/openssl/commit/8eb0715a42
2023-09-06[ruby/openssl] ssl: use ffdhe2048 from RFC 7919 as the default DH group ↵Kazuki Yamaguchi
parameters In TLS 1.2 or before, if DH group parameters for DHE are not supplied with SSLContext#tmp_dh= or #tmp_dh_callback=, we currently use the self-generated parameters added in commit https://github.com/ruby/openssl/commit/bb3399a61c03 ("support 2048 bit length DH-key", 2016-01-15) as the fallback. While there is no known weakness in the current parameters, it would be a good idea to switch to pre-defined, more well audited parameters. This also allows the fallback to work in the FIPS mode. The PEM encoding was derived with: # RFC 7919 Appendix A.1. ffdhe2048 print OpenSSL::PKey.read(OpenSSL::ASN1::Sequence([OpenSSL::ASN1::Integer((<<-END).split.join.to_i(16)), OpenSSL::ASN1::Integer(2)]).to_der).to_pem FFFFFFFF FFFFFFFF ADF85458 A2BB4A9A AFDC5620 273D3CF1 D8B9C583 CE2D3695 A9E13641 146433FB CC939DCE 249B3EF9 7D2FE363 630C75D8 F681B202 AEC4617A D3DF1ED5 D5FD6561 2433F51F 5F066ED0 85636555 3DED1AF3 B557135E 7F57C935 984F0C70 E0E68B77 E2A689DA F3EFE872 1DF158A1 36ADE735 30ACCA4F 483A797A BC0AB182 B324FB61 D108A94B B2C8E3FB B96ADAB7 60D7F468 1D4F42A3 DE394DF4 AE56EDE7 6372BB19 0B07A7C8 EE0A6D70 9E02FCE1 CDF7E2EC C03404CD 28342F61 9172FE9C E98583FF 8E4F1232 EEF28183 C3FE3B1B 4C6FAD73 3BB5FCBC 2EC22005 C58EF183 7D1683B2 C6F34A26 C1B2EFFA 886B4238 61285C97 FFFFFFFF FFFFFFFF END https://github.com/ruby/openssl/commit/a5527cb4f4
2023-09-06[ruby/openssl] Refactor Buffering consume_rbuff and getbyte methodsMau Magnaguagno
Prefer ``slice!`` for ``Buffering#consume_rbuff`` and safe navigation with ``ord`` for ``Buffering#getbyte``, similar to ``each_byte``. https://github.com/ruby/openssl/commit/5f6abff178
2023-09-06[ruby/openssl] Remove OSSL_DEBUG compile-time optionKazuki Yamaguchi
Remove the OSSL_DEBUG flag and OpenSSL.mem_check_start which is only compiled when the flag is given. They are meant purely for development of Ruby/OpenSSL. OpenSSL.mem_check_start helped us find memory leak bugs in past, but it is no longer working with the recent OpenSSL versions. Let's just remove it now. https://github.com/ruby/openssl/commit/8c7a6a17e2
2023-08-30BasicSocket#recv* return `nil` rather than an empty packetJean Boussier
[Bug #19012] man recvmsg(2) states: > Return Value > These calls return the number of bytes received, or -1 if an error occurred. > The return value will be 0 when the peer has performed an orderly shutdown. Not too sure how one is supposed to make the difference between a packet of size 0 and a closed connection. Notes: Merged: https://github.com/ruby/ruby/pull/6407
2023-08-29Development of 3.0.9 started.Sutou Kouhei
2023-08-28[ruby/openssl] ossl_pkey.c: Workaround: Decode with non-zero selections.Jun Aruga
This is a workaround for the decoding issue in ossl_pkey_read_generic(). The issue happens in the case that a key management provider is different from a decoding provider. Try all the non-zero selections in order, instead of selection 0 for OpenSSL 3 to avoid the issue. https://github.com/ruby/openssl/commit/db688fa739
2023-08-25[ruby/openssl] Fix LIBRESSL_VERSION_NUMBER document mistake.Jun Aruga
* Fix the wrong man reference. * According to the LIBRESSL_VERSION_NUMBER(3), the value always ends with 00f. ``` $ man -M /home/jaruga/.local/libressl-6650dce/share/man/ 3 LIBRESSL_VERSION_NUMBER ... DESCRIPTION OPENSSL_VERSION_NUMBER and LIBRESSL_VERSION_NUMBER are numeric release version identifiers. The first two digits contain the major release number, the third and fourth digits the minor release number, and the fifth and sixth digits the fix re‐ lease number. For OpenSSL, the seventh and eight digits contain the patch release number and the final digit is 0 for development, 1 to e for betas 1 to 14, or f for release. For LibreSSL, OPENSSL_VERSION_NUMBER is always 0x020000000, and LIBRESSL_VERSION_NUMBER always ends with 00f. ``` https://github.com/ruby/openssl/commit/296c859d18
2023-08-25include missing header卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/8274
2023-08-25use configure-detected sanity of _Alignof卜部昌平
This is actually already checked in (Ruby's) configure. Notes: Merged: https://github.com/ruby/ruby/pull/8274
2023-08-25tool/update-deps --fix卜部昌平
Notes: Merged: https://github.com/ruby/ruby/pull/8274
2023-08-18[ruby/io-console] Get rid of address of an rvalue on TruffleRubyNobuyoshi Nakada
https://github.com/ruby/io-console/commit/653c1cd33f
2023-08-18[ruby/io-console] Avoid the influence of special variable `$/`Nobuyoshi Nakada
https://github.com/ruby/io-console/commit/5f71354332
2023-08-18[ruby/io-console] Ensure to put a newline after passwordNobuyoshi Nakada
https://github.com/ruby/io-console/commit/15e36af171
2023-08-18[ruby/io-console] Flush after promptNobuyoshi Nakada
https://github.com/ruby/io-console/commit/040a1d6259
2023-08-18[ruby/io-console] Enable `getpass` methods alwaysNobuyoshi Nakada
https://github.com/ruby/io-console/commit/57f9649df4
2023-08-18[ruby/io-console] [DOC] Remove a trailing space from the prompt tooNobuyoshi Nakada
https://github.com/ruby/io-console/commit/85a155f25f
2023-08-18[ruby/io-console] * remove trailing spaces [ci skip]Nobuyoshi Nakada
https://github.com/ruby/io-console/commit/a0544eb74f
2023-08-18[ruby/io-console] [DOC] IO::console.getpass usage exampleOlivier Lacan
There were no clear example of this very useful method's usage anywhere in the IO or IO::Console docs, which was a shame. https://github.com/ruby/io-console/commit/4d324586a8
2023-08-16[ruby/openssl] Enhance printing OpenSSL versions.Jun Aruga
* Updated the `OpenSSL::OPENSSL_VERSION_NUMBER` comment explaining the format. * Added the `OpenSSL::LIBRESSL_VERSION_NUMBER` to print LibreSSL version number, in the case that Ruby OpenSSL binding is compiled with LibreSSL. Note `test/openssl/utils.rb#libressl?` is not using this value in it for now. * Update `rake debug` to print the values in a readable way, adding `OpenSSL::OPENSSL_VERSION_NUMBER` and `OpenSSL::LIBRESSL_VERSION_NUMBER`. https://github.com/ruby/openssl/commit/d19e6360ed
2023-08-16[ruby/openssl] Include "additional data" message in OpenSSL errorsKazuki Yamaguchi
Error entries in the OpenSSL error queue may contain additional contextual information associated with the error, which can be helpful when debugging. This "additional data" is currently only printed to stderr when OpenSSL.debug is enabled. Let's include this in the exception messages raised with ossl_raise(), too. $ ruby -Ilib -ropenssl -e'OpenSSL.debug=true; OpenSSL::SSL::SSLContext.new.ecdh_curves="P-256:not-a-curve"' -e:1: warning: error on stack: error:0A080106:SSL routines:gid_cb:passed invalid argument (group 'not-a-curve' cannot be set) -e:1:in `ecdh_curves=': passed invalid argument (group 'not-a-curve' cannot be set) (OpenSSL::SSL::SSLError) from -e:1:in `<main>' https://github.com/ruby/openssl/commit/1c5bbdd68e
2023-08-16[ruby/openssl] ssl: raise SSLError if loading ca_file or ca_path failsKazuki Yamaguchi
When compiled with OpenSSL <= 1.1.1, OpenSSL::SSL::SSLContext#setup does not raise an exception on an error return from SSL_CTX_load_verify_locations(), but instead only prints a verbose-mode warning. This is not helpful since it very likely indicates an actual error, such as the specified file not being readable. Also, OpenSSL's error queue is not correctly cleared: $ ruby -w -ropenssl -e'OpenSSL.debug=true; ctx=OpenSSL::SSL::SSLContext.new; ctx.ca_file="bad-path"; ctx.setup; pp OpenSSL.errors' -e:1: warning: can't set verify locations ["error:02001002:system library:fopen:No such file or directory", "error:2006D080:BIO routines:BIO_new_file:no such file", "error:0B084002:x509 certificate routines:X509_load_cert_crl_file: system lib"] The behavior is currently different when compiled with OpenSSL >= 3.0: SSLError is raised if SSL_CTX_load_verify_file() or SSL_CTX_load_verify_dir() fails. This inconsistency was unintentionally introduced by commit https://github.com/ruby/openssl/commit/5375a55ffc35 ("ssl: use SSL_CTX_load_verify_{file,dir}() if available", 2020-02-22). However, raising SSLError seems more appropriate in this situation. Let's adjust the OpenSSL <= 1.1.1 code so that it behaves the same way as the OpenSSL >= 3.0 code currently does. Fixes: https://github.com/ruby/openssl/issues/649 https://github.com/ruby/openssl/commit/7eb10f7b75
2023-08-16[ruby/openssl] Raise an error when the specified OpenSSL library directory ↵Jun Aruga
doesn't exist. OpenSSL built from the source creates the library directory to the `/path/to/openssl_dir/lib64` as a default. In the case, the `bundle exec rake compile -- --with-openssl-dir=<openssl_dir>` cannot compile with the lib64 directory, and may compile with system OpenSSL's libraries unintentionally. This commit is to check this case to avoid linking with an unintentional library directory. https://github.com/ruby/openssl/commit/ca54087462
2023-08-16[ruby/openssl] [DOC] enhance RDoc for exporting pkeysKazuki Yamaguchi
Describe the behavior of OpenSSL::PKey::{DH,DSA,EC,RSA}#to_pem and #to_der more clearly. They return a different result depending on whether the pkey is a public or private key. This was not documented adequately. Also, suggest the use of OpenSSL::PKey::PKey#private_to_pem and #public_to_pem instead, if possible. https://github.com/ruby/openssl/commit/d22769af8f
2023-08-16[ruby/openssl] [DOC] prefer PKey#private_to_pem and #public_to_pem in RDocKazuki Yamaguchi
Suggest the use of OpenSSL::PKey::PKey#private_to_pem and #public_to_pem in the top-level documentation. For new programs, these are recommended over OpenSSL::PKey::RSA#export (also aliased as #to_s and #to_pem) unless there is a specific reason to use it, i.e., unless the PKCS#1 output format specifically is required. The output format of OpenSSL::PKey::RSA#export depends on whether the key is a public key or a private key, which is very counter-intuitive. Additionally, when called with arguments to encrypt a private key, as in this example, OpenSSL's own, non-standard format is used. The man page of PEM_write_bio_PrivateKey_traditional(3) in OpenSSL 1.1.1 or later states that it "should only be used for compatibility with legacy programs". https://github.com/ruby/openssl/commit/56312038d6