pycrate icon indicating copy to clipboard operation
pycrate copied to clipboard

Support for partial decoding when input message is truncated or when decoding fails.

Open dbressan2 opened this issue 4 months ago • 2 comments

Hi When an ASN.1 UPER decoding fails, end user is given very little information. Typically, stderr just contains "bitlen overflow: 4, max 0". It is common to get only a partial logging of a message, and decoding it would be useful.

Maybe it is already supported, but I do not know how to activate it. Ideally, I would like to retrieve the decoding results up to the point where decoding failed, either due to message not being properly formatted or being truncated.

Wireshark RRC decoder for 3GPP supports such a feature. Wireshark dissector prints all partial decoding results followed by "[Expert Info (Error/Malformed): Malformed Packet (Exception occurred)]", highlighting the information element where decoding failed.

This feature would be useful for debugging (from which field does decoding fails ? ) and for understanding what a log contains when e.g. only the first 100 bytes of a message are logged due to memory constraints.

Thanks in advance

dbressan2 avatar Oct 01 '25 09:10 dbressan2