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

100 Коммитов

Автор SHA1 Сообщение Дата
usa c1bad60408 * ext/openssl/lib/openssl/x509.rb
(OpenSSL::X509::Name::RFC2253DN::StringChar): get rid of a false
  positive assertion in ripper's test.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-20 15:39:03 +00:00
nagachika 7b0635d157 * ext/openssl/lib/openssl/ssl.rb (DEFAULT_PARAMS): override
options even if OpenSSL::SSL::OP_NO_SSLv3 is not defined.
  this is pointed out by Stephen Touset. [ruby-core:65711] [Bug #9424]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-22 13:55:24 +00:00
akr 341376215b * ext/openssl/lib/openssl/x509.rb (OpenSSL::X509::Name#pretty_print):
New method.
  (OpenSSL::X509::Certificate#pretty_print): Ditto.

* ext/openssl/lib/openssl/bn.rb (OpenSSL::BN#pretty_print): Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-09-20 01:17:05 +00:00
akr 68ac33a511 * ext/openssl/lib/openssl/ssl.rb (SSLServer#accept): Close a socket
if any exception occur. 



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-29 10:32:19 +00:00
akr 2dbae9b1f1 * ext/openssl/lib/openssl/ssl.rb (OpenSSL::SSL::SSLServer#accept):
Consider Socket#accept as well as TCPServer#accept.
  Reported by Sam Stelfox.  [ruby-core:62064] [Bug #9750]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-05-07 12:48:27 +00:00
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 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 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 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
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
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
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
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
nagachika bc47f294ee * ext/openssl/lib/openssl/ssl.rb (verify_certificate_identity): fix
hostname verification. Patched by nahi.

* test/openssl/test_ssl.rb (test_verify_certificate_identity): test for
  above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-27 11:09:19 +00:00
naruse 8b29525dad * ext/openssl/ossl_bn.c (ossl_bn_initialize): allow Fixnum and Bignum.
[ruby-core:53986] [Feature #8217]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40461 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-25 07:02:31 +00:00
emboss 84f1dae9d6 * ext/openssl/lib/ssl.rb: Enable insertion of empty fragments as a
countermeasure for the BEAST attack by default. The default options
  of OpenSSL::SSL:SSLContext are now:
  OpenSSL::SSL::OP_ALL & ~OpenSSL::SSL::OP_DONT_INSERT_EMPTY_FRAGMENTS
  [Bug #5353] [ruby-core:39673]

* test/openssl/test_ssl.rb: Adapt tests to new SSLContext default.

* NEWS: Announce the new default.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38433 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-18 02:02:43 +00:00
nobu af6c038b23 remove trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04 00:57:31 +00:00
emboss df05bd2c82 * ext/openssl/lib/openssl/digest.rb
test/openssl/test_digest.rb: Add Digest module function to OpenSSL
  module and test it. Patch provided by Eric Hodel.
  [ruby-core:46908][Feature #6819]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36592 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-08-02 01:58:49 +00:00
emboss 43759fc1ed * lib/openssl/ssl.rb: Use a simple random number to generate the
session id. MD5, as was used before, causes problems when
  using a FIPS version of OpenSSL. Issue was found by Jared
  Jennings, thank you!
  [ruby-trunk - Bug #6137]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-10 01:53:20 +00:00
ayumin 0456c36d03 * ext/openssl/lib/openssl/ssl.rb: add hostname to "hostname does not
match server cert." error.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35494 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-30 00:11:44 +00:00
drbrain a5fc87bd5b * ext/openssl/lib/openssl/ssl.rb (class OpenSSL::SSL::SSLContext):
Document #set_params.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33695 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-09 23:45:39 +00:00
emboss 65ca601ba6 * lib/openssl/buffering.rb: Force multi-byte strings to be treated as
binary data.
* test/openssl/test_ssl.rb: Add test for it.

Thanks to Niklas Baumstark for reporting the issue!

[Ruby 1.9 - Bug #5233] [ruby-core:39120]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-19 20:05:21 +00:00
drbrain 965f51b348 * ext/openssl/lib/openssl/bn.rb: Hide copyright info from RDoc.
* ext/openssl/lib/openssl/digest.rb:  ditto
* ext/openssl/lib/openssl/x509.rb:  ditto
* ext/openssl/lib/openssl/cipher.rb:  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25 00:43:45 +00:00
drbrain b0fb4fb689 * ext/openssl/ossl_digest.c: Document OpenSSL::Digest::digest and add
an example to OpenSSL::Digest.  Patch by Sylvain Daubert.
  [Ruby 1.9 - Bug #5166]
* ext/openssl/lib/openssl/digest.rb (module OpenSSL):  ditto


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-08-25 00:29:02 +00:00
nahi 0a9b952c6f * ext/openssl/lib/openssl.rb: End of transition period introduced by
[ruby-dev:38018]. From the next version of 1.9.3, you should use
    require "openssl"
  instead of
    require "openssl/ssl"
  and
    require "openssl/x509"


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32664 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 06:30:07 +00:00
nahi 8c30497aae * ext/openssl/lib/openssl/x509.rb: Cosmetic change: move definition
introduced in r30152 to x509-internal.rb.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32662 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-25 04:49:26 +00:00
nahi c102821291 * ext/openssl/ossl_cipher.c, ext/openssl/lib/openssl/cipher.rb:
Documentation fix by Ippei Obayashi. See #4419.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32176 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-20 09:48:05 +00:00
nahi 47f89c982c * ext/openssl/lib/openssl/buffering.rb (module OpenSSL):
Buffering#each_byte should return String in accordance with IO in
  1.9. 

* test/openssl/test_buffering.rb (class OpenSSL): add tests for getc
  and each_byte.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32012 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-11 14:07:42 +00:00
nahi cd9423097a * ext/openssl/lib/openssl/buffering.rb: removed circular require of
openssl.rb.

        * ext/openssl/lib/openssl/*: removed following comment for transition 
          measures of avoiding circular require. No one claimed about this as 
          far as I know.
          ##
          # Should we care what if somebody require this file directly?
          # require "openssl"


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-22 04:39:04 +00:00
drbrain d6fb308078 * ext/openssl/lib/openssl/buffering.rb (module OpenSSL): #flush should
not change sync mode on exception.
	* test/openssl/test_buffering.rb: added


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31113 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-16 06:07:03 +00:00
drbrain 92946d4474 de-nest the Buffering module
add RDoc for OpenSSL::Buffering


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31112 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-16 04:47:18 +00:00
tenderlove 16a166dd35 * ext/openssl/ossl_x509store.c (ossl_x509stctx_cleanup): removing C
implementation of `cleanup`.

* ext/openssl/lib/openssl/x509.rb: adding ruby implementation of
  `cleanup`.  OpenSSL::X509::StoreContext#cleanup is deprecated since
  reusing the underlying struct doesn't make sense. [ruby-dev:42546]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30152 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-12-09 17:18:54 +00:00
naruse 3a633b812e * ext/openssl/lib/openssl/bn.rb (Integer#to_bn): OpenSSL::BN.new
accepts only Strings, so call Integer#to_s(16).
  16 is for an optimization. [ruby-dev:42336]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-04 00:33:22 +00:00
nahi 7f438d8402 * ext/openssl/lib/openssl/x509-internal.rb: removed unused local
variable.

        * test/openssl/*: less warnings while test running with -w.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29217 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-10 08:54:50 +00:00
nahi 8233db65b6 * Fixed exception message for SSL post connection check failure. Patch
by Paul Betteridge. ref [Bug #3704]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-06 01:53:00 +00:00
nahi 15c39b07bd * backport r28621 and r28632 from ruby_1_8;
* ext/openssl/ossl_config.c, ext/openssl/lib/openssl/config.rb,
            ext/openssl/lib/openssl.rb: reimplement OpenSSL::Config in Ruby. 
            Now it should work on windows. 

          * test/openssl/test_config.rb: added tests for OpenSSL::Config#dup.

          * test/openssl/test_config.rb: added tests for Config#clone.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-19 08:22:31 +00:00
nobu b4f1eaa493 * ext/openssl/lib/openssl/x509-internal.rb, lib/forwardable.rb,
lib/irb/cmd/fork.rb, lib/mutex_m.rb,
  lib/shell/process-controller.rb, lib/sync.rb, object.c: 
  suppress warnings patched by Benoit Daloze at [ruby-core:30366].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-23 08:48:44 +00:00
knu d223734555 Back out the series of changes pending a due discussion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-23 17:33:39 +00:00
knu 497a5f8d08 * ext/openssl/lib/openssl/digest.rb (OpenSSL::Digest::hexdigest):
No need to define hexdigest() here because the super method is
  properly defined to use digest() passing through arguments.




git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-23 15:56:45 +00:00
nobu 19b24f499b * include/ruby/ruby.h (rb_check_safe_str): deprecated.
* ext/openssl/ossl_x509store.c (ossl_x509store_add_{file,path}):
  replaced deprecated funtion.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24541 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-14 11:03:22 +00:00
akr 17a085ea8c * ext/openssl/lib/openssl/buffering.rb
(OpenSSL::Buffering#write_nonblock): new method.

* ext/openssl/ossl_ssl.c (ossl_ssl_write_nonblock): new method.
  (ossl_ssl_write_internal): defined.
  (ossl_ssl_write): use ossl_ssl_write_internal.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-20 17:39:44 +00:00
akr 2208c990e1 update rdoc and NEWS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23010 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-19 15:31:24 +00:00
nobu 287a34ae0d * {ext,lib,test}/**/*.rb: removed trailing spaces.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-06 03:56:38 +00:00