Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenSSL::ASN1::Sequence#each is broken #115

Closed
cielavenir opened this issue Mar 2, 2017 · 2 comments
Closed

OpenSSL::ASN1::Sequence#each is broken #115

cielavenir opened this issue Mar 2, 2017 · 2 comments

Comments

@cielavenir
Copy link

Ruby 2.0.0

irb> OpenSSL::ASN1::Sequence.new([OpenSSL::ASN1::Integer(1)]).each{|e|p e}
#<OpenSSL::ASN1::Integer:0x007f997dafffa0 @tag=2, @value=1, @tagging=nil, @tag_class=:UNIVERSAL, @infinite_length=false>
=> #<OpenSSL::ASN1::Sequence:0x007f997dafff50 @tag=16, @value=[#<OpenSSL::ASN1::Integer:0x007f997dafffa0 @tag=2, @value=1, @tagging=nil, @tag_class=:UNIVERSAL, @infinite_length=false>], @tagging=nil, @tag_class=:UNIVERSAL, @infinite_length=false>

Ruby 2.4.0

irb> OpenSSL::ASN1::Sequence.new([OpenSSL::ASN1::Integer(1)]).each{|e|p e}
=> #<OpenSSL::ASN1::Sequence:0x007fa5bf044d88 @tag=16, @value=[#<OpenSSL::ASN1::Integer:0x007fa5bf044e28 @tag=2, @value=1, @tagging=nil, @tag_class=:UNIVERSAL, @infinite_length=false>], @tagging=nil, @tag_class=:UNIVERSAL, @infinite_length=false>

It is obvious that sequence is not enumerated in Ruby 2.4. I believe that this is coming from ossl_asn1cons_each, which was changed between OpenSSL 2.0.0beta1 and 2.0.0.
I have confirmed that my ASN1 manipulation is all right in Ruby 1.9-2.3.0 using travis.

@rhenium
Copy link
Member

rhenium commented Mar 2, 2017

This should have been fixed by #96. Try openssl gem version 2.0.3.

@rhenium rhenium closed this as completed Mar 2, 2017
@cielavenir
Copy link
Author

cielavenir commented Mar 2, 2017

Ah, thank you so much. Perhaps for travis we have to wait for Ruby 2.4.1 release...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants