From: Martin Bosslet Date: 2011-02-07T04:46:53+09:00 Subject: [ruby-core:35124] [Ruby 1.9-Bug#4374] [ext/openssl] ASN1.decode wrong for infinite length values Issue #4374 has been updated by Martin Bosslet. I verified that with the current code it's not possible to construct a Constructive instance without tagging if the tag_class is passed as an explicit parameter. Tagging will be set to :EXPLICIT if it was passed as nil. That's why if (infinite && !(tag == V_ASN1_SEQUENCE || tag == V_ASN1_SET)){ asn1data = rb_funcall(cASN1Constructive, rb_intern("new"), 4, value, INT2NUM(tag), Qnil, ID2SYM(tag_class)); in ossl_asn1_decode0 will always produce a Constructive with :EXPLICIT tagging, and reencoding a parsed ASN.1 value will fail or produce incorrect output. At first I thought changing the defaults in ossl_asn1_initialize would be more intuitive but not essential to the fix - but now I think it has become mandatory. ---------------------------------------- http://redmine.ruby-lang.org/issues/show/4374 ---------------------------------------- http://redmine.ruby-lang.org