Skip to content

Commit 8795838

Browse files
committed
openssl: import v2.0.3
Import Ruby/OpenSSL 2.0.3. Only bugfixes. The full commit log since 2.0.2 (imported at r57146) can be found at: ruby/openssl@v2.0.2...v2.0.3 ---------------------------------------------------------------- Corey Bonnell (1): Fix for ASN1::Constructive 'each' implementation Kazuki Yamaguchi (10): Fix build with static OpenSSL libraries on Windows ([ruby-core:78878] [Bug #13080]) Merge pull request #96 from CBonnell/master Merge branch 'topic/windows-static-linking-without-pkg-config' into maint appveyor.yml: update OpenSSL version to 1.0.2j buffering: fix typo in doc test/envutil: fix assert_raise_with_message x509: fix OpenSSL::X509::Name#eql? ([ruby-core:79310] [Bug #13170]) ruby-openssl-docker: update versions of Ruby and OpenSSL .travis.yml: test with Ruby 2.4 Ruby/OpenSSL 2.0.3 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57482 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b8afbf5 commit 8795838

File tree

8 files changed

+32
-9
lines changed

8 files changed

+32
-9
lines changed

ext/openssl/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@
3737
Logging::message "=== Checking for required stuff... ===\n"
3838
result = pkg_config("openssl") && have_header("openssl/ssl.h")
3939
unless result
40+
if $mswin || $mingw
41+
# required for static OpenSSL libraries
42+
have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
43+
have_library("crypt32")
44+
end
45+
4046
result = have_header("openssl/ssl.h")
4147
result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "CRYPTO_malloc")}
4248
result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_new")}

ext/openssl/lib/openssl/buffering.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def read_nonblock(maxlen, buf=nil, exception: true)
189189
end
190190

191191
##
192-
# Reads the next "line+ from the stream. Lines are separated by +eol+. If
192+
# Reads the next "line" from the stream. Lines are separated by +eol+. If
193193
# +limit+ is provided the result will not be longer than the given number of
194194
# bytes.
195195
#
@@ -344,7 +344,7 @@ def write(s)
344344
end
345345

346346
##
347-
# Writes +str+ in the non-blocking manner.
347+
# Writes +s+ in the non-blocking manner.
348348
#
349349
# If there is buffered data, it is flushed first. This may block.
350350
#

ext/openssl/openssl.gemspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# -*- encoding: utf-8 -*-
2-
# stub: openssl 2.0.2 ruby lib
2+
# stub: openssl 2.0.3 ruby lib
33
# stub: ext/openssl/extconf.rb
44

55
Gem::Specification.new do |s|
66
s.name = "openssl".freeze
7-
s.version = "2.0.2"
7+
s.version = "2.0.3"
88

99
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
1010
s.require_paths = ["lib".freeze]
1111
s.authors = ["Martin Bosslet".freeze, "SHIBATA Hiroshi".freeze, "Zachary Scott".freeze, "Kazuki Yamaguchi".freeze]
12-
s.date = "2016-12-22"
12+
s.date = "2017-01-31"
1313
s.description = "It wraps the OpenSSL library.".freeze
1414
s.email = ["ruby-core@ruby-lang.org".freeze]
1515
s.extensions = ["ext/openssl/extconf.rb".freeze]
@@ -19,7 +19,7 @@ Gem::Specification.new do |s|
1919
s.licenses = ["Ruby".freeze]
2020
s.rdoc_options = ["--main".freeze, "README.md".freeze]
2121
s.required_ruby_version = Gem::Requirement.new(">= 2.3.0".freeze)
22-
s.rubygems_version = "2.6.8".freeze
22+
s.rubygems_version = "2.6.10".freeze
2323
s.summary = "OpenSSL provides SSL, TLS and general purpose cryptography.".freeze
2424

2525
if s.respond_to? :specification_version then

ext/openssl/ossl_asn1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1291,7 +1291,7 @@ ossl_asn1cons_to_der(VALUE self)
12911291
static VALUE
12921292
ossl_asn1cons_each(VALUE self)
12931293
{
1294-
rb_funcall(ossl_asn1_get_value(self), id_each, 0);
1294+
rb_block_call(ossl_asn1_get_value(self), id_each, 0, 0, 0, 0);
12951295

12961296
return self;
12971297
}

ext/openssl/ossl_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
#if !defined(_OSSL_VERSION_H_)
1111
#define _OSSL_VERSION_H_
1212

13-
#define OSSL_VERSION "2.0.2"
13+
#define OSSL_VERSION "2.0.3"
1414

1515
#endif /* _OSSL_VERSION_H_ */

ext/openssl/ossl_x509name.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ ossl_x509name_eql(VALUE self, VALUE other)
375375
if (!rb_obj_is_kind_of(other, cX509Name))
376376
return Qfalse;
377377

378-
return ossl_x509name_cmp0(self, other) ? Qtrue : Qfalse;
378+
return ossl_x509name_cmp0(self, other) == 0 ? Qtrue : Qfalse;
379379
}
380380

381381
/*

test/openssl/test_asn1.rb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -566,6 +566,13 @@ def test_decode_constructed_overread
566566
assert_equal 17, ret[0][6]
567567
end
568568

569+
def test_constructive_each
570+
data = [OpenSSL::ASN1::Integer.new(0), OpenSSL::ASN1::Integer.new(1)]
571+
seq = OpenSSL::ASN1::Sequence.new data
572+
573+
assert_equal data, seq.entries
574+
end
575+
569576
private
570577

571578
def assert_universal(tag, asn1)

test/openssl/test_x509name.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,16 @@ def test_hash
357357
assert_equal(expected, name_hash(name))
358358
end
359359

360+
def test_equality
361+
name0 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "bar.ruby-lang.org"]])
362+
name1 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "bar.ruby-lang.org"]])
363+
name2 = OpenSSL::X509::Name.new([["DC", "org"], ["DC", "ruby-lang"], ["CN", "baz.ruby-lang.org"]])
364+
assert_equal true, name0 == name1
365+
assert_equal true, name0.eql?(name1)
366+
assert_equal false, name0 == name2
367+
assert_equal false, name0.eql?(name2)
368+
end
369+
360370
def test_dup
361371
name = OpenSSL::X509::Name.parse("/CN=ruby-lang.org")
362372
assert_equal(name.to_der, name.dup.to_der)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy