mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/openssl/test_ssl.rb: Fix test for CVE-2013-4073.
Patch by Antonio Terceiro. [Bug #8750] [ruby-core:56437] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b01b3e22bf
commit
885147037b
2 changed files with 7 additions and 2 deletions
|
@ -1,3 +1,8 @@
|
|||
Thu Aug 8 05:59:00 2013 Charlie Somerville <charliesome@ruby-lang.org>
|
||||
|
||||
* test/openssl/test_ssl.rb: Fix test for CVE-2013-4073.
|
||||
Patch by Antonio Terceiro. [Bug #8750] [ruby-core:56437]
|
||||
|
||||
Thu Aug 8 03:37:38 2013 Eric Hodel <drbrain@segment7.net>
|
||||
|
||||
* lib/webrick/httpresponse.rb: Allow #body to be an IO-like object
|
||||
|
|
|
@ -341,7 +341,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
|
|||
[true, false].each do |criticality|
|
||||
cert = create_null_byte_SAN_certificate(criticality)
|
||||
assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, 'www.example.com'))
|
||||
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, 'www.example.com\0.evil.com'))
|
||||
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, "www.example.com\0.evil.com"))
|
||||
assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, '192.168.7.255'))
|
||||
assert_equal(true, OpenSSL::SSL.verify_certificate_identity(cert, '192.168.7.1'))
|
||||
assert_equal(false, OpenSSL::SSL.verify_certificate_identity(cert, '13::17'))
|
||||
|
@ -358,7 +358,7 @@ class OpenSSL::TestSSL < OpenSSL::SSLTestCase
|
|||
ext_asn1 = OpenSSL::ASN1.decode(ext.to_der)
|
||||
san_list_der = ext_asn1.value.reduce(nil) { |memo,val| val.tag == 4 ? val.value : memo }
|
||||
san_list_asn1 = OpenSSL::ASN1.decode(san_list_der)
|
||||
san_list_asn1.value[0].value = 'www.example.com\0.evil.com'
|
||||
san_list_asn1.value[0].value = "www.example.com\0.evil.com"
|
||||
pos = critical ? 2 : 1
|
||||
ext_asn1.value[pos].value = san_list_asn1.to_der
|
||||
real_ext = OpenSSL::X509::Extension.new ext_asn1
|
||||
|
|
Loading…
Reference in a new issue