Wireshark-commits: [Wireshark-commits] master a96d0bb: BER: fix regression in dissection of named b

From: Wireshark code review <code-review-do-not-reply@xxxxxxxxxxxxx>
Date: Fri, 12 Apr 2019 08:38:07 +0000
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=a96d0bb946eebf924a1e947ee6ce72f41069e1df
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark

Commits:

a96d0bb by Peter Wu (peter@xxxxxxxxxxxxx):

    BER: fix regression in dissection of named bit list
    
    The bitmask for every header field is 8 bits, do not pass 64-bit values
    to proto_tree_add_bitmask_list since the bitmask would always match
    against the (possibly wrong) lower 8 bits. Instead process 8 bits at a
    time, as before gc2ac157ac0.
    
    Since g37b91eedd6, a dissector exception is thrown when the number of
    bytes covering the BIT STRING value is smaller than the number of named
    bit fields. (Trailing zero bits in a BIT STRING with named bit fields do
    not have to be encoded.) Fix this by assuming zeroes.
    
    Restructure the code to reduce duplication and add some comments. Tested
    with the capture from 15684 (attachment 17045), check the keyUsage
    extension in the Certificate message (frame 5).
    
    Bug: 15673
    Change-Id: Ifa010b9df3e4b46941c00e4f830a03efc589ac21
    Fixes: v3.1.0rc0-431-gc2ac157ac0 ("ASN.1: Use  proto_tree_add_bitmask... () for named bits.")
    Fixes: v3.1.0rc0-458-g37b91eedd6 ("BER: fix dissection of bitmask lists with an invalid length")
    Reviewed-on: https://code.wireshark.org/review/32820
    Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
    

Actions performed:

    from  a65f7f583 QUIC: update transport parameters for draft -19
     add  a96d0bb   BER: fix regression in dissection of named bit list


Summary of changes:
 epan/dissectors/packet-ber.c | 81 +++++++++++++++++++++-----------------------
 1 file changed, 39 insertions(+), 42 deletions(-)