1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize):

Add a null check for ssl; submitted by akira yamada
  in [ruby-dev:34950].

* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Define OP_NO_TICKET if
  SSL_OP_NO_TICKET is present; submitted by akira yamada
  in [ruby-dev:34944].

* test/openssl/test_ssl.rb (OpenSSL#test_server_session): Add a
  workaround for the case where OpenSSL is configured with
  --enable-tlsext; submitted by akira yamada in [ruby-dev:34944].


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16857 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
knu 2008-06-06 08:05:24 +00:00
parent 70bde7a3b5
commit 061fd36d75
36 changed files with 87 additions and 49 deletions

View file

@ -1,3 +1,17 @@
Fri Jun 6 17:04:56 2008 Akinori MUSHA <knu@iDaemons.org>
* ext/openssl/ossl_ssl_session.c (ossl_ssl_session_initialize):
Add a null check for ssl; submitted by akira yamada
in [ruby-dev:34950].
* ext/openssl/ossl_ssl.c (Init_ossl_ssl): Define OP_NO_TICKET if
SSL_OP_NO_TICKET is present; submitted by akira yamada
in [ruby-dev:34944].
* test/openssl/test_ssl.rb (OpenSSL#test_server_session): Add a
workaround for the case where OpenSSL is configured with
--enable-tlsext; submitted by akira yamada in [ruby-dev:34944].
Fri Jun 6 16:58:23 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/iconv/iconv.c (iconv_iconv): fix for length argument and now

View file

@ -1466,6 +1466,9 @@ Init_ossl_ssl()
ossl_ssl_def_const(OP_NO_SSLv2);
ossl_ssl_def_const(OP_NO_SSLv3);
ossl_ssl_def_const(OP_NO_TLSv1);
#if defined(SSL_OP_NO_TICKET)
ossl_ssl_def_const(OP_NO_TICKET);
#endif
ossl_ssl_def_const(OP_PKCS1_CHECK_1);
ossl_ssl_def_const(OP_PKCS1_CHECK_2);
ossl_ssl_def_const(OP_NETSCAPE_CA_DN_BUG);

View file

@ -47,7 +47,7 @@ static VALUE ossl_ssl_session_initialize(VALUE self, VALUE arg1)
Data_Get_Struct(arg1, SSL, ssl);
if ((ctx = SSL_get1_session(ssl)) == NULL)
if (!ssl || (ctx = SSL_get1_session(ssl)) == NULL)
ossl_raise(eSSLSession, "no session available");
} else {
BIO *in = ossl_obj2bio(arg1);

View file

@ -230,7 +230,7 @@ class CGI
# session_path:: the path for which this session applies. Defaults
# to the directory of the CGI script.
#
# +option+ is also passed on to the session storage class initialiser; see
# +option+ is also passed on to the session storage class initializer; see
# the documentation for each session storage class for the options
# they support.
#
@ -357,7 +357,7 @@ class CGI
# characters; automatically generated session ids observe
# this requirement.
#
# +option+ is a hash of options for the initialiser. The
# +option+ is a hash of options for the initializer. The
# following options are recognised:
#
# tmpdir:: the directory to use for storing the FileStore

View file

@ -30,7 +30,7 @@ class CGI
# characters; automatically generated session ids observe
# this requirement.
#
# +option+ is a hash of options for the initialiser. The
# +option+ is a hash of options for the initializer. The
# following options are recognised:
#
# tmpdir:: the directory to use for storing the PStore

View file

@ -250,7 +250,7 @@ SimpleDelegater = SimpleDelegator
# your class.
#
# class MyClass < DelegateClass( ClassToDelegateTo ) # Step 1
# def initiaize
# def initialize
# super(obj_of_ClassToDelegateTo) # Step 2
# end
# end

View file

@ -656,7 +656,7 @@ class ERB
#
# def build
# b = binding
# # create and run templates, filling member data variebles
# # create and run templates, filling member data variables
# ERB.new(<<-'END_PRODUCT'.gsub(/^\s+/, ""), 0, "", "@product").result b
# <%= PRODUCT[:name] %>
# <%= PRODUCT[:desc] %>

View file

@ -38,7 +38,7 @@
# @q = [ ] # prepare delegate object
# end
#
# # setup prefered interface, enq() and deq()...
# # setup preferred interface, enq() and deq()...
# def_delegator :@q, :push, :enq
# def_delegator :@q, :shift, :deq
#

View file

@ -112,7 +112,7 @@ module IRB
end
end
# aliases = [commans_alias, flag], ...
# aliases = [commands_alias, flag], ...
def self.def_extend_command(cmd_name, cmd_class, load_file = nil, *aliases)
case cmd_class
when Symbol

View file

@ -1,5 +1,5 @@
#
# irb/help.rb - print usase module
# irb/help.rb - print usage module
# $Release Version: 0.9.5$
# $Revision$
# $Date$

View file

@ -1,5 +1,5 @@
#
# notifier.rb - optput methods used by irb
# notifier.rb - output methods used by irb
# $Release Version: 0.9.5$
# $Revision$
# $Date$

View file

@ -1,5 +1,5 @@
#
# irb/ruby-lex.rb - ruby lexcal analizer
# irb/ruby-lex.rb - ruby lexcal analyzer
# $Release Version: 0.9.5$
# $Revision$
# $Date$

View file

@ -1,5 +1,5 @@
#
# irb/slex.rb - symple lex analizer
# irb/slex.rb - simple lex analyzer
# $Release Version: 0.9.5$
# $Revision$
# $Date$

View file

@ -1,4 +1,4 @@
# logger.rb - saimple logging utility
# logger.rb - simple logging utility
# Copyright (C) 2000-2003, 2005 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>.
require 'monitor'

View file

@ -65,11 +65,11 @@ It can be replaced by the following code:
: key, key=((|key|))
Sets an OpenSSL::PKey::RSA or OpenSSL::PKey::DSA object.
(This method is appeared in Michal Rokos's OpenSSL extention.)
(This method is appeared in Michal Rokos's OpenSSL extension.)
: cert, cert=((|cert|))
Sets an OpenSSL::X509::Certificate object as client certificate
(This method is appeared in Michal Rokos's OpenSSL extention).
(This method is appeared in Michal Rokos's OpenSSL extension).
: ca_file, ca_file=((|path|))
Sets path of a CA certification file in PEM format.

View file

@ -826,7 +826,7 @@ class OptionParser
#
# Directs to reject specified class argument.
#
# +t+:: Argument class speficier, any object including Class.
# +t+:: Argument class specifier, any object including Class.
#
# reject(t)
#
@ -1037,13 +1037,13 @@ class OptionParser
# "-x[OPTIONAL]"
# "-x"
# There is also a special form which matches character range (not full
# set of regural expression):
# set of regular expression):
# "-[a-z]MANDATORY"
# "-[a-z][OPTIONAL]"
# "-[a-z]"
#
# [Argument style and description:]
# Instead of specifying mandatory or optional orguments directly in the
# Instead of specifying mandatory or optional arguments directly in the
# switch parameter, this separate parameter can be used.
# "=MANDATORY"
# "=[OPTIONAL]"

View file

@ -11,14 +11,14 @@ require "fileutils"
require "digest/md5"
#
# PStore implements a file based persistance mechanism based on a Hash. User
# PStore implements a file based persistence mechanism based on a Hash. User
# code can store hierarchies of Ruby objects (values) into the data store file
# by name (keys). An object hierarchy may be just a single object. User code
# may later read values back from the data store or even update data, as needed.
#
# The transactional behavior ensures that any changes succeed or fail together.
# This can be used to ensure that the data store is not left in a transitory
# state, where some values were upated but others were not.
# state, where some values were updated but others were not.
#
# Behind the scenes, Ruby objects are stored to the data store file with
# Marshal. That carries the usual limitations. Proc objects cannot be

View file

@ -117,10 +117,10 @@ module RDoc
# method in the HTML output. This method must be in the same source file
# as the rb_define_method.
#
# C classes can be diagramed (see /tc/dl/ruby/ruby/error.c), and RDoc
# C classes can be diagrammed (see /tc/dl/ruby/ruby/error.c), and RDoc
# integrates C and Ruby source into one tree
#
# The comment blocks may include special direcives:
# The comment blocks may include special directives:
#
# [Document-class: <i>name</i>]
# This comment block is documentation for the given class. Use this
@ -131,10 +131,10 @@ module RDoc
# automatically find the method from it's declaration
#
# [call-seq: <i>text up to an empty line</i>]
# Because C source doesn't give descripive names to Ruby-level parameters,
# Because C source doesn't give descriptive names to Ruby-level parameters,
# you need to document the calling sequence explicitly
#
# In additon, RDoc assumes by default that the C method implementing a
# In addition, RDoc assumes by default that the C method implementing a
# Ruby function is in the same source file as the rb_define_method call.
# If this isn't the case, add the comment
#

View file

@ -201,7 +201,7 @@ module RDoc
@progress = $stderr unless options.quiet
end
# devine code constructs
# define code constructs
def scan
# remove private comment
@ -1065,7 +1065,7 @@ module RDoc
#
# If "all" argument is true, information of all arguments are returned.
# If "modified_params" is true, list of arguments are decorated,
# for exameple, optional arguments are parenthetic as "[arg]".
# for example, optional arguments are parenthetic as "[arg]".
#
def find_arguments(args, text, all=nil, indent=nil, modified_params=nil)
return unless args || all
@ -1143,8 +1143,8 @@ EOF
#
# Comments just after module or subprogram, or arguments are
# returnd. If "COMMENTS_ARE_UPPER" is true, comments just before
# modules or subprograms are returnd
# returned. If "COMMENTS_ARE_UPPER" is true, comments just before
# modules or subprograms are returned
#
def find_comments text
return "" unless text

View file

@ -252,7 +252,7 @@ class Resolv
end
##
# Iterates over all hostnames for +address+ retrived from the hosts file.
# Iterates over all hostnames for +address+ retrieved from the hosts file.
def each_name(address, &proc)
lazy_initialize
@ -2015,7 +2015,7 @@ class Resolv
end
##
# A String reperesentation of this IPv4 address.
# A String representation of this IPv4 address.
##
# The raw IPv4 address as a String.

View file

@ -44,7 +44,7 @@ module REXML
@pairs.keys.include? key
end
# Itterate over the key/value pairs:
# Iterate over the key/value pairs:
# attlist_decl.each { |attribute_name, attribute_value| ... }
def each(&block)
@pairs.each(&block)

View file

@ -147,7 +147,7 @@ module REXML
# A controversial point is whether Document should always write the XML
# declaration (<?xml version='1.0'?>) whether or not one is given by the
# user (or source document). REXML does not write one if one was not
# specified, because it adds unneccessary bandwidth to applications such
# specified, because it adds unnecessary bandwidth to applications such
# as XML-RPC.
#
# See also the classes in the rexml/formatters package for the proper way

View file

@ -360,7 +360,7 @@ module REXML
# Iterates through the children, yielding for each Element that
# has a particular text set.
# text::
# the text to search for. If nil, or not supplied, will itterate
# the text to search for. If nil, or not supplied, will iterate
# over all +Element+ children that contain at least one +Text+ node.
# max::
# (optional) causes this method to return after yielding
@ -989,7 +989,7 @@ module REXML
end
alias :size :length
# Itterates over the attributes of an Element. Yields actual Attribute
# Iterates over the attributes of an Element. Yields actual Attribute
# nodes, not String values.
#
# doc = Document.new '<a x="1" y="2"/>'
@ -1006,7 +1006,7 @@ module REXML
end
end
# Itterates over each attribute of an Element, yielding the expanded name
# Iterates over each attribute of an Element, yielding the expanded name
# and value as a pair of Strings.
#
# doc = Document.new '<a x="1" y="2"/>'

View file

@ -125,7 +125,7 @@ module REXML
end
def wrap(string, width)
# Recursivly wrap string at width.
# Recursively wrap string at width.
return string if string.length <= width
place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
return string[0,place] + "\n" + wrap(string[place+1..-1], width)

View file

@ -235,7 +235,7 @@ module REXML
# from string then we ignore the second &
# subsequent mappings
#
# if a charactcer maps to nil then we delete it
# if a character maps to nil then we delete it
# in the output. This happens if the from
# string is longer than the to string
#

View file

@ -189,7 +189,7 @@ module REXML
end
def wrap(string, width, addnewline=false)
# Recursivly wrap string at width.
# Recursively wrap string at width.
return string if string.length <= width
place = string.rindex(' ', width) # Position in string with last ' ' before cutoff
if addnewline then

View file

@ -30,7 +30,7 @@ module REXML
parser.parse(path, element).flatten[0]
end
# Itterates over nodes that match the given path, calling the supplied
# Iterates over nodes that match the given path, calling the supplied
# block with the match.
# element::
# The context element

View file

@ -19,7 +19,7 @@ module Rinda
# 1. A RingServer begins listening on the broadcast UDP address.
# 2. A RingFinger sends a UDP packet containing the DRb URI where it will
# listen for a reply.
# 3. The RingServer recieves the UDP packet and connects back to the
# 3. The RingServer receives the UDP packet and connects back to the
# provided DRb URI with the DRb service.
class RingServer
@ -119,7 +119,7 @@ module Rinda
end
##
# Contains all discoverd TupleSpaces except for the primary.
# Contains all discovered TupleSpaces except for the primary.
def self.to_a
finger.to_a

View file

@ -363,7 +363,7 @@ class Time
min = $5.to_i
sec = $6.to_i
usec = 0
usec = $7.to_f * 1000000 if $7
usec = ($7[1..-1] + '000000')[0,6].to_i if $7
if $8
zone = $8
year, mon, day, hour, min, sec =
@ -621,6 +621,8 @@ if __FILE__ == $0
t = Time.utc(1960, 12, 31, 23, 0, 0, 123456)
assert_equal("1960-12-31T23:00:00.123456Z", t.xmlschema(6))
end
assert_equal(249, Time.xmlschema("2008-06-05T23:49:23.000249+09:00").usec)
end
def test_completion

View file

@ -47,7 +47,7 @@ module WEBrick
req.header.delete("proxy-authorization")
end
# Some header fields shuold not be transfered.
# Some header fields should not be transferred.
HopByHop = %w( connection keep-alive proxy-authenticate upgrade
proxy-authorization te trailers transfer-encoding )
ShouldNotTransfer = %w( set-cookie proxy-connection )

View file

@ -132,7 +132,7 @@ module WEBrick
end
end
# Determin the message length (RFC2616 -- 4.4 Message Length)
# Determine the message length (RFC2616 -- 4.4 Message Length)
if @status == 304 || @status == 204 || HTTPStatus::info?(@status)
@header.delete('content-length')
@body = ""

View file

@ -496,7 +496,7 @@ BSD_vfprintf(fp, fmt0, ap)
/*
* Choose PADSIZE to trade efficiency vs. size. If larger printf
* fields occur frequently, increase PADSIZE and make the initialisers
* fields occur frequently, increase PADSIZE and make the initializers
* below longer.
*/
#define PADSIZE 16 /* pad chunk size */

View file

@ -1573,8 +1573,21 @@ rb_class_initialize(argc, argv, klass)
* call-seq:
* class.allocate() => obj
*
* Allocates space for a new object of <i>class</i>'s class. The
* returned object must be an instance of <i>class</i>.
* Allocates space for a new object of <i>class</i>'s class and does not
* call initialize on the new instance. The returned object must be an
* instance of <i>class</i>.
*
* klass = Class.new do
* def initialize(*args)
* @initialized = true
* end
*
* def initialized?
* @initialized || false
* end
* end
*
* klass.allocate.initialized? #=> false
*
*/

View file

@ -499,7 +499,12 @@ class OpenSSL::TestSSL < Test::Unit::TestCase
start_server(PORT, OpenSSL::SSL::VERIFY_NONE, true, :ctx_proc => ctx_proc, :server_proc => server_proc) do |server, port|
10.times do |i|
sock = TCPSocket.new("127.0.0.1", port)
ssl = OpenSSL::SSL::SSLSocket.new(sock)
ctx = OpenSSL::SSL::SSLContext.new
if defined?(OpenSSL::SSL::OP_NO_TICKET)
# disable RFC4507 support
ctx.options = OpenSSL::SSL::OP_NO_TICKET
end
ssl = OpenSSL::SSL::SSLSocket.new(sock, ctx)
ssl.sync_close = true
ssl.session = first_session if first_session
ssl.connect

View file

@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-06"
#define RUBY_VERSION_CODE 187
#define RUBY_RELEASE_CODE 20080606
#define RUBY_PATCHLEVEL 5
#define RUBY_PATCHLEVEL 6
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8

View file

@ -25,6 +25,7 @@
#endif
#ifdef USE_WINSOCK2
#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>
#else
#include <windows.h>