Wireshark-dev: [Wireshark-dev] Re: asn2wrs: crash on cross-module type references

From: Joakim <oakimk@xxxxxxxxx>
Date: Sun, 8 Nov 2026 22:28:45 +0100
Hi,

Not a bug per say maybe but not yet supported in our generator script, but you are in luck!
During my change adding ETSI TS 102 232-1 dissector I needed to fix this limitation!
see https://gitlab.com/wireshark/wireshark/-/merge_requests/27709

//Joakim

On Thu, 22 Oct 2026 at 15:12, wireshark via Wireshark-dev <wireshark-dev@xxxxxxxxxxxxx> wrote:
Hi all,

I found a little bug in asn2wrs while working with 3GPP TS 33.128.

p_ExternalTypeReference returns a Node instead of a Type, causing an AttributeError on AddTag() or SetName().

Suggested fix (tools/dissector_generators/asn2wrs.py)
- t[0] = Node ('ExternalTypeReference', module = t[1], typ = t[3])
+ t[0] = Type ('ExternalTypeReference', module = t[1], typ = t[3])

Minimal reproducer


MODULE-B.asn:

MODULE-B DEFINITIONS ::= BEGIN
EXPORTS Bar;
Bar ::= SEQUENCE { x INTEGER }
END


MODULE-A.asn:

MODULE-A DEFINITIONS ::= BEGIN
IMPORTS Bar FROM MODULE-B;
Foo ::= [161] MODULE-B.Bar
END

Run: python3 tools/dissector_generators/asn2wrs.py -b -L -p testext -D . MODULE-A.asn MODULE-B.asn

Tested on master (15d648535d9e).

Best regards,

Koen

________________________________
Dit bericht kan informatie bevatten die niet voor u is bestemd. Indien u niet de geadresseerde bent of dit bericht abusievelijk aan u is toegezonden, wordt u verzocht dat aan de afzender te melden en het bericht te verwijderen. De Staat aanvaardt geen aansprakelijkheid voor schade, van welke aard ook, die verband houdt met risico's verbonden aan het elektronisch verzenden van berichten.

Ministerie van Justitie en Veiligheid

This message may contain information that is not intended for you. If you are not the addressee or if this message was sent to you by mistake, you are requested to inform the sender and delete the message. The State accepts no liability for damage of any kind resulting from the risks inherent in the electronic transmission of messages.

Ministry of Justice and Security

_______________________________________________
Wireshark-dev mailing list -- wireshark-dev@xxxxxxxxxxxxx
To unsubscribe send an email to wireshark-dev-leave@xxxxxxxxxxxxx