aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* wiptopic/openssl-ccmKazuki Yamaguchi2016-05-211-36/+53
|
* openssl: fix possible SEGV on race between SSLSocket#stop and #connectrhe2016-05-214-11/+46
| | | | | | | | | | | | | | | | | | * ext/openssl/ossl_ssl.c (ossl_ssl_stop): Don't free the SSL struct here. Since some methods such as SSLSocket#connect releases GVL, there is a chance of use after free if we free the SSL from another thread. SSLSocket#stop was documented as "prepares it for another connection" so this is a slightly incompatible change. However when this sentence was added (r30090, Add toplevel documentation for OpenSSL, 2010-12-06), it didn't actually. The current behavior is from r40304 (Correct shutdown behavior w.r.t GC., 2013-04-15). [ruby-core:74978] [Bug #12292] * ext/openssl/lib/openssl/ssl.rb (sysclose): Update doc. * test/openssl/test_ssl.rb: Test this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55100 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix SSL client example in documentation [ci skip]rhe2016-05-212-4/+10
| | | | | | | | * ext/openssl/ossl.c: [DOC] Fix SSL client example. The variable name was wrong. Patch by Andreas Tiefenthaler <at@an-ti.eu> (@pxlpnk). [GH ruby/openssl#32] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: add OpenSSL::PKey::EC#private? and #public?rhe2016-05-213-13/+38
| | | | | | | | | | | * ext/openssl/ossl_pkey_ec.c: rename PKey::EC#private_key? and #public_key? to #private? and #public? for consistency with other PKey types. Old names remain as alias. [ruby-core:45541] [Bug #6567] * test/openssl/test_pkey_ec.rb (test_check_key): check private? and public? works correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55098 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: remove impossible EOFError raise in OpenSSL::Bufferingrhe2016-05-212-2/+6
| | | | | | | | * ext/openssl/lib/openssl/buffering.rb (read_nonblock, readpartial): Remove impossible EOFError raise. Patch by Zach Anker <zanker@squareup.com>. [GH ruby/openssl#23] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ipaddr: fix typo [ci skip]nobu2016-05-212-1/+6
| | | | | | | * lib/ipaddr.rb: [DOC] fix documentation of IN6MASK to mention IPv6. [Fix GH-1349] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Restore documentation of ARGFnobu2016-05-212-1/+6
| | | | | | | * io.c (Init_IO): [DOC] define dummy ARGF instead of ARGF.class to re-enable the generation of ARGF documentation. [Fix GH-1358] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* methods.rdoc: closing tagnobu2016-05-212-1/+6
| | | | | | | * doc/syntax/methods.rdoc (Method Names): add proper closing tag. [Fix GH-1356] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* configure.in: missing macro definitionnobu2016-05-212-1/+8
| | | | | | | * configure.in (RUBY_CHECK_SETJMP): fix missing macro definition for the configured result. fix up r55021. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix build on no-fork-spawnv platformsnobu2016-05-203-14/+36
| | | | | | | | * process.c (rb_execarg_commandline): build command line string from argument vector in rb_execarg. [ruby-core:75611] [Bug #12398] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55091 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* io.c: conditionally used functionsnobu2016-05-201-0/+4
| | | | | | | | | * io.c (pipe_atexit): only used on Windows * io.c (rb_execarg_fixup_v): wrapper only used fork or spawnv is available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ossl.c: suppress warningsnobu2016-05-201-1/+1
| | | | | | | * ext/openssl/ossl.c (ossl_pem_passwd_cb): check integer precision. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55089 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-21svn2016-05-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: improve handling of password for encrypted PEMrhe2016-05-2010-70/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl.c (ossl_pem_passwd_value): Added. Convert the argument to String with StringValue() and validate the length is in 4..PEM_BUFSIZE. PEM_BUFSIZE is a macro defined in OpenSSL headers. (ossl_pem_passwd_cb): When reading/writing encrypted PEM format, we used to pass the password to PEM_def_callback() directly but it was problematic. It is not NUL character safe. And surprisingly, it silently truncates the password to 1024 bytes. [GH ruby/openssl#51] * ext/openssl/ossl.h: Add function prototype declaration of newly added ossl_pem_passwd_value(). * ext/openssl/ossl_pkey.c (ossl_pkey_new_from_data): Use ossl_pem_passwd_value() to validate the password String. * ext/openssl/ossl_pkey_dsa.c (ossl_dsa_initialize, ossl_dsa_export): ditto. * ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize, ossl_ec_key_to_string): ditto. * ext/openssl/ossl_pkey_rsa.c (ossl_rsa_initialize, ossl_rsa_export): ditto. * test/openssl/test_pkey_{dsa,ec,rsa}.rb: test this. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55087 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* capa should be even number on 64-bit SPARC for 8-byte word alignmentngoto2016-05-202-0/+18
| | | | | | | | | | | | | * id_table.c (list_id_table_init): When unaligned word access is prohibited and sizeof(VALUE) is 8 (64-bit machines), capa should always be even number for 8-byte word alignment of the values of a table. This code assumes that sizeof(ID) is 4, sizeof(VALUE) is 8, and xmalloc() returns 8-byte aligned memory. This fixes bus error on 64-bit SPARC Solaris 10. [Bug #12406][ruby-dev:49631] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* thread_pthread.c: no fork, no gvl_atforknobu2016-05-201-0/+2
| | | | | | | * thread_pthread.c (gvl_atfork): used in rb_thread_atfork_internal only if HAVE_WORKING_FORK is defined. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use HAVE_BUILTIN___BUILTIN_CONSTANT_Pngoto2016-05-202-3/+7
| | | | | | | * symbol.h (rb_id2sym): Use HAVE_BUILTIN___BUILTIN_CONSTANT_P git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typos [ci skip]kazu2016-05-202-3/+8
| | | | | | | * ext/date/date_core.c: [DOC] fix typos. [fix GH-1360] patched by @soundasleep git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55083 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Use RB_GNUC_EXTENSION_BLOCK instead of __extension__ngoto2016-05-206-68/+75
| | | | | | | | | | | | | | | | | | | * include/ruby/defines.h (RB_GNUC_EXTENSION, RB_GNUC_EXTENSION_BLOCK): macros for skipping __extension__ on non-GCC compilers. * eval_error.c (warn_print): use RB_GNUC_EXTENSION_BLOCK instead of __extension__ because __extension__ is a GNU extension. Fix compile error on Solaris 10 with Oracle Solaris Studio 12.x. [Bug #12397] [ruby-dev:49629]. * internal.h (rb_fstring_cstr, rb_fstring_enc_cstr): ditto * include/ruby/encoding.h (rb_enc_str_new, rb_enc_str_new_cstr): ditto * include/ruby/intern.h (rb_str_new, rb_str_new_cstr, rb_usascii_str_new, rb_utf8_str_new, rb_tainted_str_new_cstr, rb_usascii_str_new_cstr, rb_utf8_str_new_cstr, rb_external_str_new_cstr, rb_locale_str_new_cstr, rb_str_buf_new_cstr, rb_str_cat_cstr, rb_exc_new_cstr): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55082 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole.c: share the contentnobu2016-05-202-2/+7
| | | | | | | * ext/win32ole/win32ole.c (fole_missing): make substring or dup to share the content if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55081 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* win32ole.c: remove dead codenobu2016-05-201-5/+0
| | | | | | | * ext/win32ole/win32ole.c (fole_missing): remove dead code meaningless since r51913. RSTRING_LEN does not exceed LONG_MAX. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* exclude non-VALUE in memo from GCnobu2016-05-203-4/+22
| | | | | | | | | | | * internal.h (NEW_PARTIAL_MEMO_FOR): shrink buffer array not to mark non-VALUE fields. fix check_rvalue_consistency abort with RGENGC_CHECK_MODE=2. * internal.h (NEW_CMP_OPT_MEMO): exclude struct cmp_opt_data from the valid array range. * enum.c (slicewhen_i): exclude inverted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55079 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: don't test default session lifetime valuerhe2016-05-201-1/+0
| | | | | | | | | | | | | | | | | | | | | | | OpenSSL's default session timeout for TLS v1.0 method is not 300 seconds but 7200. The TLS v1.0 specification[1] mentions about it as just "An upper limit of 24 hours is suggested for session ID lifetimes,". And according to OpenSSL 1.0.2h source comment[2], the value 7200 is decided just because "the 24 hours mentioned in the TLSv1 spec is way too long for http, the cache would over fill". The reason why the default lifetime is set to 300 is maybe an OpenSSL bug. We always call SSL_CTX_new() with SSLv23_method(), and this set ssl_ctx->session to 300, the default value for SSLv23_method(). But the following SSL_set_ssl_method() call does not update it. By the way this will be fixed in OpenSSL 1.1.0. [1] https://tools.ietf.org/html/rfc2246#appendix-F.1.4 [2] https://git.openssl.org/?p=openssl.git;a=blob;f=ssl/t1_lib.c;h=dd5bd0050d89f5585c1b06a227eb8221ebf984f1;hb=5dd94f1847c744929a3bd24819f1c99644bb18c7#l193 * test/openssl/test_ssl_session.rb (test_session): remove assertion of the default session timeout. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55078 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-20svn2016-05-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typosorah2016-05-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix document of Regexp#match?kazu2016-05-193-1/+11
| | | | | | | | | * re.c (rb_reg_match_m_p): [DOC] fix return value in rdoc. * test/ruby/test_regexp.rb (TestRegexp#test_match_p): add some tests from document. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: register ex_data index for X509_STORE{_CTX,} respectivelyrhe2016-05-197-26/+42
| | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl.c (Init_openssl): register an ex_data index for X509_STORE and X509_STORE_CTX respectively. Since they don't share the ex_data index registry, we can't use the same index. (ossl_verify_cb): use the the correct index. * ext/openssl/ossl_ssl.c (ossl_ssl_verify_callback): ditto. * ext/openssl/ossl_x509store.c (ossl_x509store_set_vfy_cb): ditto. (ossl_x509stctx_verify): ditto. * ext/openssl/ossl.h (void ossl_clear_error): add extern declarations of ossl_store_{ctx_,}ex_verify_cb_idx. * ext/openssl/openssl_missing.c: remove X509_STORE_set_ex_data and X509_STORE_get_ex_data. * ext/openssl/openssl_missing.h: implement X509_STORE_get_ex_data, X509_STORE_set_ex_data and X509_STORE_get_ex_new_index as macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * test/ruby/test_array.rb (TestArray#test_push_over_ary_max): it seems to takeusa2016-05-191-1/+1
| | | | | | | long time on mswinci. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55073 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * properties.svn2016-05-190-0/+0
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: check argument type in OpenSSL::X509::Attribute#value=rhe2016-05-193-0/+65
| | | | | | | | | | * ext/openssl/ossl_x509attr.c (ossl_x509attr_set_value): check that the argument is an OpenSSL::ASN1::Data before converting to ASN1_TYPE. This fixes SEGV on OpenSSL::X509::Attribute#value=(non-asn1-value). * test/openssl/test_x509attr.rb: add tests for OpenSSL::X509::Attribute. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55071 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* assertions.rb: leave timeout to invoke_rubynobu2016-05-192-1/+9
| | | | | | | | * test/lib/test/unit/assertions.rb (assert_separately): leave timeout to invoke_ruby, which handles outputs and status of the target process since r51539. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c: fix match?nobu2016-05-193-13/+24
| | | | | | | | | * re.c (rb_reg_match_m_p): fix match against empty string. rb_str_offset returns the end when the position exceeds the length. fix the range parameter of onig_search. [ruby-core:75604] [Bug #12394] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typonobu2016-05-191-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c: match? should return nil if no matchnobu2016-05-193-6/+11
| | | | | | | * re.c (rb_reg_match_m_p): should return nil if no match, as the document says. [Feature #8110] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * 2016-05-19svn2016-05-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (reg_names_iter): specify capacifynaruse2016-05-182-1/+6
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix a typo [ci skip]kazu2016-05-181-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * thread.c (recursive_list_access): a object id may be a Bignum. so,usa2016-05-182-1/+7
| | | | | | | | the list must be a objhash, instead of a identhash. this fixes many test errors on mswin64 CI. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* re.c: fix typenobu2016-05-181-1/+2
| | | | | | | * re.c (rb_reg_match_m_p): fix type of variable for onig_search result. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_match_m_p): Introduce Regexp#match?, which returnsnaruse2016-05-184-0/+98
| | | | | | bool and doesn't save backref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix test failure due to the previous commitrhe2016-05-181-5/+6
| | | | | | | * test/openssl/test_pkey_ec.rb (test_ec_point_mul): My previous commit r55059 was broken. I should have been more careful. Sorry. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix test failure of OpenSSL::TestEC#test_ec_point_mulrhe2016-05-181-22/+27
| | | | | | | * test/openssl/test_pkey_ec.rb (test_ec_point_mul): CentOS 7 patches OpenSSL to reject curves defined over a small field. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* test_random.rb: skip old OpenSSLnobu2016-05-181-1/+1
| | | | | | | * test/openssl/test_random.rb (OpenSSL::TestRandom): ignore out-of-date OpenSSL before 1.0, as well as other tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: fix OpenSSL error queue leak in OpenSSL::PKCS12.newrhe2016-05-182-0/+10
| | | | | | | | * ext/openssl/ossl_pkcs12.c (ossl_pkcs12_initialize): pop errors leaked by PKCS12_parse(). This is a bug in OpenSSL, which exists in the versions before the version 1.0.0t, 1.0.1p, 1.0.2d. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl/test_random.rb: requires utils.rbnobu2016-05-181-4/+1
| | | | | | | * test/openssl/test_random.rb: requires test/openssl/utils.rb for OpenSSL::TestCase now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* downloader.rb: disable verify if rubygems is oldnobu2016-05-182-6/+20
| | | | | | | | * tool/downloader.rb (Downloader::RubyGems.download): verify gems only if RubyGems is 2.4 or later. old RubyGems fails to verify almost all of bundled gems. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55055 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* string.c: integer overflownobu2016-05-183-0/+17
| | | | | | | * string.c (rb_str_modify_expand): check integer overflow. [ruby-core:75592] [Bug #12390] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (match_ary_subseq): get subseq of match array without creatingnaruse2016-05-183-28/+105
| | | | | | | | | | | | | temporary array. * re.c (match_ary_aref): get element(s) of match array without creating temporary array. * re.c (match_aref): Use match_ary_subseq with handling irregulars. * re.c (match_values_at): Use match_ary_aref. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ossl_pkey_ec.c: index typesnobu2016-05-181-1/+1
| | | | | | | * ext/openssl/ossl_pkey_ec.c (ossl_ec_point_mul): fix index types. Array length is long, not int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* openssl: clear OpenSSL error queue before return to Rubyrhe2016-05-1836-108/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * ext/openssl/ossl_x509cert.c (ossl_x509_verify): X509_verify() family may put errors on 0 return (0 means verification failure). Clear OpenSSL error queue before return to Ruby. Since the queue is thread global, remaining errors in the queue can cause an unexpected error in the next OpenSSL operation. [ruby-core:48284] [Bug #7215] * ext/openssl/ossl_x509crl.c (ossl_x509crl_verify): ditto. * ext/openssl/ossl_x509req.c (ossl_x509req_verify): ditto. * ext/openssl/ossl_x509store.c (ossl_x509stctx_verify): ditto. * ext/openssl/ossl_pkey_dh.c (dh_generate): clear the OpenSSL error queue before re-raising exception. * ext/openssl/ossl_pkey_dsa.c (dsa_generate): ditto. * ext/openssl/ossl_pkey_rsa.c (rsa_generate): ditto. * ext/openssl/ossl_ssl.c (ossl_start_ssl): ditto. * test/openssl: check that OpenSSL.errors is empty every time after running a test case. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55051 b2dd03c8-39d4-4d8f-98ff-823fe69b080e