Invalid ASN.1 type. Expected 0x30 received 0x20
Status: Beta
Brought to you by:
msinadinovic
Getting snmp exception - Invalid ASN.1 type. Expected 0x30 received 0x20 when parsing Vb in snmp response.
device: MCDATA Sphereon 4500 Model 001 Fibre Channel Switch, firmware 08.02.00 7
sysobjectid: .1.3.6.1.4.1.289.2.1.1.2
wireshark capture file is attached
could be a problem on device, but net-snmp is able to parse the same snmp response. I would like to be able at least to continue with next OID when this happens.
wireshark capture
Nice job with the WireShark captures. That made it easy.
I have reproduced the problem and the issue is that the storage switch sends OID values with length 0 which is illegal in the SMI notatation. If a value is length 0 then it should be sent as a Null value (also SMI requires each Oid to have a minimum of 2 values).
Anyway, I have added a workaround to the code to correctly interpret the 0 length Oids and will publish it in the upcoming version 0.7.6 of the library.
Thanks for the bug report!
-M
Fixed in version 0.7.6
Thanks for fast fix. Have another problem related to this:
- running 0.7.6 now
- it parses the response fine, but getting ArgumentNullException when it tries to Clone Oid object with the null (0.0) value - when I call "new Vb(v.Oid, v.Value)" where 'v' is Vb from result.Pdu.VbList. Exception is thrown in Oid.Set method. Is that fine and I should handle this case myself or there is something missing in your fix? Regards.
Thanks for pointing it out. There was an additional issue in the Oid.Set(int[]) method that didn't deal correctly with the parameter being set to null.
It's fixed in version 0.7.7.