From 940775b9486091ade014396f65ca84f731b38cf8 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Tue, 31 Jul 2018 21:57:42 -0700 Subject: Do most of the RFC 7468 file processing in the dissector. Have the Wiretap code just do a heuristic test to see if the file looks like a RFC 7468 file and just had the entire blob of raw file data to the caller, with an encapsulation type of WTAP_ENCAP_RFC7468. Have a file-rfc7468.c dissector that processes the lines of the file, displaying all of them. Have it extract the label from the pre-encapsulation boundary line, and, after it's decoded the base64-encoded data lines into a blob of data, try handing the tvbuff with the blob to dissectors that have registered in the "pem.preeb_label" dissector table with the appropriate label value, and hand it to the raw BER dissector only if that fails. This allows some files to have the content dissected as more than just a raw blob of BER-encoded data. Change-Id: I98db9f0beb86e5694fb8e886005a2df4fc96ba71 Reviewed-on: https://code.wireshark.org/review/28914 Reviewed-by: Guy Harris --- epan/dissectors/packet-cms.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'epan/dissectors/packet-cms.c') diff --git a/epan/dissectors/packet-cms.c b/epan/dissectors/packet-cms.c index c62c92be44..b247c2ec68 100644 --- a/epan/dissectors/packet-cms.c +++ b/epan/dissectors/packet-cms.c @@ -3346,5 +3346,5 @@ void proto_reg_handoff_cms(void) { content_info_handle = create_dissector_handle (dissect_ContentInfo_PDU, proto_cms); dissector_add_string("media_type", "application/pkcs7-mime", content_info_handle); dissector_add_string("media_type", "application/pkcs7-signature", content_info_handle); + dissector_add_string("rfc7468.preeb_label", "CMS", content_info_handle); } - -- cgit v1.2.3