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

Wireshark-commits: [Wireshark-commits] master 7939d32: ssl, dtls: simplify keyfile handling

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Thu, 31 Jul 2014 11:08:21 +0000 (UTC)
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=7939d32ce29ad05548266cf8fd074b0b56fb7e37
Submitter: Michael Mann (mmann78@xxxxxxxxxxxx)
Changed: branch: master
Repository: wireshark

Commits:

7939d32 by Peter Wu (peter@xxxxxxxxxxxxx):

    ssl,dtls: simplify keyfile handling
    
    Previously, the keylog file would be fully parsed when an encrypted
    pre-master secret is encountered or in the ChangeCipherSpec stage. There
    was also a lot of duplication in the key logfile parsing.
    
    This patch simplifies the key logfile parsing by using regular
    expressions. Rather than scanning the key logfile for a specific key,
    do this scan once at ssl init and save the results to a hashtable. The
    map for session ID/tickets to master keys already existed, another one
    for client random to master key and encrypted pre-master to pre-master
    was added. This could later also be wired to the "Export SSL Keys"
    menu item for improved reliability (when no session ID or tickets are
    available, the client random could be used).
    
    The ssl_{save,restore}_session{,_ticket} functions have been converted
    to a single function that looks up a key (sid / client random / encr.
    pre-master) to a (pre-)master secret.
    
    Other minor changes: return booleans for some functions that can only
    fail/pass. Remove some functions from the ssl-utils header that have
    become private a few commits ago. Remove some outstanding issues
    from the comments in packet-ssl as they are already done, add myself
    to the ssl-utils header.
    
    These changes pass the test suite and the sample Session Ticket-enabled
    capture from https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5963
    
    On-the-fly decryption are broken with this patch since keylog files are
    read once at the start of a capture. This will be solved in a future
    patch.
    
    Change-Id: Idb343abe161950b5f3ff61bee093d0f4ef9655bd
    Reviewed-on: https://code.wireshark.org/review/3057
    Reviewed-by: Evan Huus <eapache@xxxxxxxxx>
    Petri-Dish: Evan Huus <eapache@xxxxxxxxx>
    Petri-Dish: Alexis La Goutte <alexis.lagoutte@xxxxxxxxx>
    Reviewed-by: Michael Mann <mmann78@xxxxxxxxxxxx>
    

Actions performed:

    from  a1032fa   Convert hf_packetbb_error filter (packetbb.error) to expert info.
    adds  7939d32   ssl,dtls: simplify keyfile handling


Summary of changes:
 epan/dissectors/packet-dtls.c      |   14 +-
 epan/dissectors/packet-ssl-utils.c |  585 +++++++++++++++---------------------
 epan/dissectors/packet-ssl-utils.h |   61 ++--
 epan/dissectors/packet-ssl.c       |   21 +-
 4 files changed, 283 insertions(+), 398 deletions(-)