Skip to content

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

Closed
@cielavenir

Description

@cielavenir

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions