ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] asn2wrs.py no longer seems to generate the same code ...

From: Pascal Quantin <pascal@xxxxxxxxxxxxx>
Date: Fri, 8 May 2020 17:42:11 +0200
Hi Richard,

Le ven. 8 mai 2020 à 17:08, Richard Sharpe <realrichardsharpe@xxxxxxxxx> a écrit :
Hi folks,

While figuring out how to get a dissection function for
ECDSA_Sig_Value, I noticed that asn2wrs.py no longer generates the
same code it once did.

I re-ran asn2wrs.py against epan/dissectors/asn1/pkcs1/pkcs1.cnf
(unmodified) and then compared the current output to what is checked
in. This is what I get:

-------------------------------------------
@@ -131,7 +131,7 @@

 static int
 dissect_pkcs1_DigestAlgorithmIdentifier(gboolean implicit_tag _U_,
tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree
*tree _U_, int hf_index _U_) {
-  offset = dissect_x509af_AlgorithmIdentifier(implicit_tag, tvb,
offset, actx, tree, hf_index);
+  offset = dissect_AuthenticationFramework_AlgorithmIdentifier(implicit_tag,
tvb, offset, actx, tree, hf_index);

   return offset;
 }
@@ -148,7 +148,7 @@


 static const ber_sequence_t DigestInfo_sequence[] = {
-  { &hf_pkcs1_digestAlgorithm, BER_CLASS_UNI, BER_UNI_TAG_SEQUENCE,
BER_FLAGS_NOOWNTAG, dissect_pkcs1_DigestAlgorithmIdentifier },
+  { &hf_pkcs1_digestAlgorithm, -1/*imported*/, -1/*imported*/,
BER_FLAGS_NOOWNTAG, dissect_pkcs1_DigestAlgorithmIdentifier },
   { &hf_pkcs1_digest        , BER_CLASS_UNI, BER_UNI_TAG_OCTETSTRING,
BER_FLAGS_NOOWNTAG, dissect_pkcs1_Digest },
   { NULL, 0, 0, 0, NULL }
 };
...
-----------------------------------

This seems like a problem ...

Perhaps I should file a bugzilla bug.

Didi you check the file history to see whether it was manually modified? It might not be a asn2wrs.py problem.

Best regards,
Pascal.