aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* openssl: fix the Year 2038 issuetopic/openssl-get-rid-of-time_tKazuki Yamaguchi2016-06-018-25/+62
| | | | | | | The fix in r55219 was wrong. It fixed the issue only when long is 32bit and also time_t is 64bit. But time_t may be 32bit. OpenSSL 1.0.0 introduced ASN1_TIME_adj() and X509_time_adj_ex() which takes offset days. So make use of it.
* openssl: add missing test for r55219rhe2016-05-311-0/+8
| | | | | | | | * test/openssl/test_asn1.rb: Add missing regression test for r55219. It fixed the year 2038 issue but the test code was missing. [ruby-core:45552] [Bug #6571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55229 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: fix char class optionnobu2016-05-313-1/+33
| | | | | | | | | * lib/optparse.rb (OptionParser::Completion.candidate): get rid of nil as key names. [ruby-core:75773] [Bug #12438] * lib/optparse.rb (OptionParser#make_switch): char class option cannot be NoArgument, default to RequiredArgument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: no duplicate stringsnobu2016-05-311-1/+2
| | | | | | | * lib/optparse.rb (OptionParser#parse_in_order): get rid of making duplicate strings; $1 and others make a new string each times. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55227 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Revert r55225naruse2016-05-313-31/+21
| | | | | | | | | | Run test-all before large commit: "* string.c: Activate full Unicode case mapping for UTF-8 by removing" This reverts commit 3fb0fcd1e881c1f6dd74db73a64e8623208acb77. http://rubyci.s3.amazonaws.com/centos5-64/ruby-trunk/log/20160531T013303Z.fail.html.gz git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55226 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: Activate full Unicode case mapping for UTF-8 by removingduerst2016-05-313-21/+31
| | | | | | | | | the protective check for the presence of an option. Update documentation. * test/ruby/enc/test_case_comprehensive.rb: Adjust tests for above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix test failure on Fedora 23rhe2016-05-301-1/+1
| | | | | | | | * test/openssl/test_pair.rb (test_ecdh_curves): Avoid P-224. The FIPS patch from RHEL disables it. The curve has to be chosen from: { secp256k1, secp384r1, secp521r1, prime256v1 }. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-31svn2016-05-301-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/raddrinfo.c (host_str, port_str): Use StringValueCStrusa2016-05-303-2/+17
| | | | | | | instead of (Safe)StringValue, to detect NUL byte in the string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_file_exhaustive.rb: writable opennobu2016-05-301-1/+1
| | | | | | | * test/ruby/test_file_exhaustive.rb (test_flock_shared): open in writable mode for exclusive lock. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* raddrinfo.c: fix modifiernobu2016-05-301-2/+2
| | | | | | | * ext/socket/raddrinfo.c (host_str, port_str): fix length modifier to size_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55220 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: use NUM2TIMET() to convert Integer to time_trhe2016-05-302-6/+7
| | | | | | | | * ext/openssl/ossl_asn1.c (time_to_time_t): Use NUM2TIMET() instead of NUM2LONG(). time_t may be larger than long. [ruby-core:45552] [Bug #6571] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/socket/test_addrinfo.rb (TestSocketAddrinfo#test_addrinfo_ip): previoususa2016-05-301-2/+4
| | | | | | | | test logic depended on platform specific implementation. use more portable logic. this fixes a test failure on Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: Document current behavior for other case mapping methodsduerst2016-05-302-16/+34
| | | | | | | on String. [ci skip] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_addrinfo.rb: signle digit addressnobu2016-05-301-2/+2
| | | | | | | | | * test/socket/test_addrinfo.rb (test_addrinfo_ip): use single digit address so that the values are same in both decimal and octal. some platform zero-prefixed dotted-decimal is parsed as an octal value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * string.c: Document current situation for String#downcase. [ci skip]duerst2016-05-302-4/+41
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: add SSLContext#ecdh_curves=rhe2016-05-307-33/+258
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl_ssl.c (ossl_sslctx_s_alloc): Enable the automatic curve selection for ECDH by calling SSL_CTX_set_ecdh_auto(). With this a TLS server automatically selects a curve which both the client and the server support to use in ECDH. This changes the default behavior but users can still disable ECDH by excluding 'ECDH' cipher suites from the cipher list (with SSLContext#ciphers=). This commit also deprecate #tmp_ecdh_callback=. It was added in Ruby 2.3.0. It wraps SSL_CTX_set_tmp_ecdh_callback() which will be removed in OpenSSL 1.1.0. Its callback receives two values 'is_export' and 'keylength' but both are completely useless for determining a curve to use in ECDH. The automatic curve selection was introduced to replace this. (ossl_sslctx_setup): Deprecate SSLContext#tmp_ecdh_callback=. Emit a warning if this is in use. (ossl_sslctx_set_ecdh_curves): Add SSLContext#ecdh_curves=. Wrap SSL_CTX_set1_curves_list(). If it is not available, this falls back to SSL_CTX_set_tmp_ecdh(). (Init_ossl_ssl): Define SSLContext#ecdh_curves=. * ext/openssl/extconf.rb: Check the existence of EC_curve_nist2nid(), SSL_CTX_set1_curves_list(), SSL_CTX_set_ecdh_auto() and SSL_CTX_set_tmp_ecdh_callback(). * ext/openssl/openssl_missing.[ch]: Implement EC_curve_nist2nid() if missing. * test/openssl/test_pair.rb (test_ecdh_callback): Use EnvUtil.suppress_warning to suppress deprecated warning. (test_ecdh_curves): Test that SSLContext#ecdh_curves= works. * test/openssl/utils.rb (start_server): Use SSLContext#ecdh_curves=. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* raddrinfo.c: fix for SHARABLE_MIDDLE_SUBSTRINGnobu2016-05-303-14/+39
| | | | | | | | | * ext/socket/raddrinfo.c (host_str, port_str): use RSTRING_LEN instead of strlen, since RSTRING_PTR StringValueCStr may not be NUL-terminated when SHARABLE_MIDDLE_SUBSTRING=1. reported by @tmtms, http://twitter.com/tmtms/status/736910516229005312 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: return reallocated pointernobu2016-05-304-1/+36
| | | | | | | * string.c (str_fill_term): return new pointer reallocated by filling terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_addrinfo.rb: special hostnamesnobu2016-05-301-0/+6
| | | | | | | * test/socket/test_addrinfo.rb (test_addrinfo_ip): add tests for special hostnames, <any> and <broadcast>. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55211 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* stringio.c: share stringsnobu2016-05-302-5/+20
| | | | | | | * ext/stringio/stringio.c (enc_subseq): share the return value and the buffer as possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: get rid of unnecessary empty stringnobu2016-05-302-55/+47
| | | | | | | | * string.c (str_substr, rb_str_aref): refactor not to create unnecessary empty string. * string.c (str_byte_substr, str_byte_aref): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: check in the ordernobu2016-05-301-2/+8
| | | | | | | * string.c (rb_str_aref_m, rb_str_byteslice): check arguments in the left-to-right order. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: check lengthnobu2016-05-301-1/+1
| | | | | | | * variable.c (check_autoload_required): check length first before checking the first byte. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ChangeLog: fix a typo for r55198.nagachika2016-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-30svn2016-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55205 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/-test-/auto_ext.rb: fixed a heedless bug introduced at r55198.usa2016-05-292-1/+6
| | | | | | | this change will make RubyCI green. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regexec.c (ONIGENC_IS_MBC_ASCII_WORD): redefine optimized one.naruse2016-05-292-0/+17
| | | | | | WORD of Ruby's ascii compatible encoding is always [a-zA-Z0-9_]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * regexec.c (match_at): make compilers optimize harder.naruse2016-05-292-6/+11
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* vm_core.h: rb_exc_set_backtrace declarationnobu2016-05-293-4/+1
| | | | | | | * vm_core.h (rb_exc_set_backtrace): move declaration from eval_error.c and vm_args.c. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32.c: RUBY_CRITICALnobu2016-05-291-99/+99
| | | | | | | | * win32/win32.c (RUBY_CRITICAL): removed the argument but make just a block which does nothing, so that debuggers can step into the block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55200 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-29svn2016-05-291-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55199 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* auto_ext.rbnobu2016-05-2918-107/+47
| | | | | | | * ext/-test-/auto_ext.rb (auto_ext): utitily method to create extension libraries for tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55198 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ruby-insert-heredoc-code-blocknobu2016-05-282-0/+17
| | | | | | | * misc/ruby-additional.el (ruby-insert-heredoc-code-block): insert here document code block for assert_separately mainly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/test_unicode_normalize.rb: Add test to check for availability ofduerst2016-05-282-6/+21
| | | | | | | | Unicode data file; refactoring; fix an error with tests for destructive method (unicode_normalize!). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55196 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_file_exhaustive.rb: blocking flocknobu2016-05-281-7/+51
| | | | | | | * test/ruby/test_file_exhaustive.rb (test_flock): add assertions for the blocking cases. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * remove trailing spaces.svn2016-05-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55194 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/enc/test_case_comprehensive.rb: Add error messages to testsduerst2016-05-282-5/+17
| | | | | | | for data file availability; refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ChangeLog: fix typos [ci skip]nobu2016-05-281-3/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: move SSLSocket#initialize to C extensionrhe2016-05-285-125/+202
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/lib/openssl/ssl.rb (SSLSocket): Move the implementation of SSLSocket#initialize to C. Initialize the SSL (OpenSSL object) in it. Currently this is delayed until ossl_ssl_setup(), which is called from SSLSocket#accept or #connect. Say we call SSLSocket#hostname= with an illegal value. We expect an exception to be raised in #hostname= but actually we get it in the later SSLSocket#connect. Because the SSL is not ready at #hostname=, the actual call of SSL_set_tlsext_host_name() is also delayed. This also fixes: [ruby-dev:49376] [Bug #11724] * ext/openssl/ossl_ssl.c (ossl_ssl_initialize): Added. Almost the same as the Ruby version but this instantiate the SSL object at the same time. (ossl_ssl_setup): Adjust to the changes. Just set the underlying IO to the SSL. (ssl_started): Added. Make use of SSL_get_fd(). This returns -1 if not yet set by SSL_set_fd(). (ossl_ssl_data_get_struct): Removed. Now GetSSL() checks that the SSL exists. (ossl_ssl_set_session): Don't call ossl_ssl_setup() here as now the SSL is already instantiated in #initialize. (ossl_ssl_shutdown, ossl_start_ssl, ossl_ssl_read_internal, ossl_ssl_write_internal, ossl_ssl_stop, ossl_ssl_get_cert, ossl_ssl_get_peer_cert, ossl_ssl_get_peer_cert_chain, ossl_ssl_get_version, ossl_ssl_get_cipher, ossl_ssl_get_state, ossl_ssl_pending, ossl_ssl_session_reused, ossl_ssl_get_verify_result, ossl_ssl_get_client_ca_list, ossl_ssl_npn_protocol, ossl_ssl_alpn_protocol, ossl_ssl_tmp_key): Use GetSSL() instead of ossl_ssl_data_get_struct(). Use ssl_started(). (Init_ossl_ssl): Add method declarations of SSLSocket#{initialize, hostname=}. * ext/openssl/ossl_ssl.h (GetSSL): Check that the SSL is not NULL. It should not be NULL because we now set it in #initialize. * ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize): No need to check if the SSL is NULL. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55191 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * gems/bundled_gems: Update latest releases, power_assert-0.3.0,hsbt2016-05-282-4/+9
| | | | | | test-unit 3.1.9, minitest 5.9.0, did_you_mean 1.0.1 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55190 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * addr2line.c: drop to support ATARI ST platform. It was discontinuedhsbt2016-05-284-41/+14
| | | | | | | | more than two decades ago. [fix GH-1350] Patch by @cremno * include/ruby/ruby.h: ditto. * io.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/enc/test_case_comprehensive.rb: Converted exception forduerst2016-05-281-0/+5
| | | | | | | unavailable Unicode data files to failed assertion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55187 ↵duerst2016-05-281-0/+8
| | | | b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-28svn2016-05-281-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/cgi/util.rb: added to missing quote.hsbt2016-05-282-1/+6
| | | | | | [fix GH-1363][ci skip] Patch by @dwaller git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo [ci skip]kazu2016-05-271-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55184 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* process.c: [DOC] Process.abort [ci skip]nobu2016-05-271-1/+1
| | | | | | | * process.c (rb_f_abort): [DOC] Process.abort is a singleton method of Process, but not an instance method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55183 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* variable.c: hidden constantsnobu2016-05-273-1/+10
| | | | | | | * variable.c (rb_local_constants_i): exclude hidden constants. [ruby-core:75575] [Bug #12389] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* transcode.c: scrub in the given encodingnobu2016-05-275-3/+17
| | | | | | | | * transcode.c (str_transcode0): scrub in the given encoding when the source encoding is given, not in the encoding of the receiver. [ruby-core:75732] [Bug #12431] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55181 b2dd03c8-39d4-4d8f-98ff-823fe69b080e