Fixed two bugs:
1) We were incorrectly halting sequence-parses when the sequence contained a boolean FALSE value; 2) We were generating application strings with a tag class of 0x80 (context-specific) rather than 0x40.
This commit is contained in:
parent
1decab1aaf
commit
1b8bce9051
1 changed files with 7 additions and 4 deletions
|
@ -106,7 +106,12 @@ module Net
|
||||||
when :array
|
when :array
|
||||||
seq = []
|
seq = []
|
||||||
sio = StringIO.new( newobj || "" )
|
sio = StringIO.new( newobj || "" )
|
||||||
while e = sio.read_ber(syntax); seq << e; end
|
# Interpret the subobject, but note how the loop
|
||||||
|
# is built: nil ends the loop, but false (a valid
|
||||||
|
# BER value) does not!
|
||||||
|
while (e = sio.read_ber(syntax)) != nil
|
||||||
|
seq << e
|
||||||
|
end
|
||||||
seq
|
seq
|
||||||
else
|
else
|
||||||
raise BerError.new( "unsupported object type: class=#{tagclass}, encoding=#{encoding}, tag=#{tag}" )
|
raise BerError.new( "unsupported object type: class=#{tagclass}, encoding=#{encoding}, tag=#{tag}" )
|
||||||
|
@ -224,11 +229,9 @@ class String
|
||||||
|
|
||||||
#
|
#
|
||||||
# to_ber_application_string
|
# to_ber_application_string
|
||||||
# TODO. WARNING, IS THIS WRONG? Shouldn't app-specific string
|
|
||||||
# have a prefix of 0x40?
|
|
||||||
#
|
#
|
||||||
def to_ber_application_string code
|
def to_ber_application_string code
|
||||||
to_ber( 0x80 + code )
|
to_ber( 0x40 + code )
|
||||||
end
|
end
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Add table
Reference in a new issue