aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-01-17 13:34:34 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-01-17 13:34:34 +0900
commita1b4a89b381fd5dd773656e9edbfc2eb761886e6 (patch)
tree6e93b1ca46319a4fd442def897adb90e9c109930
parentf297f18deb5bc9669e9defc88aa0af454856fe08 (diff)
parentbe817ba62b71cb3635aa805338a6d536db4af8f8 (diff)
downloadruby-openssl-a1b4a89b381fd5dd773656e9edbfc2eb761886e6.tar.gz
Merge branch 'maint'
* maint: appveyor.yml: update OpenSSL version to 1.0.2j Fix build with static OpenSSL libraries on Windows Fix for ASN1::Constructive 'each' implementation
-rw-r--r--appveyor.yml6
-rw-r--r--ext/openssl/extconf.rb6
-rw-r--r--ext/openssl/ossl_asn1.c2
-rw-r--r--test/test_asn1.rb7
4 files changed, 17 insertions, 4 deletions
diff --git a/appveyor.yml b/appveyor.yml
index c3e9c303..bd72cede 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -2,9 +2,9 @@
clone_depth: 10
install:
- SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
- - appveyor DownloadFile http://dl.bintray.com/oneclick/OpenKnapsack/x64/openssl-1.0.1m-x64-windows.tar.lzma
- - 7z e openssl-1.0.1m-x64-windows.tar.lzma
- - 7z x -y -oC:\Ruby%ruby_version% openssl-1.0.1m-x64-windows.tar
+ - appveyor DownloadFile http://dl.bintray.com/oneclick/OpenKnapsack/x64/openssl-1.0.2j-x64-windows.tar.lzma
+ - 7z e openssl-1.0.2j-x64-windows.tar.lzma
+ - 7z x -y -oC:\Ruby%ruby_version% openssl-1.0.2j-x64-windows.tar
- ruby -S rake install_dependencies
build_script:
- rake -rdevkit compile -- --with-openssl-dir=C:\Ruby%ruby_version%
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index 2d846132..a97883c1 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -37,6 +37,12 @@ have_library("socket", "socket")
Logging::message "=== Checking for required stuff... ===\n"
result = pkg_config("openssl") && have_header("openssl/ssl.h")
unless result
+ if $mswin || $mingw
+ # required for static OpenSSL libraries
+ have_library("gdi32") # OpenSSL <= 1.0.2 (for RAND_screen())
+ have_library("crypt32")
+ end
+
result = have_header("openssl/ssl.h")
result &&= %w[crypto libeay32].any? {|lib| have_library(lib, "CRYPTO_malloc")}
result &&= %w[ssl ssleay32].any? {|lib| have_library(lib, "SSL_new")}
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 1977fdd2..9b554820 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -1273,7 +1273,7 @@ ossl_asn1cons_to_der(VALUE self)
static VALUE
ossl_asn1cons_each(VALUE self)
{
- rb_funcall(ossl_asn1_get_value(self), id_each, 0);
+ rb_block_call(ossl_asn1_get_value(self), id_each, 0, 0, 0, 0);
return self;
}
diff --git a/test/test_asn1.rb b/test/test_asn1.rb
index b14ebd55..a59c531d 100644
--- a/test/test_asn1.rb
+++ b/test/test_asn1.rb
@@ -566,6 +566,13 @@ rEzBQ0F9dUyqQ9gyRg8KHhDfv9HzT1d/rnUZMkoombwYBRIUChGCYV0GnJcan2Zm
assert_equal 17, ret[0][6]
end
+ def test_constructive_each
+ data = [OpenSSL::ASN1::Integer.new(0), OpenSSL::ASN1::Integer.new(1)]
+ seq = OpenSSL::ASN1::Sequence.new data
+
+ assert_equal data, seq.entries
+ end
+
private
def assert_universal(tag, asn1)