Граф коммитов

550 Коммитов

Автор SHA1 Сообщение Дата
emboss 699b209cf8 * lib/openssl/ssl.rb: Explicitly whitelist the default
SSL/TLS ciphers. Forbid SSLv2 and SSLv3, disable
  compression by default.
  Reported by Jeff Hodges.
  [ruby-core:59829] [Bug #9424]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-06 01:43:53 +00:00
nobu 89e70fe8e7 ossl.c: NULL check
* ext/openssl/ossl.c (ossl_make_error): check NULL for unknown
  error reasons with old OpenSSL, and insert a colon iff formatted
  message is not empty.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-03-05 02:58:59 +00:00
akr ab67419b75 * ext/openssl/ossl_bn.c (ossl_bn_initialize): Use rb_integer_pack.
Fix SEGV by OpenSSL::BN.new(1 << (2**34)).



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44909 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-11 14:06:51 +00:00
tenderlove e25f3587bd * ext/openssl/ossl_ssl.c: pass read_nonblock options to underlying IO
when SSL session has not been started.

* test/openssl/test_ssl.rb: test for change.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44732 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-28 19:31:48 +00:00
hsbt d1ab866d4a * ext/nkf/nkf-utf8/nkf.c: fix typo by @windwiny [fix GH-506]
* ext/openssl/ossl_ssl.c: ditto
* ext/psych/yaml/scanner.c: ditto
* ext/socket/init.c: ditto
* ext/socket/socket.c: ditto
* ext/tk/tcltklib.c: ditto
* ext/win32ole/win32ole.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44649 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-19 05:43:23 +00:00
zzak 3f039c96e2 * ext/openssl/ossl_pkey_dh.c: Fixed typo by Sandor Szücs [Bug #9243]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 05:27:23 +00:00
nobu 23a8568739 openssl/ossl.h: calculate as long
* ext/openssl/ossl.h (ossl_str_adjust): calculate as long, not
  casting to int.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:42 +00:00
nobu 74947c9d1e ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44581 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:41 +00:00
nobu eadaa8ba8b ext: use PRIsVALUE for rb_raise and rb_warn
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): use PRIsVALUE for
  rb_raise() and rb_warn().
* ext/openssl/ossl_cipher.c (ossl_cipher_init): ditto.
* ext/racc/cparse/cparse.c (extract_user_token): ditto.
* ext/syslog/syslog.c (mSyslog_log): ditto.

* ext/openssl/ossl.h (OSSL_Check_Kind, OSSL_Check_Instance): now
  ossl_raise() also accepts PRIsVALUE.
* ext/openssl/ossl_asn1.c (ossl_asn1_default_tag):

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-13 00:57:38 +00:00
nobu 9bd672f668 ext: use rb_sprintf() and rb_vsprintf() with PRIsVALUE
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-01-12 08:11:36 +00:00
nobu 1e7a929c1d ossl_ssl.c: declare OP_MSIE_SSLV2_RSA_PADDING only if defined
* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Declare a constant
  `OP_MSIE_SSLV2_RSA_PADDING` only if the macro is defined.  The
  `SSL_OP_MSIE_SSLV2_RSA_PADDING` has been removed from latest
  snapshot of OpenSSL 1.0.1.  [Fixes GH-488]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-25 01:42:09 +00:00
nobu 3e37a7f745 ossl.c: integer overflow
* ext/openssl/ossl.c (string2hex): fix signed integer overflow.
  [ruby-core:51711] [Bug #7744] [Fixes GH-242]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-24 16:44:49 +00:00
zzak cadd660689 * doc/ChangeLog-1.9.3: [DOC] Fix typos by @dvsuresh
[Fixes GH-485] https://github.com/ruby/ruby/pull/485
* ext/openssl/ossl_config.c: ditto
* lib/rss/utils.rb, lib/time.rb: ditto
* test/ruby/envutil.rb: ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-22 18:21:14 +00:00
a_matsuda 8920ac2972 * doc/contributing.rdoc: [DOC] Fix typo in comments by @dvsuresh [Fixes GH-475]
* ext/openssl/ossl_ssl.c: ditto.
* test/ruby/test_m17n.rb:  ditto.

https://github.com/ruby/ruby/pull/475
[ci-skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-12 07:21:19 +00:00
a_matsuda e1db3605fd * ext/win32ole/sample/olegen.rb: Fix typo
* ext/openssl/ossl_asn1.c:  [DOC] Fix typo
* lib/webrick/accesslog.rb:  ditto
* template/yarvarch.ja:  ditto

s/recieve/receive/

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-11 03:58:07 +00:00
nobu d5526f3fe5 openssl/digest.rb: check by lambda
* ext/openssl/lib/openssl/digest.rb (initialize): check argument
  size by lambda.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44116 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 07:16:03 +00:00
nobu 0ede9926f7 openssl/digest.rb: get rid of deprecated class
* ext/openssl/lib/openssl/digest.rb (digest, hexdigest): create
  new instance and call on it directly, to get rid of deprecated
  class OpenSSL::Digest::Digest.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-10 07:16:01 +00:00
zzak 99e04c1345 * ext/openssl/lib/openssl/digest.rb: Deprecate OpenSSL::Digest::Digest
[Fixes GH-446] https://github.com/ruby/ruby/pull/446


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-09 19:56:45 +00:00
drbrain e45f56d5db * ext/openssl/lib/openssl/buffering.rb: Return ASCII-8BIT strings from
SSLSocket methods.  [ruby-trunk - Bug #9028]
* test/openssl/test_ssl.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-03 01:44:41 +00:00
zzak c4487ee06b * ext/openssl/lib/openssl/buffering.rb: Fix warning in copyright
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-12-01 02:58:50 +00:00
nobu 7566c49068 ruby/ruby.h: RB_BLOCK_CALL_FUNC_ARGLIST
* include/ruby/ruby.h (RB_BLOCK_CALL_FUNC_ARGLIST): for declaration
  argument list of rb_block_call_func.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-29 07:59:14 +00:00
nobu e71bb2c54e openssl/buffering.rb: call super
* ext/openssl/lib/openssl/buffering.rb (OpenSSL::Buffering#initialize):
  initialize of a module should pass arguments to super.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43774 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-22 03:17:16 +00:00
zzak f0dfcefa48 * ext/openssl/lib/openssl/buffering.rb: [DOC] Fix HEREDOC comment for
OpenSSL::Buffering which breaks overview because of RDoc bug


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 06:37:20 +00:00
zzak 1d8d8ff57f * ext/openssl/ossl_engine.c: [DOC] Documentation for OpenSSL::Engine
This patch is based off work by @vbatts in GH-436 completing the
  documentation for this class and its methods.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43742 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 04:37:14 +00:00
zzak 0c873e97da * ext/openssl/lib/openssl/buffering.rb: Remove unused arguments from
OpenSSL::Buffering.new [Fixes GH-445]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-21 01:46:48 +00:00
nagachika 18358ad8cd Squashed commit of the following:
commit 6895f38bfc3c0ad6bd212b8f9acc3c71384dfcb7
Author: Chikanaga Tomoyuki <nagachika00@gmail.com>
Date:   Thu Nov 14 00:14:00 2013 +0900

    * ChangeLog: fix a typo at r43666

    * ext/openssl/ossl_asn1.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43670 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 15:14:59 +00:00
zzak 1dd8260dfa * ext/openssl/ossl_config.c: [DOC] Document the following:
- OpenSSL::ConfigError
  - OpenSSL::Config::DEFAULT_CONFIG_FILE

  Patched by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43667 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 09:34:08 +00:00
zzak 49a9845405 * ext/openssl/ossl_asn1.c: [DOC] Document parts of
OpenSSL::ASN1::ObjectId included a fix for the class overview, which
  previously showed the documentation for Constructive due to missing
  ObjectId overview. This patch also includes a note for Primative.

  Based on a patch by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43666 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 09:06:17 +00:00
zzak 75cef5054b * ext/openssl/lib/openssl/config.rb: In #parse use +string+ for +str+
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43665 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:21:36 +00:00
zzak 33b63fcf93 * ext/openssl/lib/openssl/*.rb: [DOC] Document the following:
- Integer#to_bn
  - OpenSSL::Buffering module
  - Document deprecated OpenSSL::Digest::Digest compatibility class
  - OpenSSL::Config

  These changes were based on a patch by @vbatts via GH-436
  https://github.com/ruby/ruby/pull/436


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43663 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-13 08:15:48 +00:00
nobu 8f675f0b89 openssl: work around of dependency
* ext/openssl/depend (ossl.o): work around of dependency of
  thread_native.h, which depends on headers by THREAD_MODEL.
  [ruby-dev:47777]
* ext/openssl/extconf.rb: need THREAD_MODEL.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 06:32:24 +00:00
akr 674f14a0bc * common.mk, ext/objspace/depend, ext/coverage/depend,
ext/-test-/debug/depend, ext/date/depend: Update dependencies.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28 03:43:17 +00:00
zzak 12fdf4bc92 * ext/openssl/ossl.c: [DOC] typo in example by @zoranzaric
[Fixes GH-401] https://github.com/ruby/ruby/pull/401


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-26 13:01:54 +00:00
zzak 0f448061de * ext/openssl/lib/openssl/ssl.rb: [DOC] Document OpenSSL::SSLServer
Based on a patch by Rafal Lisowski [Bug #7348]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42995 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-20 15:24:03 +00:00
drbrain 00aff4d8bc * ext/openssl/ossl_ssl.c (ossl_ssl_read): Replace duplicate
wait_writable with wait_readable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42711 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-27 19:54:53 +00:00
tenderlove 988ca60565 * io.c (io_read_nonblock): support non-blocking reads without raising
exceptions. As in: `io.read_nonblock(size, exception: false)`
  [ruby-core:38666] [Feature #5138]
* ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): ditto
* ext/stringio/stringio.c (strio_sysread): ditto
* io.c (rb_io_write_nonblock): support non-blocking writes without
  raising an exception.
* ext/openssl/ossl_ssl.c (ossl_ssl_write_internal): ditto
* test/openssl/test_pair.rb (class OpenSSL): tests
* test/ruby/test_io.rb (class TestIO): ditto
* test/socket/test_nonblock.rb (class TestSocketNonblock): ditto
* test/stringio/test_stringio.rb (class TestStringIO): ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-26 22:41:44 +00:00
zzak aecd5b67d5 * ext/openssl/ossl_hmac.c: [DOC] Documentation for OpenSSL::HMAC
based on a patch by @repah documenting-ruby/ruby#14
  https://github.com/documenting-ruby/ruby/pull/14


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-06 23:32:42 +00:00
ko1 dda113e3ff * ext/openssl/ossl.c: support additional three thread synchronization
functions. [ruby-trunk - Bug #8386]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42159 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-25 03:39:50 +00:00
nobu 9240eb3dfe ossl.c: suppress warning
* ext/openssl/ossl.c (Init_ossl_locks): to suppress shorten-64-to-32
  warning, re-apply part of r41879.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-24 06:27:49 +00:00
naruse 4c4347e698 * ext/openssl/extconf.rb (CRYPTO_THREADID): check exist or not.
* ext/openssl/ossl.c (ossl_thread_id): use rb_nativethread_self()
  implemented at r42137 to allow threads which doesn't associated with
  Ruby thread to use openssl functions.

* ext/openssl/ossl.c (Init_ossl_locks): If CRYPTO_THREADID is defined
  (OpenSSL 1.0.0 or later has it) use CRYPTO_THREADID_set_callback()
  instead of CRYPTO_set_id_callback() because its argument is
  unsigned long; it may cause id collision on mswin64
  whose sizeof(unsigned long) < sizeof(void*).
  http://www.openssl.org/docs/crypto/threads.html

* ext/openssl/ossl.c (ossl_threadid_func): defined for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-23 14:19:51 +00:00
ko1 55201cac9e * ext/openssl/ossl.c: use system native (system provided)
thread locking APIs added by last commit.
  This patch fixes [Bug #8386].
  "rb_mutex_*" APIs control only "Ruby" threads.
  Not for native threads.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42135 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-23 09:59:28 +00:00
drbrain bdbef403a1 * ext/openssl/ossl_asn1.c (asn1time_to_time): Implement YYMMDDhhmmZ
format for ASN.1 UTCTime.  [ruby-trunk - Bug #8664]
* test/openssl/test_asn1.rb:  Test for the above.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-22 23:44:53 +00:00
nobu 84c08bc3b8 ossl.c: fix argument type
* ext/openssl/ossl.c (ossl_lock_callback): fix argument type, and
  remove redundant casts.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10 02:19:54 +00:00
nobu b72bd6c080 ossl.c: rb_gc_register_mark_object
* ext/openssl/ossl.c (Init_ossl_locks): use rb_gc_register_mark_object
  instead of rb_global_variable.  probably RArray may be used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41881 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10 02:19:52 +00:00
nobu 351932cb4a ossl.c: check allocation
* ext/openssl/ossl.c (Init_ossl_locks): check if locks array is
  allocated successfully.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10 02:19:50 +00:00
nobu c341e85b1c ossl.c: check integer overflow
* ext/openssl/ossl.c (Init_ossl_locks): check integer overflow.
  OPENSSL_malloc() takes int only.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-10 02:19:47 +00:00
emboss 0d58bb5598 * ext/openssl/ossl_pkey_ec.c: Ensure compatibility to builds of
OpenSSL with OPENSSL_NO_EC2M defined, but OPENSSL_NO_EC not
  defined.
* test/openssl/test_pkey_ec.rb: Iterate over built-in curves
  (and assert their non-emptiness!) instead of hard-coding them, as
  this may cause problems with respect to the different availability
  of individual curves in individual OpenSSL builds.
  [ruby-core:54881] [Bug #8384]

  Thanks to Vit Ondruch for providing the patch!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 22:46:42 +00:00
emboss 7e443fcfea * ext/openssl/ossl.c: Provide CRYPTO_set_locking_callback() and
CRYPTO_set_id_callback() callback functions ossl_thread_id and
  ossl_lock_callback to ensure the OpenSSL extension is usable in
  multi-threaded environments.
  [ruby-core:54900] [Bug #8386]

  Thanks, Dirkjan Bussink, for the patch!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 21:44:50 +00:00
emboss a3a62f87e1 * lib/openssl/ssl.rb: Fix SSL client connection crash for SAN marked
critical.
  The patch for CVE-2013-4073 caused SSL crash when a SSL server returns
  the certificate that has critical SAN value.  X509 extension could
  include 2 or 3 elements in it:

  [id, criticality, octet_string] if critical,
  [id, octet_string] if not.

  Making sure to pick the last element of X509 extension and use it as
  SAN value.
  [ruby-core:55685] [Bug #8575]

  Thank you @nahi for providing the patch!


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 21:08:04 +00:00
hsbt 660fed6741 Fix comment typo by @parroty [fix GH-350]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-07-05 00:46:10 +00:00