summaryrefslogtreecommitdiff
path: root/ext
AgeCommit message (Collapse)Author
2024-06-08[ruby/openssl] Fix references to the license textKazuki Yamaguchi
Update the references to the file "LICENCE" with "COPYING". The file LICENCE doesn't exist in ruby/ruby nor ruby/openssl. This has been always the case since OpenSSL for Ruby 2 was merged to the ruby tree as a standard library in 2003. In OpenSSL for Ruby 2's CVS repository[1], the LICENCE file contained an old version of the Ruby License, identical to the COPYING file that was in Ruby's tree at that time (r4128[2]). [1] http://cvs.savannah.gnu.org/viewvc/rubypki/ossl2/LICENCE?revision=1.1.1.1&view=markup [2] https://github.com/ruby/ruby/blob/231247c010acba191b78ed2d1310c935e63ad919/COPYING https://github.com/ruby/openssl/commit/5bccf07d04
2024-06-08[ruby/openssl] Rename LICENSE.txt to COPYINGKazuki Yamaguchi
This is for consistency with ruby/ruby. https://github.com/ruby/openssl/commit/00ad542791
2024-06-08[ruby/openssl] openssl.gemspec: add BSD-2-Clause to the list of licensesKazuki Yamaguchi
ruby/openssl is licensed under the terms of either the Ruby License or the 2-Clause BSD License. The git repository and built .gem files always contained the license text for both license, but the metadata in the gemspec only specified the Ruby License. Let's include both. https://github.com/ruby/openssl/commit/c71714d738
2024-06-08[ruby/openssl] Add X509::Certificate#tbs_bytesSamuel Giddins
Ref https://github.com/ruby/openssl/issues/519 This makes verifying embedded certificate transparency signatures significantly easier, as otherwise the alternative was manipulating the ASN1 sequence, as in https://github.com/segiddins/sigstore-cosign-verify/pull/2/commits/656d992fa816613fd9936f53ce30972c2f2f4957 https://github.com/ruby/openssl/commit/99128bea5d
2024-06-08ripper: Introduce `RIPPER_ID` macro instead of `ripper_id_` macrosNobuyoshi Nakada
2024-06-08[ruby/digest] [DOC] Update document to use `rb_digest_make_metadata`Nobuyoshi Nakada
https://github.com/ruby/digest/commit/c5c1debd43
2024-06-08[ruby/digest] Use typed data in digestNobuyoshi Nakada
https://github.com/ruby/digest/commit/9a22f921c9
2024-06-07[Feature #19998] Untyped Data API has been marked as deprecatedNobuyoshi Nakada
2024-06-05[ruby/openssl] Fix test_create_with_mac_iter accidently setting keytype not ↵KJ Tsanaktsidis
maciter This test was accidentally passing the value 2048 into the keytype parameter of PKCS12_create, not the mac_iter parameter (because it had one too many `nil`s in the call). This value is invalid, and will make OpenSSL perform an out-of-bounds read which is caught when compiling with ASAN. This commit fixes the tests, and also adds some validation to PKCS12.create to make sure any keytype passed is actually valid. Since there only two valid keytype constants, and the whole feature is an export-grade crypto era thing only ever supported by old MSIE, it seems far more likely that code in the whild is using keytype similarly by mistake rather than as intended. So this validation might catch that. https://github.com/ruby/openssl/commit/47028686d2
2024-06-04Remove dependency on fiddle from test/rubyHiroshi SHIBATA
Co-authored-by: "Nobuyoshi Nakada" <nobu@ruby-lang.org>
2024-06-04[ruby/win32ole] Added missing extensionsHiroshi SHIBATA
https://github.com/ruby/win32ole/commit/8456e8830e
2024-06-04[flori/json] Use the pure-Ruby generator on TruffleRuby as it is much fasterBenoit Daloze
* Using the benchmark from https://github.com/flori/json/pull/580 $ ruby benchmarks/bench.rb dump pure JSON::Pure::Generator truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux] Warming up -------------------------------------- JSON.dump(obj) 116.000 i/100ms JSON.dump(obj) 235.000 i/100ms JSON.dump(obj) 317.000 i/100ms JSON.dump(obj) 372.000 i/100ms JSON.dump(obj) 374.000 i/100ms Calculating ------------------------------------- JSON.dump(obj) 3.735k (± 0.9%) i/s (267.76 μs/i) - 18.700k in 5.007526s JSON.dump(obj) 3.738k (± 0.7%) i/s (267.49 μs/i) - 18.700k in 5.002252s JSON.dump(obj) 3.743k (± 0.7%) i/s (267.18 μs/i) - 19.074k in 5.096375s JSON.dump(obj) 3.747k (± 0.5%) i/s (266.87 μs/i) - 19.074k in 5.090463s JSON.dump(obj) 3.746k (± 0.5%) i/s (266.96 μs/i) - 19.074k in 5.092069s $ ruby benchmarks/bench.rb dump ext JSON::Ext::Generator truffleruby 24.0.0, like ruby 3.2.2, Oracle GraalVM Native [x86_64-linux] Warming up -------------------------------------- JSON.dump(obj) 19.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 18.000 i/100ms JSON.dump(obj) 21.000 i/100ms Calculating ------------------------------------- JSON.dump(obj) 221.260 (±10.8%) i/s (4.52 ms/i) - 1.092k in 5.004381s JSON.dump(obj) 221.983 (± 8.1%) i/s (4.50 ms/i) - 1.113k in 5.055574s JSON.dump(obj) 221.446 (± 8.6%) i/s (4.52 ms/i) - 1.113k in 5.073167s JSON.dump(obj) 226.452 (± 7.9%) i/s (4.42 ms/i) - 1.134k in 5.048568s JSON.dump(obj) 227.795 (± 8.3%) i/s (4.39 ms/i) - 1.134k in 5.025187s https://github.com/flori/json/commit/8256455cdc
2024-06-04Sync strscan HEAD again.Hiroshi SHIBATA
https://github.com/ruby/strscan/pull/99 split document with multi-byte chars.
2024-06-04[flori/json] Cleanup useless ifdefJean Boussier
The json gem now requires Ruby 2.3, so there is no point keeping compatibility code for older releases that don't have the TypedData API. https://github.com/flori/json/commit/45c86e153f
2024-06-03[ruby/date] [DOC] specify the unit of return value for Date#-p0pemaru
https://github.com/ruby/date/commit/b3a2c7611e
2024-06-03[ruby/date] Prevent converted gregorian date from GCNobuyoshi Nakada
`m_sf_in_sec` calls `rb_rational_new` that can cause GC. https://github.com/ruby/date/commit/6de449ab6a
2024-06-03Raise EAI_SYSTEM when pthread_create fails in getaddrinfoYusuke Endoh
Previously, EAI_AGAIN was raised. In our CI, "Temporary failure in name resolution" (EAI_AGAIN) is often raised. We are not sure if this was caused by pthread_create failure or getaddrinfo failure. To make it possible to distinguish between them, this changeset raises EAI_SYSTEM instead of EAI_AGAIN on pthread_create failure.
2024-06-02Stop exposing `rb_str_chilled_p`Jean Boussier
[Feature #20205] Now that chilled strings no longer appear as frozen, there is no need to offer an API to check for chilled strings. We however need to change `rb_check_frozen_internal` to no longer be a macro, as it needs to check for chilled strings.
2024-06-01Suppress -Wmaybe-uninitialized warnings with LTONobuyoshi Nakada
2024-05-30[ruby/stringio] Remove special handling of chilled stringsJean Boussier
[Feature #20205] Followup: https://github.com/ruby/stringio/pull/94 They no longer need to be special cases. If StringIO end up mutating a chilled string, a warning will be emitted. https://github.com/ruby/stringio/commit/dc62d65449
2024-05-30Revert "[ruby/strscan] Doc for StringScanner"Hiroshi SHIBATA
This reverts commit 974ed1408c516d1e8f992f0b304e2de6f8bd5c1f.
2024-05-30Revert "Fix reference path for strscan documentation"Hiroshi SHIBATA
This reverts commit 1fa93fb9488a32018101689fd727965fd5874eb5.
2024-05-30Fix reference path for strscan documentationHiroshi SHIBATA
2024-05-30[ruby/strscan] Doc for StringScannerBurdette Lamar
(https://github.com/ruby/strscan/pull/96) #peek_byte and #scan_byte not updated (not available in my repo -- sorry). --------- https://github.com/ruby/strscan/commit/0123da7352 Co-authored-by: Sutou Kouhei <kou@cozmixng.org>
2024-05-29[ruby/zlib] Update license files with ruby/rubyHiroshi SHIBATA
https://github.com/ruby/zlib/commit/8341fa2e20
2024-05-28Test for compiling without warnings against public headersMike Dalessio
Under compilers with WERRORFLAG, MakeMakefile.try_compile treats warnings as errors, so we can use append_cflags to test whether the public header files emit warnings with certain flags turned on. [Regression test for feature #20507]
2024-05-21ripper: Extend to represent array access and splatNobuyoshi Nakada
2024-05-21ripper: Allow parenthesized comma in optionsNobuyoshi Nakada
2024-05-21ripper: Preserve indentationNobuyoshi Nakada
2024-05-21ripper: Remove rb_ripper_noneNobuyoshi Nakada
Now it is used only for wheter `opt_paren_args` is `none`. Introduce a new special node to distinguish an empty parentheses from it .
2024-05-21ripper: Short hand for `rb_ary_new_from_args`Nobuyoshi Nakada
2024-05-21ripper: Make `$:n` to refer each grammar valuesNobuyoshi Nakada
Ripper DSL uses these values for callbacks, but does not need indexes.
2024-05-14[ruby/zlib] Avoid double copying into provided outbufSamuel Giddins
https://github.com/ruby/zlib/commit/07f44b7546
2024-05-14[ruby/zlib] Avoid allocating intermediary strings when read/readpartial are ↵Samuel Giddins
passed an outbuf This accounts for a significant number of string allocations when reading rubygems, but we can avoid that in many places by only copying into the outbuf when present https://github.com/ruby/zlib/commit/d25ef406c1
2024-05-08[ruby/openssl] Add to_text for PKCS7 and Timestamp::ResponseSamuel Giddins
https://github.com/ruby/openssl/commit/71cd1e3f5c
2024-05-05[ruby/openssl] read: don't clear buffer when nothing can be readJean Boussier
To be consistent with regular Ruby IOs: ```ruby r, _ = IO.pipe buf = "garbage".b r.read_nonblock(10, buf, exception: false) # => :wait_readable p buf # => "garbage" ``` Ref: https://github.com/redis-rb/redis-client/commit/98b8944460a11f8508217bda71cfc10cb2190d4d https://github.com/ruby/openssl/commit/08452993d6
2024-05-04Change return value of `gets` function to be `rb_parser_string_t *` instead ↵yui-knk
of `VALUE` This change reduces parser's dependency on ruby object.
2024-05-03win32/registry: Shorten with safe navigation operatorNobuyoshi Nakada
2024-05-03win32/registry: Make frozen_string_literal trueNobuyoshi Nakada
2024-05-03win32/registry: Refine pack/unpackNobuyoshi Nakada
* Use 'J' for HANDLE. * Use 'Q' for QWORD. * Define template constants. * Supply zero bytes in `unpackqw` as well as `unpackdw`. * Use `String#unpack1`.
2024-05-02[ruby/openssl] pkcs7: raise PKCS7Error for PKCS7 without content in ↵Jeremy Evans
PKCS7.read_smime [pkuzco: expanded the fix for other content types] [ky: adjusted formatting and the exception type] https://github.com/ruby/openssl/commit/07eceb7f63 Co-authored-by: pkuzco <b.naamneh@gmail.com> Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02[ruby/openssl] pkcs7: raise ArgumentError for PKCS7 with no content in PKCS7.newJeremy Evans
Fixes [Bug #19974] [pkuzco: expanded the fix for other content types] [ky: adjusted formatting and the exception type] https://github.com/ruby/openssl/commit/27e11f2d1d Co-authored-by: pkuzco <b.naamneh@gmail.com> Co-authored-by: Kazuki Yamaguchi <k@rhe.jp>
2024-05-02[ruby/openssl] cipher: fix buffer overflow in Cipher#updateKazuki Yamaguchi
OpenSSL::Cipher#update currently allocates the output buffer with size (input data length)+(the block size of the cipher). This is insufficient for the id-aes{128,192,256}-wrap-pad (AES keywrap with padding) ciphers. They have a block size of 8 bytes, but the output may be up to 15 bytes larger than the input. Use (input data length)+EVP_MAX_BLOCK_LENGTH (== 32) as the output buffer size, instead. OpenSSL doesn't provide a generic way to tell the maximum required buffer size for ciphers, but this is large enough for all algorithms implemented in current versions of OpenSSL. Fixes: https://bugs.ruby-lang.org/issues/20236 https://github.com/ruby/openssl/commit/3035559f54
2024-05-02[ruby/openssl] Fix performance regression in do_write(s)Jaymz Julian
This causes significant performance issues when using large (>10meg) writes Fix by adjusting the buffer write function to clear the buffer once, rather than piece by piece, avoiding a case where a large write (in our case, around 70mbytes) will consume 100% of CPU. This takes a webrick GET request via SSL from around 200kbyts/sec and consuming 100% of a core, to line speed on gigabit ethernet and 6% cpu utlization. https://github.com/ruby/openssl/commit/d4389b425d
2024-05-02[ruby/openssl] asn1: check error return from i2d_ASN1_TYPE()Kazuki Yamaguchi
i2d_ASN1_TYPE() is not expected to fail, but the return value should be checked. https://github.com/ruby/openssl/commit/21ed3c310e
2024-04-30[ruby/openssl] Update Cipher#name to match Digest#name explanationBart de Water
https://github.com/ruby/openssl/commit/79e6dead6e
2024-04-30[ruby/openssl] Add OpenSSL::Digest.digests to get a list of available digestsBart de Water
https://github.com/ruby/openssl/commit/08dd3c73b7
2024-04-30[ruby/openssl] Further clarification of documentation.Samuel Williams
https://github.com/ruby/openssl/commit/0697f2f8b4
2024-04-30[ruby/openssl] More documentation.Samuel Williams
https://github.com/ruby/openssl/commit/c8377eaf8d
2024-04-30[ruby/openssl] Introduce basic support for `close_read` and `close_write`.Samuel Williams
https://github.com/ruby/openssl/commit/c99d24cee9