Issue #4325 has been updated by Martin Bosslet.

Status changed from Open to Closed

I agree to wait until this causes problems for anyone. The current solution seems fine for now.
----------------------------------------
Bug #4325: [ext/openssl] Encoding of subclasses fails when it shouldn't
http://redmine.ruby-lang.org/issues/4325

Author: Martin Bosslet
Status: Closed
Priority: Normal
Assignee: Martin Bosslet
Category: ext
Target version: 1.9.3
ruby -v: trunk


=begin
 While skimming through ossl_asn1.c I noticed that my patch for infinite length encoding
 causes problems when encoding subclasses of OpenSSL::ASN1::Sequence or OpenSSL::ASN1::Set
 with infinite length.
 
 E.g. the following fails in trunk:
 
 require 'openssl'
 
 sub = Class.new(OpenSSL::ASN1::Sequence)
 instance = sub.new([OpenSSL::ASN1::EndOfContent.new])
 instance.infinite_length = true
 puts instance.to_der
 
 => test.rb:10:in `to_der': invalid constructed encoding (OpenSSL::ASN1::ASN1Error)
 	from test.rb:10:in `<main>'
 
 This can be fixed with the appended code that checks for subclass relationship instead
 of comparing the class directly with Set or Sequence.
 
 Regards,
 Martin
=end



-- 
http://redmine.ruby-lang.org