diff options
-rw-r--r-- | appveyor.yml | 6 | ||||
-rw-r--r-- | ext/openssl/extconf.rb | 6 | ||||
-rw-r--r-- | ext/openssl/ossl_asn1.c | 2 | ||||
-rw-r--r-- | test/test_asn1.rb | 7 |
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) |