jruby-openssl 0.7.5.dev → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +44 -14
- data/Manifest.txt +135 -80
- data/Rakefile +14 -6
- data/lib/{openssl.rb → 1.8/openssl.rb} +2 -11
- data/lib/{openssl → 1.8/openssl}/bn.rb +2 -2
- data/lib/{openssl → 1.8/openssl}/buffering.rb +3 -1
- data/lib/{openssl → 1.8/openssl}/cipher.rb +0 -0
- data/lib/{openssl → 1.8/openssl}/config.rb +1 -1
- data/lib/{openssl → 1.8/openssl}/digest.rb +2 -2
- data/lib/{openssl → 1.8/openssl}/pkcs7.rb +0 -0
- data/lib/{openssl/ssl.rb → 1.8/openssl/ssl-internal.rb} +2 -2
- data/lib/1.8/openssl/ssl.rb +1 -0
- data/lib/{openssl/x509.rb → 1.8/openssl/x509-internal.rb} +8 -9
- data/lib/1.8/openssl/x509.rb +1 -0
- data/lib/1.9/openssl.rb +22 -0
- data/lib/1.9/openssl/bn.rb +35 -0
- data/lib/1.9/openssl/buffering.rb +448 -0
- data/lib/1.9/openssl/cipher.rb +65 -0
- data/lib/1.9/openssl/config.rb +313 -0
- data/lib/1.9/openssl/digest.rb +72 -0
- data/lib/1.9/openssl/ssl-internal.rb +177 -0
- data/lib/1.9/openssl/ssl.rb +2 -0
- data/lib/1.9/openssl/x509-internal.rb +158 -0
- data/lib/1.9/openssl/x509.rb +2 -0
- data/lib/{jopenssl.jar → shared/jopenssl.jar} +0 -0
- data/lib/{jopenssl → shared/jopenssl}/version.rb +1 -1
- data/lib/shared/openssl.rb +18 -0
- data/lib/{openssl → shared/openssl}/dummy.rb +0 -0
- data/lib/{openssl → shared/openssl}/dummyssl.rb +0 -0
- data/lib/shared/openssl/ssl.rb +1 -0
- data/lib/shared/openssl/x509.rb +1 -0
- data/test/{openssl → 1.8}/ssl_server.rb +0 -0
- data/test/{openssl → 1.8}/test_asn1.rb +15 -0
- data/test/{openssl → 1.8}/test_cipher.rb +0 -0
- data/test/{openssl → 1.8}/test_config.rb +0 -0
- data/test/{openssl → 1.8}/test_digest.rb +0 -0
- data/test/{openssl → 1.8}/test_ec.rb +0 -0
- data/test/{openssl → 1.8}/test_hmac.rb +0 -0
- data/test/{openssl → 1.8}/test_ns_spki.rb +0 -0
- data/test/{openssl → 1.8}/test_pair.rb +10 -2
- data/test/{openssl → 1.8}/test_pkcs7.rb +0 -0
- data/test/{openssl → 1.8}/test_pkey_rsa.rb +0 -0
- data/test/{openssl → 1.8}/test_ssl.rb +17 -20
- data/test/{openssl → 1.8}/test_x509cert.rb +0 -0
- data/test/{openssl → 1.8}/test_x509crl.rb +0 -0
- data/test/{openssl → 1.8}/test_x509ext.rb +0 -0
- data/test/{openssl → 1.8}/test_x509name.rb +0 -0
- data/test/{openssl → 1.8}/test_x509req.rb +0 -0
- data/test/{openssl → 1.8}/test_x509store.rb +0 -0
- data/test/{openssl → 1.8}/utils.rb +0 -0
- data/test/1.9/ssl_server.rb +81 -0
- data/test/1.9/test_asn1.rb +589 -0
- data/test/1.9/test_bn.rb +23 -0
- data/test/1.9/test_buffering.rb +88 -0
- data/test/1.9/test_cipher.rb +107 -0
- data/test/1.9/test_config.rb +288 -0
- data/test/1.9/test_digest.rb +118 -0
- data/test/1.9/test_engine.rb +15 -0
- data/test/1.9/test_hmac.rb +32 -0
- data/test/1.9/test_ns_spki.rb +50 -0
- data/test/1.9/test_ocsp.rb +47 -0
- data/test/1.9/test_pair.rb +257 -0
- data/test/1.9/test_pkcs12.rb +209 -0
- data/test/1.9/test_pkcs7.rb +151 -0
- data/test/1.9/test_pkey_dh.rb +72 -0
- data/test/1.9/test_pkey_dsa.rb +224 -0
- data/test/1.9/test_pkey_ec.rb +182 -0
- data/test/1.9/test_pkey_rsa.rb +244 -0
- data/test/1.9/test_ssl.rb +455 -0
- data/test/1.9/test_ssl_session.rb +327 -0
- data/test/1.9/test_x509cert.rb +217 -0
- data/test/1.9/test_x509crl.rb +221 -0
- data/test/1.9/test_x509ext.rb +69 -0
- data/test/1.9/test_x509name.rb +296 -0
- data/test/1.9/test_x509req.rb +150 -0
- data/test/1.9/test_x509store.rb +229 -0
- data/test/1.9/utils.rb +304 -0
- data/test/fixture/purpose/ca/ca_config.rb +1 -1
- data/test/fixture/purpose/ca/gen_cert.rb +128 -0
- data/test/fixture/purpose/ca/newcerts/4_cert.pem +19 -0
- data/test/fixture/purpose/ca/serial +1 -1
- data/test/fixture/purpose/sslserver_no_dsig_in_keyUsage.pem +19 -0
- data/test/ruby/envutil.rb +208 -0
- data/test/ruby/ut_eof.rb +128 -0
- data/test/test_java.rb +1 -1
- data/test/test_openssl.rb +1 -1
- data/test/test_pkcs7.rb +16 -0
- data/test/test_pkey_dsa.rb +180 -0
- data/test/test_pkey_rsa.rb +298 -0
- data/test/test_ssl.rb +1 -1
- data/test/test_x509store.rb +8 -0
- metadata +121 -75
- data/test/test_pkey.rb +0 -204
@@ -0,0 +1,177 @@
|
|
1
|
+
=begin
|
2
|
+
= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for SSL
|
3
|
+
|
4
|
+
= Info
|
5
|
+
'OpenSSL for Ruby 2' project
|
6
|
+
Copyright (C) 2001 GOTOU YUUZOU <gotoyuzo@notwork.org>
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
= Licence
|
10
|
+
This program is licenced under the same licence as Ruby.
|
11
|
+
(See the file 'LICENCE'.)
|
12
|
+
|
13
|
+
= Version
|
14
|
+
$Id: ssl-internal.rb 29189 2010-09-06 01:53:00Z nahi $
|
15
|
+
=end
|
16
|
+
|
17
|
+
require "openssl/buffering"
|
18
|
+
require "fcntl"
|
19
|
+
|
20
|
+
module OpenSSL
|
21
|
+
module SSL
|
22
|
+
class SSLContext
|
23
|
+
DEFAULT_PARAMS = {
|
24
|
+
:ssl_version => "SSLv23",
|
25
|
+
:verify_mode => OpenSSL::SSL::VERIFY_PEER,
|
26
|
+
:ciphers => "ALL:!ADH:!EXPORT:!SSLv2:RC4+RSA:+HIGH:+MEDIUM:+LOW",
|
27
|
+
:options => OpenSSL::SSL::OP_ALL,
|
28
|
+
}
|
29
|
+
|
30
|
+
DEFAULT_CERT_STORE = OpenSSL::X509::Store.new
|
31
|
+
DEFAULT_CERT_STORE.set_default_paths
|
32
|
+
if defined?(OpenSSL::X509::V_FLAG_CRL_CHECK_ALL)
|
33
|
+
DEFAULT_CERT_STORE.flags = OpenSSL::X509::V_FLAG_CRL_CHECK_ALL
|
34
|
+
end
|
35
|
+
|
36
|
+
def set_params(params={})
|
37
|
+
params = DEFAULT_PARAMS.merge(params)
|
38
|
+
params.each{|name, value| self.__send__("#{name}=", value) }
|
39
|
+
if self.verify_mode != OpenSSL::SSL::VERIFY_NONE
|
40
|
+
unless self.ca_file or self.ca_path or self.cert_store
|
41
|
+
self.cert_store = DEFAULT_CERT_STORE
|
42
|
+
end
|
43
|
+
end
|
44
|
+
return params
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
module SocketForwarder
|
49
|
+
def addr
|
50
|
+
to_io.addr
|
51
|
+
end
|
52
|
+
|
53
|
+
def peeraddr
|
54
|
+
to_io.peeraddr
|
55
|
+
end
|
56
|
+
|
57
|
+
def setsockopt(level, optname, optval)
|
58
|
+
to_io.setsockopt(level, optname, optval)
|
59
|
+
end
|
60
|
+
|
61
|
+
def getsockopt(level, optname)
|
62
|
+
to_io.getsockopt(level, optname)
|
63
|
+
end
|
64
|
+
|
65
|
+
def fcntl(*args)
|
66
|
+
to_io.fcntl(*args)
|
67
|
+
end
|
68
|
+
|
69
|
+
def closed?
|
70
|
+
to_io.closed?
|
71
|
+
end
|
72
|
+
|
73
|
+
def do_not_reverse_lookup=(flag)
|
74
|
+
to_io.do_not_reverse_lookup = flag
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
module Nonblock
|
79
|
+
def initialize(*args)
|
80
|
+
flag = File::NONBLOCK
|
81
|
+
flag |= @io.fcntl(Fcntl::F_GETFL) if defined?(Fcntl::F_GETFL)
|
82
|
+
@io.fcntl(Fcntl::F_SETFL, flag)
|
83
|
+
super
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
def verify_certificate_identity(cert, hostname)
|
88
|
+
should_verify_common_name = true
|
89
|
+
cert.extensions.each{|ext|
|
90
|
+
next if ext.oid != "subjectAltName"
|
91
|
+
ext.value.split(/,\s+/).each{|general_name|
|
92
|
+
if /\ADNS:(.*)/ =~ general_name
|
93
|
+
should_verify_common_name = false
|
94
|
+
reg = Regexp.escape($1).gsub(/\\\*/, "[^.]+")
|
95
|
+
return true if /\A#{reg}\z/i =~ hostname
|
96
|
+
elsif /\AIP Address:(.*)/ =~ general_name
|
97
|
+
should_verify_common_name = false
|
98
|
+
return true if $1 == hostname
|
99
|
+
end
|
100
|
+
}
|
101
|
+
}
|
102
|
+
if should_verify_common_name
|
103
|
+
cert.subject.to_a.each{|oid, value|
|
104
|
+
if oid == "CN"
|
105
|
+
reg = Regexp.escape(value).gsub(/\\\*/, "[^.]+")
|
106
|
+
return true if /\A#{reg}\z/i =~ hostname
|
107
|
+
end
|
108
|
+
}
|
109
|
+
end
|
110
|
+
return false
|
111
|
+
end
|
112
|
+
module_function :verify_certificate_identity
|
113
|
+
|
114
|
+
class SSLSocket
|
115
|
+
include Buffering
|
116
|
+
include SocketForwarder
|
117
|
+
include Nonblock
|
118
|
+
|
119
|
+
def post_connection_check(hostname)
|
120
|
+
unless OpenSSL::SSL.verify_certificate_identity(peer_cert, hostname)
|
121
|
+
raise SSLError, "hostname does not match the server certificate"
|
122
|
+
end
|
123
|
+
return true
|
124
|
+
end
|
125
|
+
|
126
|
+
def session
|
127
|
+
SSL::Session.new(self)
|
128
|
+
rescue SSL::Session::SessionError
|
129
|
+
nil
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
133
|
+
class SSLServer
|
134
|
+
include SocketForwarder
|
135
|
+
attr_accessor :start_immediately
|
136
|
+
|
137
|
+
def initialize(svr, ctx)
|
138
|
+
@svr = svr
|
139
|
+
@ctx = ctx
|
140
|
+
unless ctx.session_id_context
|
141
|
+
session_id = OpenSSL::Digest::MD5.hexdigest($0)
|
142
|
+
@ctx.session_id_context = session_id
|
143
|
+
end
|
144
|
+
@start_immediately = true
|
145
|
+
end
|
146
|
+
|
147
|
+
def to_io
|
148
|
+
@svr
|
149
|
+
end
|
150
|
+
|
151
|
+
def listen(backlog=5)
|
152
|
+
@svr.listen(backlog)
|
153
|
+
end
|
154
|
+
|
155
|
+
def shutdown(how=Socket::SHUT_RDWR)
|
156
|
+
@svr.shutdown(how)
|
157
|
+
end
|
158
|
+
|
159
|
+
def accept
|
160
|
+
sock = @svr.accept
|
161
|
+
begin
|
162
|
+
ssl = OpenSSL::SSL::SSLSocket.new(sock, @ctx)
|
163
|
+
ssl.sync_close = true
|
164
|
+
ssl.accept if @start_immediately
|
165
|
+
ssl
|
166
|
+
rescue SSLError => ex
|
167
|
+
sock.close
|
168
|
+
raise ex
|
169
|
+
end
|
170
|
+
end
|
171
|
+
|
172
|
+
def close
|
173
|
+
@svr.close
|
174
|
+
end
|
175
|
+
end
|
176
|
+
end
|
177
|
+
end
|
@@ -0,0 +1,158 @@
|
|
1
|
+
=begin
|
2
|
+
= $RCSfile$ -- Ruby-space definitions that completes C-space funcs for X509 and subclasses
|
3
|
+
|
4
|
+
= Info
|
5
|
+
'OpenSSL for Ruby 2' project
|
6
|
+
Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
7
|
+
All rights reserved.
|
8
|
+
|
9
|
+
= Licence
|
10
|
+
This program is licenced under the same licence as Ruby.
|
11
|
+
(See the file 'LICENCE'.)
|
12
|
+
|
13
|
+
= Version
|
14
|
+
$Id: x509-internal.rb 32663 2011-07-25 04:51:26Z nahi $
|
15
|
+
=end
|
16
|
+
|
17
|
+
module OpenSSL
|
18
|
+
module X509
|
19
|
+
class ExtensionFactory
|
20
|
+
def create_extension(*arg)
|
21
|
+
if arg.size > 1
|
22
|
+
create_ext(*arg)
|
23
|
+
else
|
24
|
+
send("create_ext_from_"+arg[0].class.name.downcase, arg[0])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def create_ext_from_array(ary)
|
29
|
+
raise ExtensionError, "unexpected array form" if ary.size > 3
|
30
|
+
create_ext(ary[0], ary[1], ary[2])
|
31
|
+
end
|
32
|
+
|
33
|
+
def create_ext_from_string(str) # "oid = critical, value"
|
34
|
+
oid, value = str.split(/=/, 2)
|
35
|
+
oid.strip!
|
36
|
+
value.strip!
|
37
|
+
create_ext(oid, value)
|
38
|
+
end
|
39
|
+
|
40
|
+
def create_ext_from_hash(hash)
|
41
|
+
create_ext(hash["oid"], hash["value"], hash["critical"])
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
class Extension
|
46
|
+
def to_s # "oid = critical, value"
|
47
|
+
str = self.oid
|
48
|
+
str << " = "
|
49
|
+
str << "critical, " if self.critical?
|
50
|
+
str << self.value.gsub(/\n/, ", ")
|
51
|
+
end
|
52
|
+
|
53
|
+
def to_h # {"oid"=>sn|ln, "value"=>value, "critical"=>true|false}
|
54
|
+
{"oid"=>self.oid,"value"=>self.value,"critical"=>self.critical?}
|
55
|
+
end
|
56
|
+
|
57
|
+
def to_a
|
58
|
+
[ self.oid, self.value, self.critical? ]
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
class Name
|
63
|
+
module RFC2253DN
|
64
|
+
Special = ',=+<>#;'
|
65
|
+
HexChar = /[0-9a-fA-F]/
|
66
|
+
HexPair = /#{HexChar}#{HexChar}/
|
67
|
+
HexString = /#{HexPair}+/
|
68
|
+
Pair = /\\(?:[#{Special}]|\\|"|#{HexPair})/
|
69
|
+
StringChar = /[^#{Special}\\"]/
|
70
|
+
QuoteChar = /[^\\"]/
|
71
|
+
AttributeType = /[a-zA-Z][0-9a-zA-Z]*|[0-9]+(?:\.[0-9]+)*/
|
72
|
+
AttributeValue = /
|
73
|
+
(?!["#])((?:#{StringChar}|#{Pair})*)|
|
74
|
+
\#(#{HexString})|
|
75
|
+
"((?:#{QuoteChar}|#{Pair})*)"
|
76
|
+
/x
|
77
|
+
TypeAndValue = /\A(#{AttributeType})=#{AttributeValue}/
|
78
|
+
|
79
|
+
module_function
|
80
|
+
|
81
|
+
def expand_pair(str)
|
82
|
+
return nil unless str
|
83
|
+
return str.gsub(Pair){
|
84
|
+
pair = $&
|
85
|
+
case pair.size
|
86
|
+
when 2 then pair[1,1]
|
87
|
+
when 3 then Integer("0x#{pair[1,2]}").chr
|
88
|
+
else raise OpenSSL::X509::NameError, "invalid pair: #{str}"
|
89
|
+
end
|
90
|
+
}
|
91
|
+
end
|
92
|
+
|
93
|
+
def expand_hexstring(str)
|
94
|
+
return nil unless str
|
95
|
+
der = str.gsub(HexPair){$&.to_i(16).chr }
|
96
|
+
a1 = OpenSSL::ASN1.decode(der)
|
97
|
+
return a1.value, a1.tag
|
98
|
+
end
|
99
|
+
|
100
|
+
def expand_value(str1, str2, str3)
|
101
|
+
value = expand_pair(str1)
|
102
|
+
value, tag = expand_hexstring(str2) unless value
|
103
|
+
value = expand_pair(str3) unless value
|
104
|
+
return value, tag
|
105
|
+
end
|
106
|
+
|
107
|
+
def scan(dn)
|
108
|
+
str = dn
|
109
|
+
ary = []
|
110
|
+
while true
|
111
|
+
if md = TypeAndValue.match(str)
|
112
|
+
remain = md.post_match
|
113
|
+
type = md[1]
|
114
|
+
value, tag = expand_value(md[2], md[3], md[4]) rescue nil
|
115
|
+
if value
|
116
|
+
type_and_value = [type, value]
|
117
|
+
type_and_value.push(tag) if tag
|
118
|
+
ary.unshift(type_and_value)
|
119
|
+
if remain.length > 2 && remain[0] == ?,
|
120
|
+
str = remain[1..-1]
|
121
|
+
next
|
122
|
+
elsif remain.length > 2 && remain[0] == ?+
|
123
|
+
raise OpenSSL::X509::NameError,
|
124
|
+
"multi-valued RDN is not supported: #{dn}"
|
125
|
+
elsif remain.empty?
|
126
|
+
break
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
msg_dn = dn[0, dn.length - str.length] + " =>" + str
|
131
|
+
raise OpenSSL::X509::NameError, "malformed RDN: #{msg_dn}"
|
132
|
+
end
|
133
|
+
return ary
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
137
|
+
class << self
|
138
|
+
def parse_rfc2253(str, template=OBJECT_TYPE_TEMPLATE)
|
139
|
+
ary = OpenSSL::X509::Name::RFC2253DN.scan(str)
|
140
|
+
self.new(ary, template)
|
141
|
+
end
|
142
|
+
|
143
|
+
def parse_openssl(str, template=OBJECT_TYPE_TEMPLATE)
|
144
|
+
ary = str.scan(/\s*([^\/,]+)\s*/).collect{|i| i[0].split("=", 2) }
|
145
|
+
self.new(ary, template)
|
146
|
+
end
|
147
|
+
|
148
|
+
alias parse parse_openssl
|
149
|
+
end
|
150
|
+
end
|
151
|
+
|
152
|
+
class StoreContext
|
153
|
+
def cleanup
|
154
|
+
warn "(#{caller.first}) OpenSSL::X509::StoreContext#cleanup is deprecated with no replacement" if $VERBOSE
|
155
|
+
end
|
156
|
+
end
|
157
|
+
end
|
158
|
+
end
|
Binary file
|
@@ -0,0 +1,18 @@
|
|
1
|
+
unless defined? JRUBY_VERSION
|
2
|
+
warn 'Loading jruby-openssl in a non-JRuby interpreter'
|
3
|
+
end
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'bouncy-castle-java'
|
7
|
+
rescue LoadError
|
8
|
+
# runs under restricted mode.
|
9
|
+
end
|
10
|
+
require 'jopenssl'
|
11
|
+
|
12
|
+
if RUBY_VERSION >= '1.9.0'
|
13
|
+
$LOAD_PATH.unshift(File.expand_path('../../1.9', __FILE__))
|
14
|
+
load(File.expand_path('../../1.9/openssl.rb', __FILE__))
|
15
|
+
else
|
16
|
+
$LOAD_PATH.unshift(File.expand_path('../../1.8', __FILE__))
|
17
|
+
load(File.expand_path('../../1.8/openssl.rb', __FILE__))
|
18
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'openssl'
|
@@ -0,0 +1 @@
|
|
1
|
+
require 'openssl'
|
File without changes
|
@@ -35,6 +35,7 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase
|
|
35
35
|
assert_equal(1, version.value.size)
|
36
36
|
assert_equal(OpenSSL::ASN1::Integer, version.value[0].class)
|
37
37
|
assert_equal(2, version.value[0].value)
|
38
|
+
assert_equal(OpenSSL::BN, version.value[0].value.class)
|
38
39
|
|
39
40
|
serial = tbs_cert.value[1]
|
40
41
|
assert_equal(OpenSSL::ASN1::Integer, serial.class)
|
@@ -194,4 +195,18 @@ class OpenSSL::TestASN1 < Test::Unit::TestCase
|
|
194
195
|
cululated_sig = key.sign(OpenSSL::Digest::SHA1.new, tbs_cert.to_der)
|
195
196
|
assert_equal(cululated_sig, sig_val.value)
|
196
197
|
end
|
198
|
+
|
199
|
+
def test_encode_boolean
|
200
|
+
encode_decode_test(OpenSSL::ASN1::Boolean, [true, false])
|
201
|
+
end
|
202
|
+
|
203
|
+
def test_encode_integer
|
204
|
+
encode_decode_test(OpenSSL::ASN1::Integer, [72, -127, -128, 128, -1, 0, 1, -(2**12345), 2**12345])
|
205
|
+
end
|
206
|
+
|
207
|
+
def encode_decode_test(type, values)
|
208
|
+
values.each do |v|
|
209
|
+
assert_equal(v, OpenSSL::ASN1.decode(type.new(v).to_der).value)
|
210
|
+
end
|
211
|
+
end
|
197
212
|
end if defined?(OpenSSL)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -90,9 +90,17 @@ class OpenSSL::TestPair < Test::Unit::TestCase
|
|
90
90
|
ssl_pair {|s1, s2|
|
91
91
|
s2.write "a\nbcd"
|
92
92
|
assert_equal("a\n", s1.gets)
|
93
|
-
|
93
|
+
read = s1.readpartial(10)
|
94
|
+
assert_equal("bcd"[0, read.bytesize], read)
|
95
|
+
s1.read(read.bytesize - 3) # drop unread bytes
|
96
|
+
|
94
97
|
s2.write "efg"
|
95
|
-
|
98
|
+
read = s1.readpartial(10)
|
99
|
+
assert_equal("efg"[0, read.bytesize], read)
|
100
|
+
rest = 3 - read.bytesize
|
101
|
+
while rest > 0
|
102
|
+
rest -= s1.readpartial(rest).size
|
103
|
+
end
|
96
104
|
s2.close
|
97
105
|
assert_raise(EOFError) { s1.readpartial(10) }
|
98
106
|
assert_raise(EOFError) { s1.readpartial(10) }
|
File without changes
|
File without changes
|