Skip to content

Conversation

@evverx
Copy link
Contributor

@evverx evverx commented Jan 4, 2025

https://www.rfc-editor.org/rfc/rfc6704.html#section-3.1.1

   The FORCERENEW_NONCE_CAPABLE option contains code 145, length n, and
   a sequence of algorithms the client supports:

             Code   Len   Algorithms
            +-----+-----+----+----+----+
            | 145 |  n  | A1 | A2 | A3 | ....
            +-----+-----+----+----+----+

The _DHCPParamReqFieldListField class was renamed because the format of the Parameter Request List option is the same in the sense that it's just a sequence of bytes so it can be reused to implement the Forcerenew Nonce Protocol Capability option as well to make fuzz() work.

The patch was also tested with Wireshark:

>>> tdecode(Ether()/IP()/UDP()/BOOTP()/DHCP(options=[('forcerenew_nonce_capable', ['HMAC-MD5', 2, 3])]))
...
    Option: (145) Forcerenew Nonce Capable
        Length: 3
        Algorithm: HMAC-MD5 (1)
        Algorithm: Unknown (2)
        Algorithm: Unknown (3)

https://www.rfc-editor.org/rfc/rfc6704.html#section-3.1.1
```
   The FORCERENEW_NONCE_CAPABLE option contains code 145, length n, and
   a sequence of algorithms the client supports:

             Code   Len   Algorithms
            +-----+-----+----+----+----+
            | 145 |  n  | A1 | A2 | A3 | ....
            +-----+-----+----+----+----+
```

The `_DHCPParamReqFieldListField` class was renamed because the format
of the Parameter Request List option is the same in the sense that it's
just a sequence of bytes so it can be reused to implement the Forcerenew
Nonce Protocol Capability option as well to make fuzz() work.

The patch was also tested with Wireshark:
```
>>> tdecode(Ether()/IP()/UDP()/BOOTP()/DHCP(options=[('forcerenew_nonce_capable', ['HMAC-MD5', 2, 3])]))
...
    Option: (145) Forcerenew Nonce Capable
        Length: 3
        Algorithm: HMAC-MD5 (1)
        Algorithm: Unknown (2)
        Algorithm: Unknown (3)
```
@codecov
Copy link

codecov bot commented Jan 4, 2025

Codecov Report

Attention: Patch coverage is 33.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 81.33%. Comparing base (a28d74a) to head (76ddf47).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
scapy/layers/dhcp.py 33.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4630      +/-   ##
==========================================
- Coverage   81.39%   81.33%   -0.07%     
==========================================
  Files         359      341      -18     
  Lines       86052    85780     -272     
==========================================
- Hits        70045    69766     -279     
- Misses      16007    16014       +7     
Files with missing lines Coverage Δ
scapy/layers/dhcp.py 83.44% <33.33%> (-0.06%) ⬇️

... and 274 files with indirect coverage changes

Copy link
Member

@gpotter2 gpotter2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the PR !

@gpotter2 gpotter2 merged commit c424205 into secdev:master Jan 4, 2025
24 checks passed
@gpotter2 gpotter2 added this to the 2.7.0 milestone Nov 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants