summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2016-12-30 02:25:19 +0900
committerGitHub <noreply@github.com>2016-12-30 02:25:19 +0900
commit46674c38caca74732a0092c725849b5bf39d1df8 (patch)
treedd7e30eacd31c79a04d4b8ad09f6b812547de530
parent0a74f209ad8e3247932f6eaaa0c0cac6a99510b4 (diff)
parentd7470d9756a361d7ced6ed5178c6aa4189ca661c (diff)
downloadruby-openssl-46674c38caca74732a0092c725849b5bf39d1df8.tar.gz
Merge pull request #96 from CBonnell/master
Fix for ASN1::Constructive 'each' implementation
-rw-r--r--ext/openssl/ossl_asn1.c2
-rw-r--r--test/test_asn1.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/ext/openssl/ossl_asn1.c b/ext/openssl/ossl_asn1.c
index 534796f5..1d3ee4ac 100644
--- a/ext/openssl/ossl_asn1.c
+++ b/ext/openssl/ossl_asn1.c
@@ -1291,7 +1291,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 a0ac1ddb..91ae2cfd 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)