From: "Mantas Mikulėnas" Date: 2012-02-05T22:29:22+09:00 Subject: [ruby-core:42358] [ruby-trunk - Bug #5972][Open] OpenSSL::ASN1::GeneralString - double INT2NUM() results in invalid ASN.1 tag Issue #5972 has been reported by Mantas Mikul��nas. ---------------------------------------- Bug #5972: OpenSSL::ASN1::GeneralString - double INT2NUM() results in invalid ASN.1 tag https://bugs.ruby-lang.org/issues/5972 Author: Mantas Mikul��nas Status: Open Priority: Normal Assignee: Category: ext Target version: ruby -v: ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux] In ext/openssl/ossl_asn1.c, INT2NUM() is being called twice for V_ASN1_GENERALSTRING: rb_hash_aset(class_tag_map, cASN1GeneralString, INT2NUM(INT2NUM(V_ASN1_GENERALSTRING))); This causes OpenSSL::ASN1::GeneralString.new to return "unsupported ASN.1 type": $ irb -ropenssl irb > OpenSSL::ASN1::GeneralString.new("foo").to_der OpenSSL::ASN1::ASN1Error: unsupported ASN.1 type from (irb):1:in `to_der' from (irb):1 from /usr/bin/irb:12:in `
' irb > Expected result: $ irb -ropenssl irb > OpenSSL::ASN1::GeneralString.new("foo").to_der => "\e\x03foo" irb > Patch attached. -- http://bugs.ruby-lang.org/