[SNMP4J] ASN.1 data length error

Young, Alistair alistair.young at logica.com
Mon Sep 7 10:13:14 CEST 2009


Thank you, Frank - I wondered if that might be the case.  Looks like suspicion now falls on the client software... :)

-----Original Message-----
From: Frank Fock [mailto:fock at agentpp.com] 
Sent: 06 September 2009 22:12
To: Young, Alistair
Cc: snmp4j at agentpp.org
Subject: Re: [SNMP4J] ASN.1 data length error

Hello Alistair,

For SNMP BER (which is not ASN.1 BER!), length > 4 bytes are not allowed and do not make sense as the maximum length of a SNMP packet is 65536 bytes.

Thus, the request is invalid. SNMP4J would be able to handle it but ensures that the protocol is not violated (fail fast strategy).

Best regards,
Frank

Young, Alistair wrote:
> Hello,
>  
> I have an agent built upon SNMP4J.  A third-party application is 
> performing a number of gets and sets on the agent.  It all mostly 
> works
> - however, I sometimes see the following error being logged:
>  
> ASN.1 parse error: Data length > 4 bytes are not supported!
>  
> I /think/ that this is in response to a 'set' request.
>  
> I found an old message on this subject, from this list's archives:
> http://lists.agentpp.org/pipermail/snmp4j/2007-May/002123.html
>  
> The response from Frank was "I would guess that the [...] tool does 
> not correctly BER encode the request."
>  
> My knowledge of ASN.1 and BER is minimal (basically what I've gleaned 
> from Wikipedia over the last 30 minutes!).  As I understand it, as 
> well as specifying the length of a data value, it is also possible to 
> specify the "length of the length".  This error suggests that whatever 
> data is being received has a "length of the length" greater than 4 
> bytes.  As far as I can tell, this is valid ASN.1/BER.
>  
> So my question is - is this an invalid SNMP request (i.e. the 'client'
> application is wrong), or is this a limitation of SNMP4J (i.e. the 
> agent application is wrong)?  Or possibly something else (is general 
> corruption a possibility, or does the fact that the processing has got 
> this far imply that the basic structure is sound?).
>  
> Many thanks for any help,
>  
>  
> Alistair.
> 
> 
> Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.
> 
> 
> 
> This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.
> 
> 
> 
> ----------------------------------------------------------------------
> --
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com



Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.





More information about the SNMP4J mailing list