scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Added support for Counter64 in asn1 and ber (for snmp v2c)

Open cessna85 opened this issue 2 years ago • 1 comments

Checklist:

  • [ x] If you are new to Scapy: I have checked CONTRIBUTING.md (esp. section submitting-pull-requests)
  • [ x] I squashed commits belonging together
  • [ x] I added unit tests or explained why they are not relevant
  • [ x] I executed the regression tests (using cd test && ./run_tests or tox)
  • [ x] If the PR is still not finished, please create a Draft Pull Request

Fixes broken dissection of Counter64 values required for SNMP v2c I don't believe unit tests are necessary since this is the same implementation that was previously in the code. This value of 6 comes from RFC2578 Section 2 Page 8

-- for counters that wrap in less than one hour with only 32 bits
Counter64 ::=
    [APPLICATION 6]
        IMPLICIT INTEGER (0..18446744073709551615)

Scapy may want to include the Opaque type as well from the standard but I believe that would be a different issue.

fixes #4270

cessna85 avatar Feb 07 '24 14:02 cessna85

Codecov Report

Merging #4272 (4ce3369) into master (286523c) will increase coverage by 31.65%. Report is 4 commits behind head on master. The diff coverage is 100.00%.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #4272       +/-   ##
===========================================
+ Coverage   49.67%   81.32%   +31.65%     
===========================================
  Files         342      349        +7     
  Lines       76267    81851     +5584     
===========================================
+ Hits        37885    66568    +28683     
+ Misses      38382    15283    -23099     
Files Coverage Δ
scapy/asn1/asn1.py 85.98% <100.00%> (+18.76%) :arrow_up:
scapy/asn1/ber.py 86.64% <100.00%> (+46.91%) :arrow_up:

... and 260 files with indirect coverage changes

codecov[bot] avatar Feb 07 '24 14:02 codecov[bot]