summaryrefslogtreecommitdiff
path: root/test
AgeCommit message (Collapse)Author
2021-07-18[ruby/openssl] pkey: implement PKey#sign_raw, #verify_raw, and #verify_recoverKazuki Yamaguchi
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[ruby/openssl] pkey: implement PKey#encrypt and #decryptKazuki Yamaguchi
Support public key encryption and decryption operations using the EVP API. https://github.com/ruby/openssl/commit/75326d4bbc
2021-07-18[ruby/openssl] Implement `Certificate.load` to load certificate chain. ↵Samuel Williams
(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[ruby/openssl] x509, ssl, pkcs7: try to parse as DER-encoding firstKazuki Yamaguchi
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[ruby/openssl] Add SSLSocket#getbyteAaron Patterson
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[ruby/openssl] pkey/dh, pkey/ec: use EVP_PKEY_check() familyKazuki Yamaguchi
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[ruby/openssl] pkey: implement {DH,DSA,RSA}#public_key in RubyKazuki Yamaguchi
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[ruby/openssl] pkey: implement #to_text using EVP APIKazuki Yamaguchi
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[ruby/openssl] pkey/dsa: use high level EVP interface to generate parameters ↵Kazuki Yamaguchi
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[ruby/openssl] pkey/dh: use high level EVP interface to generate parameters ↵Kazuki Yamaguchi
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[ruby/openssl] pkey: allow setting algorithm-specific options in #sign and ↵Kazuki Yamaguchi
#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[ruby/openssl] require OpenSSL >= 1.0.2 and LibreSSL >= 3.1Kazuki Yamaguchi
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[ruby/openssl] BN.abs and BN uplusRick Mark
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-17One-line pattern matching is no longer experimentalKazuki Tsujimoto
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210715Japan.md#feature-17724-make-the-pin-operator-support-instanceclassglobal-variables-jeremyevans0
2021-07-16Add Integer.try_convert [Feature #15211]Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4654
2021-07-16[rubygems/rubygems] Fix contradictory message about deletion of default gemJared Beck
[Fixes #4733] https://github.com/rubygems/rubygems/commit/fce7f3eb7d
2021-07-16[ruby/error_highlight] Fix leaked tempfilesNobuyoshi Nakada
https://github.com/ruby/error_highlight/commit/8b353a10a7
2021-07-15Copy hash compare_by_identity setting in more casesJeremy Evans
This makes the compare_by_identity setting always copied for the following methods: * except * merge * reject * select * slice * transform_values Some of these methods did not copy the setting, or only copied the setting if the receiver was not empty. Fixes [Bug #17757] Co-authored-by: Kenichi Kamiya <kachick1@gmail.com> Notes: Merged: https://github.com/ruby/ruby/pull/4616 Merged-By: jeremyevans <code@jeremyevans.net>
2021-07-15Add pattern matching pin support for instance/class/global variablesJeremy Evans
Pin matching for local variables and constants is already supported, and it is fairly simple to add support for these variable types. Note that pin matching for method calls is still not supported without wrapping in parentheses (pin expressions). I think that's for the best as method calls are far more complex (arguments/blocks). Implements [Feature #17724] Notes: Merged: https://github.com/ruby/ruby/pull/4502
2021-07-16[ruby/irb] Show code page by irb_info on Windowsaycabta
https://github.com/ruby/irb/commit/6160d74199
2021-07-16[ruby/irb] Escape space in free-spacing modeaycabta
https://github.com/ruby/irb/commit/085ac42947
2021-07-15Make Struct#keyword_init? return nil by default [Feature #18008]Nobuyoshi Nakada
2021-07-15Add tests and NEWS [Feature #18008]NARUSE, Yui
2021-07-15[ruby/fiddle] Handle#file_name results in very platform dependentNobuyoshi Nakada
2021-07-15[ruby/fiddle] Module file name may be the realpathNobuyoshi Nakada
Even when the path which was used to dlopen may be a symlink.
2021-07-14[ruby/fiddle] fixed the test on case-insensitive filesystemNobuyoshi Nakada
2021-07-14[ruby/fiddle] Add Fiddle::Handle#file_name ↵Kenta Murata
(https://github.com/ruby/fiddle/pull/88) https://github.com/ruby/fiddle/commit/4ee1c6fc4b
2021-07-14[ruby/fiddle] Return the module handle value in Fiddle::Handle#to_i and add ↵Kenta Murata
FIddle::Handle#to_ptr (https://github.com/ruby/fiddle/pull/87) https://github.com/ruby/fiddle/commit/170111a0cb
2021-07-14Merge RubyGems/Bundler master from 8459ebd6ad65ce3397233416dc64083ae7572bb9Hiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4648
2021-07-13[ruby/error_highlight] Set the binary mode for Tempfile creation in a testYusuke Endoh
https://github.com/ruby/error_highlight/commit/8273d3b6f2
2021-07-13[ruby/fiddle] Add "offsetof" to Struct classes ↵Aaron Patterson
(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[ruby/fiddle] Add MemoryView.export and MemoryView#release ↵Sutou Kouhei
(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[ruby/fiddle] Add Fiddle::MemoryView#to_s ↵Sutou Kouhei
(https://github.com/ruby/fiddle/pull/78) Fix https://github.com/ruby/fiddle/pull/74 Reported by dsisnero. Thanks!!!
2021-07-13[ruby/fiddle] test: fix SetLastError's input typeSutou Kouhei
https://github.com/ruby/fiddle/commit/ca5e6a0404
2021-07-13[ruby/fiddle] test: use double quote for string literalSutou Kouhei
https://github.com/ruby/fiddle/commit/fab7eab95b
2021-07-13[ruby/fiddle] test: add a test for win32_last_socket_errorSutou Kouhei
https://github.com/ruby/fiddle/commit/c86cec03cd
2021-07-13[ruby/fiddle] test: add missing receiverSutou Kouhei
https://github.com/ruby/fiddle/commit/1da3b4af16
2021-07-13[ruby/fiddle] windows: use GetLastError() for win32_last_errorSutou Kouhei
Ruby: [Bug #11579] Patch by cremno phobia. Thanks!!! https://github.com/ruby/fiddle/commit/760a8f9b14
2021-07-13[ruby/error_highlight] Support a file that has no final newlineYusuke Endoh
https://github.com/ruby/error_highlight/commit/9d671284cb
2021-07-13[ruby/error_highlight] Support hard tabsYusuke Endoh
Now, the highlight line is created by replacing non-tab characters with spaces, and keeping all hard tabs as-is. This means the highlight line has the completely same indentation as the code snippet line. Fixes #7 https://github.com/ruby/error_highlight/commit/38f20fa542
2021-07-12[ruby/error_highlight] Update a test for multibyte charactersYusuke Endoh
https://github.com/ruby/error_highlight/commit/2fc70d7f8e
2021-07-11[ruby/date] Fix comparison with Float::INFINITYJeremy Evans
Fixes [Bug #17945] https://github.com/ruby/date/commit/953d907238
2021-07-11[ruby/irb] Show LANG and LC_ALL env by irb_infoaycabta
Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> https://github.com/ruby/irb/commit/b431742430
2021-07-10Remove half-defined Reline on LoadErrorNobuyoshi Nakada
When fiddle is not avaiable, reline/terminfo depending on it also fails.
2021-07-10Skip fiddle tests if fiddle is not avaiableNobuyoshi Nakada
2021-07-08mkmf.rb: try linking at try_varNobuyoshi Nakada
To check for variables accessible but not declared.
2021-07-08Split test of Hash.[] and add assertion for default value/procNobuyoshi Nakada
For a73f13c9070a5189947641638398cbffb8d012d8.
2021-07-08Adapt test_emoji_breaks.rb to Unicode 13.0.0/Emoji 13.0Martin Dürst
- Add UNICODE_VERSION,... to deal with new location of some of the emoji-related data files. - Introduce class BreakFile to handle various file properties. - Adapt main code to use BreakFile.
2021-07-07Sync RubyGems and Bundler with upstreamHiroshi SHIBATA
Notes: Merged: https://github.com/ruby/ruby/pull/4634
2021-07-07Sync latest bundler & rubygems development versionDavid Rodríguez
Notes: Merged: https://github.com/ruby/ruby/pull/4533