Supported ASN NULL objects. Kindof trivial but nice for completeness.

This commit is contained in:
blackhedd 2006-11-27 22:57:17 +00:00
parent e001f0413e
commit fad144bcbc

View file

@ -50,6 +50,10 @@ module Net
end end
end end
class BerIdentifiedNull
attr_accessor :ber_identifier
end
#-- #--
# This condenses our nicely self-documenting ASN hashes down # This condenses our nicely self-documenting ASN hashes down
# to an array for fast lookups. # to an array for fast lookups.
@ -78,18 +82,18 @@ module Net
TagClasses = [:universal, :application, :context_specific, :private] TagClasses = [:universal, :application, :context_specific, :private]
BuiltinSyntax = BER.compile_syntax( { BuiltinSyntax = BER.compile_syntax( {
:universal => { :universal => {
:primitive => { :primitive => {
1 => :boolean, 1 => :boolean,
2 => :integer, 2 => :integer,
4 => :string, 4 => :string,
10 => :integer, 10 => :integer,
}, },
:constructed => { :constructed => {
16 => :array, 16 => :array,
17 => :array 17 => :array
} }
} }
}) })
# #
@ -184,6 +188,10 @@ module Net
seq seq
elsif objtype == :boolean elsif objtype == :boolean
newobj != "\000" newobj != "\000"
elsif objtype == :null
n = BerIdentifiedNull.new
n.ber_identifier = id
n
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}" )
raise BerError.new( "unsupported object type: id=#{id}" ) raise BerError.new( "unsupported object type: id=#{id}" )