Wireshark-commits: [Wireshark-commits] master 940775b: Do most of the RFC 7468 file processing in t

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Wed, 01 Aug 2018 04:58:54 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=940775b9486091ade014396f65ca84f731b38cf8
Submitter: Guy Harris (guy@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

940775b by Guy Harris (guy@xxxxxxxxxxxx):

    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 <guy@xxxxxxxxxxxx>
    

Actions performed:

    from  9cf292a   Revert "Have find_or_create_conversation() use pinfo->conv_endpoint if present."
    adds  940775b   Do most of the RFC 7468 file processing in the dissector.


Summary of changes:
 epan/dissectors/CMakeLists.txt                     |   1 +
 epan/dissectors/asn1/cms/packet-cms-template.c     |   2 +-
 .../asn1/x509af/packet-x509af-template.c           |   6 +-
 epan/dissectors/file-rfc7468.c                     | 485 +++++++++++++++++++++
 epan/dissectors/packet-cms.c                       |   2 +-
 epan/dissectors/packet-x509af.c                    |   6 +-
 wiretap/pem.c                                      | 192 ++++----
 wiretap/wtap.c                                     |   3 +
 wiretap/wtap.h                                     |   1 +
 9 files changed, 578 insertions(+), 120 deletions(-)
 create mode 100644 epan/dissectors/file-rfc7468.c